directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kayyag...@apache.org
Subject svn commit: r1043463 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0: kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/ kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/sto...
Date Wed, 08 Dec 2010 15:49:31 GMT
Author: kayyagari
Date: Wed Dec  8 15:49:30 2010
New Revision: 1043463

URL: http://svn.apache.org/viewvc?rev=1043463&view=rev
Log:
o renamed KeyUsage constants

Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyUsage.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationEncryptionTypeTest.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyUsage.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyUsage.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyUsage.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/crypto/encryption/KeyUsage.java
Wed Dec  8 15:49:30 2010
@@ -45,74 +45,74 @@ public final class KeyUsage implements C
     /**
      * AS-REQ PA-ENC-TIMESTAMP padata timestamp, encrypted with the client key (Section 5.2.7.2)
      */
-    public static final KeyUsage NUMBER1 = new KeyUsage( 1, I18n.err( I18n.ERR_603 ) );
+    public static final KeyUsage AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY = new KeyUsage( 1, I18n.err(
I18n.ERR_603 ) );
 
     /**
      * AS-REP Ticket and TGS-REP Ticket (includes TGS session key or application session
key), encrypted with the service key (Section 5.3)
      */
-    public static final KeyUsage NUMBER2 = new KeyUsage( 2, I18n.err( I18n.ERR_604 ) );
+    public static final KeyUsage AS_OR_TGS_REP_TICKET_WITH_SRVKEY = new KeyUsage( 2, I18n.err(
I18n.ERR_604 ) );
 
     /**
      * AS-REP encrypted part (includes TGS session key or application session key), encrypted
with the client key (Section 5.4.2)
      */
-    public static final KeyUsage NUMBER3 = new KeyUsage( 3, I18n.err( I18n.ERR_605 ) );
+    public static final KeyUsage AS_REP_ENC_PART_WITH_CKEY = new KeyUsage( 3, I18n.err( I18n.ERR_605
) );
 
     /**
      * TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the TGS session key (Section
5.4.1)
      */
-    public static final KeyUsage NUMBER4 = new KeyUsage( 4, I18n.err( I18n.ERR_606 ) );
+    public static final KeyUsage TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_TGS_SESS_KEY =
new KeyUsage( 4, I18n.err( I18n.ERR_606 ) );
 
     /**
      * TGS-REQ KDC-REQ-BODY AuthorizationData, encrypted with the TGS authenticator subkey
(Section 5.4.1)
      */
-    public static final KeyUsage NUMBER5 = new KeyUsage( 5, I18n.err( I18n.ERR_607 ) );
+    public static final KeyUsage TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_AUTHNT_SUB_KEY
= new KeyUsage( 5, I18n.err( I18n.ERR_607 ) );
 
     /**
      * TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator cksum, keyed with the TGS session key
(Section 5.5.1)
      */
-    public static final KeyUsage NUMBER6 = new KeyUsage( 6, I18n.err( I18n.ERR_608 ) );
+    public static final KeyUsage TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_AUTHNT_CKSUM_TGS_SESS_KEY
= new KeyUsage( 6, I18n.err( I18n.ERR_608 ) );
 
     /**
      * TGS-REQ PA-TGS-REQ padata AP-REQ Authenticator (includes TGS authenticator subkey),
encrypted with the TGS session key (Section 5.5.1)
      */
-    public static final KeyUsage NUMBER7 = new KeyUsage( 7, I18n.err( I18n.ERR_609 ) );
+    public static final KeyUsage TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY = new KeyUsage(
7, I18n.err( I18n.ERR_609 ) );
 
     /**
      * TGS-REP encrypted part (includes application session key), encrypted with the TGS
session key (Section 5.4.2)
      */
-    public static final KeyUsage NUMBER8 = new KeyUsage( 8, I18n.err( I18n.ERR_610 ) );
+    public static final KeyUsage TGS_REP_ENC_PART_TGS_SESS_KEY = new KeyUsage( 8, I18n.err(
I18n.ERR_610 ) );
 
     /**
      * TGS-REP encrypted part (includes application session key), encrypted with the TGS
authenticator subkey (Section 5.4.2)
      */
-    public static final KeyUsage NUMBER9 = new KeyUsage( 9, I18n.err( I18n.ERR_610 ) );
+    public static final KeyUsage TGS_REP_ENC_PART_TGS_AUTHNT_SUB_KEY = new KeyUsage( 9, I18n.err(
I18n.ERR_610 ) );
 
     /**
      * AP-REQ Authenticator cksum, keyed with the application session key (Section 5.5.1)
      */
-    public static final KeyUsage NUMBER10 = new KeyUsage( 10, I18n.err( I18n.ERR_612 ) );
+    public static final KeyUsage AP_REQ_AUTHNT_CKSUM_SESS_KEY = new KeyUsage( 10, I18n.err(
I18n.ERR_612 ) );
 
     /**
      * AP-REQ Authenticator (includes application authenticator subkey), encrypted with the
application session key (Section 5.5.1)
      */
-    public static final KeyUsage NUMBER11 = new KeyUsage( 11, I18n.err( I18n.ERR_613 ) );
+    public static final KeyUsage AP_REQ_AUTHNT_SESS_KEY = new KeyUsage( 11, I18n.err( I18n.ERR_613
) );
 
     /**
      * AP-REP encrypted part (includes application session subkey), encrypted with the application
session key (Section 5.5.2)
      */
-    public static final KeyUsage NUMBER12 = new KeyUsage( 12, I18n.err( I18n.ERR_614 ) );
+    public static final KeyUsage AP_REP_ENC_PART_SESS_KEY = new KeyUsage( 12, I18n.err( I18n.ERR_614
) );
 
     /**
      * KRB-PRIV encrypted part, encrypted with a key chosen by the application (Section 5.7.1)
      */
-    public static final KeyUsage NUMBER13 = new KeyUsage( 13, I18n.err( I18n.ERR_615 ) );
+    public static final KeyUsage KRB_PRIV_ENC_PART_CHOSEN_KEY = new KeyUsage( 13, I18n.err(
I18n.ERR_615 ) );
 
     /**
      * These two lines are all that's necessary to export a List of VALUES.
      */
     private static final KeyUsage[] values =
-        { NUMBER1, NUMBER2, NUMBER3, NUMBER4, NUMBER5, NUMBER6, NUMBER7, NUMBER8, NUMBER9,
NUMBER10, NUMBER11,
-            NUMBER12, NUMBER13 };
+        { AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY, AS_OR_TGS_REP_TICKET_WITH_SRVKEY, AS_REP_ENC_PART_WITH_CKEY,
TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_TGS_SESS_KEY, TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_AUTHNT_SUB_KEY,
TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_AUTHNT_CKSUM_TGS_SESS_KEY, TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY,
TGS_REP_ENC_PART_TGS_SESS_KEY, TGS_REP_ENC_PART_TGS_AUTHNT_SUB_KEY, AP_REQ_AUTHNT_CKSUM_SESS_KEY,
AP_REQ_AUTHNT_SESS_KEY,
+            AP_REP_ENC_PART_SESS_KEY, KRB_PRIV_ENC_PART_CHOSEN_KEY };
 
     /**
      * VALUES needs to be located here, otherwise illegal forward reference.
@@ -149,7 +149,7 @@ public final class KeyUsage implements C
             }
         }
 
-        return NUMBER1;
+        return AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY;
     }
 
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/server/kerberos/shared/store/TicketFactory.java
Wed Dec  8 15:49:30 2010
@@ -111,7 +111,7 @@ public class TicketFactory
         KerberosTime renewTill = new KerberosTime( now + ONE_WEEK );
         encTicketPart.setRenewTill( renewTill );
 
-        EncryptedData encryptedTicketPart = cipherTextHandler.seal( serverKey, encTicketPart,
KeyUsage.NUMBER2 );
+        EncryptedData encryptedTicketPart = cipherTextHandler.seal( serverKey, encTicketPart,
KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY );
 
         Ticket ticket = new Ticket();
         ticket.setTktVno( KerberosConstants.KERBEROS_V5 );

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/test/java/org/apache/directory/server/kerberos/shared/crypto/encryption/CipherTextHandlerTest.java
Wed Dec  8 15:49:30 2010
@@ -146,7 +146,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.NUMBER1 );
+            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070322233107Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 291067, object.getPausec() );
@@ -173,7 +173,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            lockBox.decrypt( key, data, KeyUsage.NUMBER1 );
+            lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
             fail( "Should have thrown exception." );
         }
         catch ( KerberosException ke )
@@ -200,7 +200,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.NUMBER1 );
+            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object =  KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getPausec() );
@@ -236,7 +236,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.NUMBER1 );
+            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
         }
         catch ( KerberosException ke )
         {
@@ -245,7 +245,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.NUMBER1
);
+            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", zuluTime, object.getPaTimestamp().toString() );
             assertEquals( "MicroSeconds", microSeconds, object.getPausec() );
@@ -278,7 +278,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.NUMBER1 );
+            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410212557Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 379386, object.getPausec() );
@@ -318,7 +318,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.NUMBER1 );
+            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
         }
         catch ( KerberosException ke )
         {
@@ -327,7 +327,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.NUMBER1
);
+            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getPausec() );
@@ -371,7 +371,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.NUMBER1 );
+            byte[] paEncTsEncData = lockBox.decrypt( key, data, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410212809Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 298294, object.getPausec() );
@@ -423,7 +423,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.NUMBER1 );
+            encryptedData = lockBox.seal( key, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
         }
         catch ( KerberosException ke )
         {
@@ -432,7 +432,7 @@ public class CipherTextHandlerTest
 
         try
         {
-            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.NUMBER1
);
+            byte[] paEncTsEncData = lockBox.decrypt( key, encryptedData, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
             PaEncTsEnc object = KerberosDecoder.decodePaEncTsEnc( paEncTsEncData );
             assertEquals( "TimeStamp", "20070410190400Z", object.getPaTimestamp().toString()
);
             assertEquals( "MicroSeconds", 460450, object.getPausec() );

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/ChangePasswordService.java
Wed Dec  8 15:49:30 2010
@@ -213,7 +213,7 @@ public class ChangePasswordService
         CipherTextHandler cipherTextHandler = changepwContext.getCipherTextHandler();
 
         Authenticator authenticator = KerberosUtils.verifyAuthHeader( authHeader, ticket,
serverKey, clockSkew, replayCache,
-            emptyAddressesAllowed, clientAddress, cipherTextHandler, KeyUsage.NUMBER11, false
);
+            emptyAddressesAllowed, clientAddress, cipherTextHandler, KeyUsage.AP_REQ_AUTHNT_SESS_KEY,
false );
 
         ChangePasswordRequest request = ( ChangePasswordRequest ) changepwContext.getRequest();
 
@@ -248,7 +248,7 @@ public class ChangePasswordService
         try
         {
             privatePart = ( EncKrbPrivPart ) cipherTextHandler.unseal( EncKrbPrivPart.class,
subSessionKey,
-                encReqPrivPart, KeyUsage.NUMBER13 );
+                encReqPrivPart, KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );
         }
         catch ( KerberosException ke )
         {
@@ -367,7 +367,7 @@ public class ChangePasswordService
 
         try
         {
-            encPrivPart = cipherTextHandler.seal( subSessionKey, privPart, KeyUsage.NUMBER13
);
+            encPrivPart = cipherTextHandler.seal( subSessionKey, privPart, KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY
);
         }
         catch ( KerberosException ke )
         {
@@ -387,7 +387,7 @@ public class ChangePasswordService
 
         try
         {
-            encRepPart = cipherTextHandler.seal( ticket.getEncTicketPart().getSessionKey(),
repPart, KeyUsage.NUMBER12 );
+            encRepPart = cipherTextHandler.seal( ticket.getEncTicketPart().getSessionKey(),
repPart, KeyUsage.AP_REP_ENC_PART_SESS_KEY );
         }
         catch ( KerberosException ke )
         {

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
Wed Dec  8 15:49:30 2010
@@ -171,7 +171,7 @@ public class ChangepwProtocolHandlerTest
         authenticator.setSubKey( subSessionKey );
 
         EncryptedData encryptedAuthenticator = cipherTextHandler.seal( serviceTicket.getEncTicketPart().getKey(),
authenticator
-                , KeyUsage.NUMBER11 );
+                , KeyUsage.AP_REQ_AUTHNT_SESS_KEY );
 
         ApReq apReq = new ApReq();
         apReq.setOption( apOptions );
@@ -250,7 +250,7 @@ public class ChangepwProtocolHandlerTest
         authenticator.setCusec( 0 );
 
         EncryptedData encryptedAuthenticator = cipherTextHandler.seal( serverKey, authenticator,
-                KeyUsage.NUMBER11 );
+                KeyUsage.AP_REQ_AUTHNT_SESS_KEY );
 
         ApReq apReq = new ApReq();
         apReq.setOption( apOptions );
@@ -283,7 +283,7 @@ public class ChangepwProtocolHandlerTest
         encReqPrivPart.setSenderAddress( new HostAddress( InetAddress.getLocalHost() ) );
 
         // Seal private message part.
-        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart,
KeyUsage.NUMBER13 );
+        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart,
KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );
 
         // Make private message with private message part.
         PrivateMessage privateMessage = new PrivateMessage();
@@ -319,7 +319,7 @@ public class ChangepwProtocolHandlerTest
         encReqPrivPart.setSenderAddress( new HostAddress( InetAddress.getLocalHost() ) );
 
         // Seal private message part.
-        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart,
KeyUsage.NUMBER13 );
+        EncryptedData encryptedPrivPart = cipherTextHandler.seal( subSessionKey, encReqPrivPart,
KeyUsage.KRB_PRIV_ENC_PART_CHOSEN_KEY );
 
         // Make private message with private message part.
         PrivateMessage privateMessage = new PrivateMessage();

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/authentication/AuthenticationService.java
Wed Dec  8 15:49:30 2010
@@ -269,7 +269,7 @@ public class AuthenticationService
                     if ( paData.getPaDataType().equals( PaDataType.PA_ENC_TIMESTAMP ) )
                     {
                         EncryptedData dataValue = KerberosDecoder.decodeEncryptedData( paData.getPaDataValue()
);
-                        byte[] decryptedData = cipherTextHandler.decrypt( clientKey, dataValue,
KeyUsage.NUMBER1 );
+                        byte[] decryptedData = cipherTextHandler.decrypt( clientKey, dataValue,
KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY );
                         timestamp = KerberosDecoder.decodePaEncTsEnc( decryptedData );
                     }
                 }
@@ -531,7 +531,7 @@ public class AuthenticationService
             }
         }
 
-        EncryptedData encryptedData = cipherTextHandler.seal( serverKey, encTicketPart, KeyUsage.NUMBER2
);
+        EncryptedData encryptedData = cipherTextHandler.seal( serverKey, encTicketPart, KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY
);
 
         Ticket newTicket = new Ticket( ticketPrincipal, encryptedData );
 
@@ -592,7 +592,7 @@ public class AuthenticationService
         }
         
         EncryptionKey clientKey = authContext.getClientKey();
-        EncryptedData encryptedData = cipherTextHandler.seal( clientKey, encAsRepPart, KeyUsage.NUMBER3
);
+        EncryptedData encryptedData = cipherTextHandler.seal( clientKey, encAsRepPart, KeyUsage.AS_REP_ENC_PART_WITH_CKEY
);
         reply.setEncPart( encryptedData );
         reply.setEncKdcRepPart( encKdcRepPart );
         
@@ -734,6 +734,7 @@ public class AuthenticationService
         }
         catch ( Exception e )
         {
+            e.printStackTrace();
             throw new KerberosException( errorType, e );
         }
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/TicketGrantingService.java
Wed Dec  8 15:49:30 2010
@@ -265,7 +265,7 @@ public class TicketGrantingService
         CipherTextHandler cipherTextHandler = tgsContext.getCipherTextHandler();
 
         Authenticator authenticator = verifyAuthHeader( authHeader, tgt, serverKey, clockSkew,
replayCache,
-            emptyAddressesAllowed, clientAddress, cipherTextHandler, KeyUsage.NUMBER7, isValidate
);
+            emptyAddressesAllowed, clientAddress, cipherTextHandler, KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY,
isValidate );
 
         tgsContext.setAuthenticator( authenticator );
     }
@@ -303,7 +303,7 @@ public class TicketGrantingService
 
             LOG.debug( "Verifying body checksum type '{}'.", authenticatorChecksum.getChecksumType()
);
 
-            checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, null, KeyUsage.NUMBER8
);
+            checksumHandler.verifyChecksum( authenticatorChecksum, bodyBytes, null, KeyUsage.TGS_REP_ENC_PART_TGS_SESS_KEY
);
         }
     }
     
@@ -347,7 +347,7 @@ public class TicketGrantingService
 
         if ( request.getKdcReqBody().getEncAuthorizationData() != null )
         {
-            byte[] authorizationData = cipherTextHandler.decrypt( authenticator.getSubKey(),
request.getKdcReqBody().getEncAuthorizationData(), KeyUsage.NUMBER4 );
+            byte[] authorizationData = cipherTextHandler.decrypt( authenticator.getSubKey(),
request.getKdcReqBody().getEncAuthorizationData(), KeyUsage.TGS_REQ_KDC_REQ_BODY_AUTHZ_DATA_ENC_WITH_TGS_SESS_KEY
);
             AuthorizationData authData = KerberosDecoder.decodeAuthorizationData( authorizationData
); 
             authData.addEntry( tgt.getEncTicketPart().getAuthorizationData().getCurrentAD()
);
             newTicketPart.setAuthorizationData( authData );
@@ -375,7 +375,7 @@ public class TicketGrantingService
         }
         else
         {
-            EncryptedData encryptedData = cipherTextHandler.seal( serverKey, newTicketPart,
KeyUsage.NUMBER2 );
+            EncryptedData encryptedData = cipherTextHandler.seal( serverKey, newTicketPart,
KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY );
 
             Ticket newTicket = new Ticket( request.getKdcReqBody().getSName(), encryptedData
);
             newTicket.setEncTicketPart( newTicketPart );
@@ -432,11 +432,11 @@ public class TicketGrantingService
         
         if ( authenticator.getSubKey() != null )
         {
-            encryptedData = cipherTextHandler.seal( authenticator.getSubKey(), encTgsRepPart,
KeyUsage.NUMBER9 );
+            encryptedData = cipherTextHandler.seal( authenticator.getSubKey(), encTgsRepPart,
KeyUsage.TGS_REP_ENC_PART_TGS_AUTHNT_SUB_KEY );
         }
         else
         {
-            encryptedData = cipherTextHandler.seal( tgt.getEncTicketPart().getKey(), encTgsRepPart,
KeyUsage.NUMBER8 );
+            encryptedData = cipherTextHandler.seal( tgt.getEncTicketPart().getKey(), encTgsRepPart,
KeyUsage.TGS_REP_ENC_PART_TGS_SESS_KEY );
         }
         
         reply.setEncPart( encryptedData );
@@ -1033,7 +1033,7 @@ public class TicketGrantingService
             throw new KerberosException( ErrorType.KRB_AP_ERR_NOKEY );
         }
         
-        byte[] encTicketPartData = lockBox.decrypt( ticketKey, ticket.getEncPart(), KeyUsage.NUMBER2
);
+        byte[] encTicketPartData = lockBox.decrypt( ticketKey, ticket.getEncPart(), KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY
);
         EncTicketPart encPart = KerberosDecoder.decodeEncTicketPart( encTicketPartData );

         ticket.setEncTicketPart( encPart );
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractAuthenticationServiceTest.java
Wed Dec  8 15:49:30 2010
@@ -77,7 +77,7 @@ public abstract class AbstractAuthentica
 
         EncryptionKey clientKey = getEncryptionKey( clientPrincipal, passPhrase );
 
-        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.NUMBER1
);
+        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
 
         ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
         byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AbstractTicketGrantingServiceTest.java
Wed Dec  8 15:49:30 2010
@@ -138,7 +138,7 @@ public abstract class AbstractTicketGran
         KerberosTime renewTill = new KerberosTime( now + KerberosTime.WEEK );
         encTicketPart.setRenewTill( renewTill );
 
-        EncryptedData encryptedTicketPart = lockBox.seal( serverKey, encTicketPart, KeyUsage.NUMBER2
);
+        EncryptedData encryptedTicketPart = lockBox.seal( serverKey, encTicketPart, KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY
);
 
         Ticket ticket = new Ticket();
         ticket.setSName( new PrincipalName( serverPrincipal.getName(), serverPrincipal.getNameType()
) );
@@ -181,7 +181,7 @@ public abstract class AbstractTicketGran
     protected Ticket getTicket( EncTicketPart encTicketPart, KerberosPrincipal serverPrincipal,
         EncryptionKey serverKey ) throws KerberosException, ParseException
     {
-        EncryptedData encryptedTicketPart = lockBox.seal( serverKey, encTicketPart, KeyUsage.NUMBER2
);
+        EncryptedData encryptedTicketPart = lockBox.seal( serverKey, encTicketPart, KeyUsage.AS_OR_TGS_REP_TICKET_WITH_SRVKEY
);
 
         Ticket ticket = new Ticket();
         ticket.setTktVno( 5 );
@@ -258,7 +258,7 @@ public abstract class AbstractTicketGran
         Checksum checksum = getBodyChecksum( requestBody, checksumType );
         authenticator.setCksum( checksum );
 
-        EncryptedData encryptedAuthenticator = lockBox.seal( sessionKey, authenticator, KeyUsage.NUMBER7
);
+        EncryptedData encryptedAuthenticator = lockBox.seal( sessionKey, authenticator, KeyUsage.TGS_REQ_PA_TGS_REQ_PADATA_AP_REQ_TGS_SESS_KEY
);
 
         return encryptedAuthenticator;
     }
@@ -272,7 +272,7 @@ public abstract class AbstractTicketGran
 
         ChecksumHandler checksumHandler = new ChecksumHandler();
         
-        return checksumHandler.calculateChecksum( checksumType, bodyBytes, null, KeyUsage.NUMBER8
);
+        return checksumHandler.calculateChecksum( checksumType, bodyBytes, null, KeyUsage.TGS_REP_ENC_PART_TGS_SESS_KEY
);
     }
 
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationEncryptionTypeTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationEncryptionTypeTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationEncryptionTypeTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/AuthenticationEncryptionTypeTest.java
Wed Dec  8 15:49:30 2010
@@ -313,7 +313,7 @@ public class AuthenticationEncryptionTyp
 
         PaEncTsEnc encryptedTimeStamp = new PaEncTsEnc( timeStamp, 0 );
 
-        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.NUMBER1
);
+        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
 
         ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
         byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java?rev=1043463&r1=1043462&r2=1043463&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/test/java/org/apache/directory/server/kerberos/protocol/PreAuthenticationTest.java
Wed Dec  8 15:49:30 2010
@@ -297,7 +297,7 @@ public class PreAuthenticationTest exten
 
         EncryptionKey clientKey = getEncryptionKey( clientPrincipal, passPhrase );
 
-        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.NUMBER1
);
+        EncryptedData encryptedData = lockBox.seal( clientKey, encryptedTimeStamp, KeyUsage.AS_REQ_PA_ENC_TIMESTAMP_WITH_CKEY
);
 
         ByteBuffer buffer = ByteBuffer.allocate( encryptedData.computeLength() );
         byte[] encodedEncryptedData = encryptedData.encode( buffer ).array();



Mime
View raw message