directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r605409 - in /directory/apacheds/branches/bigbang/kerberos-shared/src: main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
Date Wed, 19 Dec 2007 03:54:16 GMT
Author: erodriguez
Date: Tue Dec 18 19:54:15 2007
New Revision: 605409

URL: http://svn.apache.org/viewvc?rev=605409&view=rev
Log:
o  Corrected algorithm for determining checksum equality.
o  Test case for the above.

Modified:
    directory/apacheds/branches/bigbang/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
    directory/apacheds/branches/bigbang/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java

Modified: directory/apacheds/branches/bigbang/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java?rev=605409&r1=605408&r2=605409&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
(original)
+++ directory/apacheds/branches/bigbang/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/value/Checksum.java
Tue Dec 18 19:54:15 2007
@@ -98,7 +98,7 @@
             return true;
         }
 
-        if ( ( o != null ) || !( o instanceof Checksum ) )
+        if ( ( o == null ) || !( o instanceof Checksum ) )
         {
             return false;
         }

Modified: directory/apacheds/branches/bigbang/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java?rev=605409&r1=605408&r2=605409&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
(original)
+++ directory/apacheds/branches/bigbang/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/messages/value/ChecksumTest.java
Tue Dec 18 19:54:15 2007
@@ -78,4 +78,20 @@
 
         assertTrue( Arrays.equals( expectedResult, encoded.array() ) );
     }
+
+
+    /**
+     * Tests that two Checksums are equal if both their type and value are equal.
+     */
+    public void testEquality()
+    {
+        byte[] checksumValue =
+            { ( byte ) 0x30, ( byte ) 0x1A, ( byte ) 0xA0, ( byte ) 0x11, ( byte ) 0x18,
( byte ) 0x0F, ( byte ) 0x32,
+                ( byte ) 0x30 };
+
+        Checksum expected = new Checksum( ChecksumType.RSA_MD5, checksumValue );
+        Checksum provided = new Checksum( ChecksumType.RSA_MD5, checksumValue );
+
+        assertTrue( "Checksum equality", expected.equals( provided ) );
+    }
 }



Mime
View raw message