directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r583439 - in /directory/apacheds/trunk: core/src/main/java/org/apache/directory/server/core/authn/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/ kerberos-shared/src/main/java/org/apache/directory...
Date Wed, 10 Oct 2007 11:50:31 GMT
Author: elecharny
Date: Wed Oct 10 04:50:30 2007
New Revision: 583439

URL: http://svn.apache.org/viewvc?rev=583439&view=rev
Log:
Using "{crypt}".equalsIgnorecase() instead of "{crypt}".equals().
Using the LdapSecurityConstants.HASH_XXXXX constants instead of Strings in the code.

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/RsaMd5Checksum.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=583439&r1=583438&r2=583439&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java
Wed Oct 10 04:50:30 2007
@@ -538,17 +538,17 @@
         String algorithm = encryptionMethod.algorithm;
         byte[] salt = encryptionMethod.salt;
         
-        if ( LdapSecurityConstants.HASH_METHOD_SHA.equals( algorithm ) || 
-             LdapSecurityConstants.HASH_METHOD_SSHA.equals( algorithm ) )
+        if ( LdapSecurityConstants.HASH_METHOD_SHA.equalsIgnoreCase( algorithm ) || 
+             LdapSecurityConstants.HASH_METHOD_SSHA.equalsIgnoreCase( algorithm ) )
         {   
             return digest( LdapSecurityConstants.HASH_METHOD_SHA, credentials, salt );
         }
-        else if ( LdapSecurityConstants.HASH_METHOD_MD5.equals( algorithm ) ||
-                  LdapSecurityConstants.HASH_METHOD_SMD5.equals( algorithm ) )
+        else if ( LdapSecurityConstants.HASH_METHOD_MD5.equalsIgnoreCase( algorithm ) ||
+                  LdapSecurityConstants.HASH_METHOD_SMD5.equalsIgnoreCase( algorithm ) )
        {            
             return digest( LdapSecurityConstants.HASH_METHOD_MD5, credentials, salt );
         }
-        else if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equals( algorithm ) )
+        else if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
         {
             if ( salt == null )
             {
@@ -648,7 +648,7 @@
         {
             String algorithm = sPassword.substring( 1, rightParen );
 
-            if ( "crypt".equals( algorithm ) )
+            if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
             {
                 return algorithm;
             }
@@ -693,7 +693,7 @@
         // create message digest object
         try
         {
-            if ( "crypt".equalsIgnoreCase( algorithm ) )
+            if ( LdapSecurityConstants.HASH_METHOD_CRYPT.equalsIgnoreCase( algorithm ) )
             {
                 String saltWithCrypted = UnixCrypt.crypt( StringTools.utf8ToString( password
), "" );
                 String crypted = saltWithCrypted.substring( 2 );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/RsaMd5Checksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/RsaMd5Checksum.java?rev=583439&r1=583438&r2=583439&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/RsaMd5Checksum.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/checksum/RsaMd5Checksum.java
Wed Oct 10 04:50:30 2007
@@ -24,6 +24,7 @@
 import java.security.NoSuchAlgorithmException;
 
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KeyUsage;
+import org.apache.directory.shared.ldap.constants.LdapSecurityConstants;
 
 
 /**
@@ -42,7 +43,7 @@
     {
         try
         {
-            MessageDigest digester = MessageDigest.getInstance( "MD5" );
+            MessageDigest digester = MessageDigest.getInstance( LdapSecurityConstants.HASH_METHOD_MD5
);
             return digester.digest( data );
         }
         catch ( NoSuchAlgorithmException nsae )

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java?rev=583439&r1=583438&r2=583439&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/DesCbcMd5Encryption.java
Wed Oct 10 04:50:30 2007
@@ -35,6 +35,7 @@
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptedData;
 import org.apache.directory.server.kerberos.shared.messages.value.EncryptionKey;
+import org.apache.directory.shared.ldap.constants.LdapSecurityConstants;
 
 
 /**
@@ -70,7 +71,7 @@
     {
         try
         {
-            MessageDigest digester = MessageDigest.getInstance( "MD5" );
+            MessageDigest digester = MessageDigest.getInstance( LdapSecurityConstants.HASH_METHOD_MD5
);
             return digester.digest( data );
         }
         catch ( NoSuchAlgorithmException nsae )



Mime
View raw message