directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r535675 - /directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
Date Sun, 06 May 2007 23:17:35 GMT
Author: erodriguez
Date: Sun May  6 16:17:34 2007
New Revision: 535675

URL: http://svn.apache.org/viewvc?view=rev&rev=535675
Log:
Updated CipherTextHandlerTest to test with "key usage."

Modified:
    directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java

Modified: directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java?view=diff&rev=535675&r1=535674&r2=535675
==============================================================================
--- directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
(original)
+++ directory/apacheds/branches/kerberos-encryption-types/kerberos-shared/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
Sun May  6 16:17:34 2007
@@ -128,7 +128,7 @@
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data, KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070322233107Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 291067, object.getMicroSeconds() );
         }
@@ -154,7 +154,7 @@
 
         try
         {
-            lockBox.unseal( hint, key, data );
+            lockBox.unseal( hint, key, data, KeyUsage.NUMBER1 );
             fail( "Should have thrown exception." );
         }
         catch ( KerberosException ke )
@@ -180,7 +180,7 @@
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data, KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410190400Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getMicroSeconds() );
         }
@@ -205,13 +205,14 @@
         EncryptionKey key = new EncryptionKey( EncryptionType.DES3_CBC_SHA1_KD, kerberosKey.getEncoded()
);
 
         Des3CbcSha1KdEncryption enc = new Des3CbcSha1KdEncryption();
-        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp );
+        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp, KeyUsage.NUMBER1
);
 
         Class hint = EncryptedTimeStamp.class;
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData,
+                KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410190400Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getMicroSeconds() );
         }
@@ -239,7 +240,7 @@
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data, KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410212557Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 379386, object.getMicroSeconds() );
         }
@@ -264,13 +265,14 @@
         EncryptionKey key = new EncryptionKey( EncryptionType.AES128_CTS_HMAC_SHA1_96, kerberosKey.getEncoded()
);
 
         Aes128CtsSha1Encryption enc = new Aes128CtsSha1Encryption();
-        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp );
+        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp, KeyUsage.NUMBER1
);
 
         Class hint = EncryptedTimeStamp.class;
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData,
+                KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410190400Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getMicroSeconds() );
         }
@@ -298,7 +300,7 @@
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
data, KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410212809Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 298294, object.getMicroSeconds() );
         }
@@ -323,13 +325,14 @@
         EncryptionKey key = new EncryptionKey( EncryptionType.AES256_CTS_HMAC_SHA1_96, kerberosKey.getEncoded()
);
 
         Aes256CtsSha1Encryption enc = new Aes256CtsSha1Encryption();
-        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp );
+        EncryptedData encryptedData = enc.getEncryptedData( key, asn1EncodedTimeStamp, KeyUsage.NUMBER1
);
 
         Class hint = EncryptedTimeStamp.class;
 
         try
         {
-            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData );
+            EncryptedTimeStamp object = ( EncryptedTimeStamp ) lockBox.unseal( hint, key,
encryptedData,
+                KeyUsage.NUMBER1 );
             assertEquals( "TimeStamp", "20070410190400Z", object.getTimeStamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getMicroSeconds() );
         }



Mime
View raw message