jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1581950 - /jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java
Date Wed, 26 Mar 2014 17:25:22 GMT
Author: angela
Date: Wed Mar 26 17:25:22 2014
New Revision: 1581950

URL: http://svn.apache.org/r1581950
Log:
minor improvement

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java?rev=1581950&r1=1581949&r2=1581950&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/spi/security/user/util/PasswordUtil.java
Wed Mar 26 17:25:22 2014
@@ -185,16 +185,17 @@ public final class PasswordUtil {
         return false;
     }
     
+    //------------------------------------------------------------< private >---
     /**
      * Compare two strings. The comparison is constant time: it will always loop
      * over all characters and doesn't use conditional operations in the loop to
      * make sure an attacker can not use a timing attack.
-     * 
+     *
      * @param a
      * @param b
      * @return true if both parameters contain the same data.
      */
-    private static boolean compareSecure(String a, String b) {
+    private static boolean compareSecure(@Nullable String a, @Nullable String b) {
         if ((a == null) || (b == null)) {
             return (a == null) && (b == null);
         }
@@ -213,8 +214,6 @@ public final class PasswordUtil {
         }
         return bits == 0;
     }
-    
-    //------------------------------------------------------------< private >---
 
     private static String generateHash(@Nonnull String pwd, @Nonnull String algorithm,
                                        @Nullable String salt, int iterations) throws NoSuchAlgorithmException,
UnsupportedEncodingException {



Mime
View raw message