directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r541563 - in /directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption: KerberosKeyFactoryTest.java KeyTypeTest.java
Date Fri, 25 May 2007 06:22:03 GMT
Author: erodriguez
Date: Thu May 24 23:22:01 2007
New Revision: 541563

URL: http://svn.apache.org/viewvc?view=rev&rev=541563
Log:
o  Added check based on installed JRE and policy to selectively skip kerberos-shared encryption
type-related test.
o  Fixed warning.

Modified:
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
    directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java?view=diff&rev=541563&r1=541562&r2=541563
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KerberosKeyFactoryTest.java
Thu May 24 23:22:01 2007
@@ -279,23 +279,27 @@
         Map<EncryptionType, EncryptionKey> map = KerberosKeyFactory.getKerberosKeys(
principalName, passPhrase,
             encryptionTypes );
 
-        assertEquals( "List length", 1, map.values().size() );
-
         EncryptionKey kerberosKey = map.get( EncryptionType.AES256_CTS_HMAC_SHA1_96 );
 
-        EncryptionType keyType = kerberosKey.getKeyType();
-        int keyLength = kerberosKey.getKeyValue().length;
-        byte[] keyBytes = kerberosKey.getKeyValue();
+        if ( kerberosKey != null )
+        {
+            assertEquals( "List length", 1, map.values().size() );
+
+            EncryptionType keyType = kerberosKey.getKeyType();
+            int keyLength = kerberosKey.getKeyValue().length;
+            byte[] keyBytes = kerberosKey.getKeyValue();
 
-        assertEquals( keyType, EncryptionType.AES256_CTS_HMAC_SHA1_96 );
-        assertEquals( keyLength, 32 );
-        byte[] expectedBytes = new byte[]
-            { ( byte ) 0x3D, ( byte ) 0x33, ( byte ) 0x31, ( byte ) 0x8F, ( byte ) 0xBE,
( byte ) 0x47, ( byte ) 0xE5,
-                ( byte ) 0x2A, ( byte ) 0x21, ( byte ) 0x50, ( byte ) 0x77, ( byte ) 0xA4,
( byte ) 0x15,
-                ( byte ) 0x58, ( byte ) 0xCA, ( byte ) 0xE7, ( byte ) 0x36, ( byte ) 0x50,
( byte ) 0x1F,
-                ( byte ) 0xA7, ( byte ) 0xA4, ( byte ) 0x85, ( byte ) 0x82, ( byte ) 0x05,
( byte ) 0xF6,
-                ( byte ) 0x8F, ( byte ) 0x67, ( byte ) 0xA2, ( byte ) 0xB5, ( byte ) 0xEA,
( byte ) 0x0E, ( byte ) 0xBF };
-        assertTrue( Arrays.equals( expectedBytes, keyBytes ) );
+            assertEquals( keyType, EncryptionType.AES256_CTS_HMAC_SHA1_96 );
+            assertEquals( keyLength, 32 );
+            byte[] expectedBytes = new byte[]
+                { ( byte ) 0x3D, ( byte ) 0x33, ( byte ) 0x31, ( byte ) 0x8F, ( byte ) 0xBE,
( byte ) 0x47,
+                    ( byte ) 0xE5, ( byte ) 0x2A, ( byte ) 0x21, ( byte ) 0x50, ( byte )
0x77, ( byte ) 0xA4,
+                    ( byte ) 0x15, ( byte ) 0x58, ( byte ) 0xCA, ( byte ) 0xE7, ( byte )
0x36, ( byte ) 0x50,
+                    ( byte ) 0x1F, ( byte ) 0xA7, ( byte ) 0xA4, ( byte ) 0x85, ( byte )
0x82, ( byte ) 0x05,
+                    ( byte ) 0xF6, ( byte ) 0x8F, ( byte ) 0x67, ( byte ) 0xA2, ( byte )
0xB5, ( byte ) 0xEA,
+                    ( byte ) 0x0E, ( byte ) 0xBF };
+            assertTrue( Arrays.equals( expectedBytes, keyBytes ) );
+        }
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java?view=diff&rev=541563&r1=541562&r2=541563
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyTypeTest.java
Thu May 24 23:22:01 2007
@@ -296,6 +296,6 @@
             }
         }
 
-        return ( String[] ) result.toArray( new String[result.size()] );
+        return result.toArray( new String[result.size()] );
     }
 }



Mime
View raw message