]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/util/PasswordHash.java
upd: exchanged assure, assurance, Assurer with verification and RA Agent
[gigi.git] / src / org / cacert / gigi / util / PasswordHash.java
index 04e686189339b1aa936d73f60dbf2fda44a2ffd4..6d598e77575f706fb8d6804eb9dcab748394b408 100644 (file)
@@ -15,7 +15,8 @@ public class PasswordHash {
      *            The password that should result in the given hash.
      * @param hash
      *            The hash to verify the password against.
-     * @return <ul>
+     * @return
+     *         <ul>
      *         <li><code>null</code>, if the password was valid</li>
      *         <li><code>hash</code>, if the password is valid and the hash
      *         doesn't need to be updated</li>
@@ -24,6 +25,9 @@ public class PasswordHash {
      *         </ul>
      */
     public static String verifyHash(String password, String hash) {
+        if (password == null || password.isEmpty()) {
+            return null;
+        }
         if (hash.contains("$")) {
             if (SCryptUtil.check(password, hash)) {
                 return hash;