directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1042561 - in /directory/apacheds/branches/apacheds-kerberos-codec-2.0: kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/ prot...
Date Mon, 06 Dec 2010 10:23:09 GMT
Author: elecharny
Date: Mon Dec  6 10:23:09 2010
New Revision: 1042561

URL: http://svn.apache.org/viewvc?rev=1042561&view=rev
Log:
Some more compilation fixes

Removed:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/Decoder.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/DecoderFactory.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/PreAuthenticationDataDecoder.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/PrivateMessageDecoder.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/decoder/package-info.java
Modified:
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
    directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.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/main/java/org/apache/directory/server/kerberos/protocol/KerberosDecoder.java

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java?rev=1042561&r1=1042560&r2=1042561&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/components/PaData.java
Mon Dec  6 10:23:09 2010
@@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory;
 
 
 /**
- * The Pre-Authentication data. Tha ASN.1 GRAMMAR IS :
+ * The Pre-Authentication data. The ASN.1 GRAMMAR IS :
  * <pre>
  * PA-DATA         ::= SEQUENCE {
  *         -- NOTE: first tag is [1], not [0]

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.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/io/ChangePasswordErrorDecoder.java?rev=1042561&r1=1042560&r2=1042561&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-changepw/src/main/java/org/apache/directory/server/changepw/io/ChangePasswordErrorDecoder.java
Mon Dec  6 10:23:09 2010
@@ -60,8 +60,7 @@ public class ChangePasswordErrorDecoder
         buf.get( errorBytes );
         ByteBuffer errorBuffer = ByteBuffer.wrap( errorBytes );
 
-        ErrorMessageDecoder errorDecoder = new ErrorMessageDecoder();
-        KrbError errorMessage = errorDecoder.decode( errorBuffer );
+        KrbError errorMessage = KerberosDecoder.decodeKrbError( errorBuffer );
 
         modifier.setErrorMessage( errorMessage );
 

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=1042561&r1=1042560&r2=1042561&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
Mon Dec  6 10:23:09 2010
@@ -1030,7 +1030,7 @@ public class TicketGrantingService
         EncTicketPart encPart = KerberosDecoder.decodeEncTicketPart( encTicketPartData );

         ticket.setEncTicketPart( encPart );
 
-        byte[] authenticatorData = lockBox.decrypt( ticket.getEncTicketPart().getKey(), 
authHeader.getEncPart(), authenticatorKeyUsage );
+        byte[] authenticatorData = lockBox.decrypt( ticket.getEncTicketPart().getKey(), 
authHeader.getAuthenticator(), authenticatorKeyUsage );
         
         Authenticator authenticator = KerberosDecoder.decodeAuthenticator( authenticatorData
); 
 

Modified: directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosDecoder.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/protocol/KerberosDecoder.java?rev=1042561&r1=1042560&r2=1042561&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosDecoder.java
(original)
+++ directory/apacheds/branches/apacheds-kerberos-codec-2.0/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/protocol/KerberosDecoder.java
Mon Dec  6 10:23:09 2010
@@ -41,6 +41,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.codec.encTicketPart.EncTicketPartContainer;
 import org.apache.directory.shared.kerberos.codec.encryptedData.EncryptedDataContainer;
 import org.apache.directory.shared.kerberos.codec.encryptionKey.EncryptionKeyContainer;
+import org.apache.directory.shared.kerberos.codec.krbPriv.KrbPrivContainer;
 import org.apache.directory.shared.kerberos.codec.paEncTsEnc.PaEncTsEncContainer;
 import org.apache.directory.shared.kerberos.codec.principalName.PrincipalNameContainer;
 import org.apache.directory.shared.kerberos.codec.ticket.TicketContainer;
@@ -57,6 +58,7 @@ import org.apache.directory.shared.kerbe
 import org.apache.directory.shared.kerberos.messages.ApReq;
 import org.apache.directory.shared.kerberos.messages.Authenticator;
 import org.apache.directory.shared.kerberos.messages.EncApRepPart;
+import org.apache.directory.shared.kerberos.messages.KrbPriv;
 import org.apache.directory.shared.kerberos.messages.Ticket;
 import org.apache.directory.shared.ldap.codec.LdapDecoder;
 import org.apache.mina.core.buffer.IoBuffer;
@@ -588,4 +590,39 @@ public class KerberosDecoder extends Pro
 
         return apReq;
     }
+
+    
+    /**
+     * Decode a KRB-PRIV structure
+     * 
+     * @param data The byte array containing the data structure to decode
+     * @return An instance of KrbPriv
+     * @throws KerberosException If the decoding fails
+     */
+    public static KrbPriv decodeKrbPriv( byte[] data ) throws KerberosException
+    {
+        ByteBuffer stream = ByteBuffer.allocate( data.length );
+        stream.put( data );
+        stream.flip();
+        
+        // Allocate a KrbPriv Container
+        Asn1Container krbPrivContainer = new KrbPrivContainer();
+
+        Asn1Decoder kerberosDecoder = new Asn1Decoder();
+
+        // Decode the KrbPriv PDU
+        try
+        {
+            kerberosDecoder.decode( stream, krbPrivContainer );
+        }
+        catch ( DecoderException de )
+        {
+            throw new KerberosException( ErrorType.KRB_AP_ERR_BAD_INTEGRITY, de );
+        }
+
+        // get the decoded KrbPriv
+        KrbPriv krbPriv = ( ( KrbPrivContainer ) krbPrivContainer ).getKrbPriv();
+
+        return krbPriv;
+    }
 }



Mime
View raw message