directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r289153 - in /directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos: io/decoder/ io/encoder/ messages/components/ service/
Date Thu, 15 Sep 2005 05:32:03 GMT
Author: erodriguez
Date: Wed Sep 14 22:31:56 2005
New Revision: 289153

URL: http://svn.apache.org/viewcvs?rev=289153&view=rev
Log:
Updated kerberos-common cipher hashed adapter to support Change Password protocol, DIRCHANGEPW-1:
o  Updated Hashed Adapter to work with Kerberos' Private and Application Reply message components.
o  Added Encodable interface to message components.
o  Added Encoder and EncoderFactory interface to message components.
o  Added Decoder and DecoderFactory interface to message components.

http://issues.apache.org/jira/browse/DIRCHANGEPW-1

Modified:
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/decoder/EncKrbPrivPartDecoder.java
Wed Sep 14 22:31:56 2005
@@ -27,12 +27,18 @@
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.components.EncKrbPrivPart;
 import org.apache.kerberos.messages.components.EncKrbPrivPartModifier;
 
-public class EncKrbPrivPartDecoder
+public class EncKrbPrivPartDecoder implements Decoder, DecoderFactory
 {
-    public EncKrbPrivPart decode( byte[] encodedPrivatePart ) throws IOException
+    public Decoder getDecoder()
+    {
+        return new EncKrbPrivPartDecoder();
+    }
+
+    public Encodable decode( byte[] encodedPrivatePart ) throws IOException
     {
         ASN1InputStream ais = new ASN1InputStream( encodedPrivatePart );
 

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncApRepPartEncoder.java
Wed Sep 14 22:31:56 2005
@@ -24,24 +24,30 @@
 import org.apache.asn1.der.DERInteger;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.components.EncApRepPart;
 
-public class EncApRepPartEncoder
+public class EncApRepPartEncoder implements Encoder, EncoderFactory
 {
 	public static final int APPLICATION_CODE = 27;
-	
-	public byte[] encode( EncApRepPart apRepPart ) throws IOException
+
+    public Encoder getEncoder()
+    {
+        return new EncApRepPartEncoder();
+    }
+
+	public byte[] encode( Encodable apRepPart ) throws IOException
 	{
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		ASN1OutputStream aos = new ASN1OutputStream( baos );
 		
-		DERSequence privPartSequence = encodeApRepPartSequence( apRepPart );
+		DERSequence privPartSequence = encodeApRepPartSequence( (EncApRepPart) apRepPart );
 		aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, privPartSequence ) );
 		aos.close();
 		
 		return baos.toByteArray();
 	}
-	
+
 	private DERSequence encodeApRepPartSequence( EncApRepPart message )
 	{
 		DERSequence sequence = new DERSequence();

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/io/encoder/EncKrbPrivPartEncoder.java
Wed Sep 14 22:31:56 2005
@@ -25,24 +25,30 @@
 import org.apache.asn1.der.DEROctetString;
 import org.apache.asn1.der.DERSequence;
 import org.apache.asn1.der.DERTaggedObject;
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.components.EncKrbPrivPart;
 
-public class EncKrbPrivPartEncoder
+public class EncKrbPrivPartEncoder implements Encoder, EncoderFactory
 {
 	private static final int APPLICATION_CODE = 28;
-	
-	public byte[] encode(EncKrbPrivPart privPart) throws IOException
+
+    public Encoder getEncoder()
+    {
+        return new EncKrbPrivPartEncoder();
+    }
+
+	public byte[] encode( Encodable privPart ) throws IOException
 	{
 		ByteArrayOutputStream baos = new ByteArrayOutputStream();
 		ASN1OutputStream aos = new ASN1OutputStream( baos );
 		
-		DERSequence privPartSequence = encodePrivatePartSequence( privPart );
+		DERSequence privPartSequence = encodePrivatePartSequence( (EncKrbPrivPart) privPart );
 		aos.writeObject( DERApplicationSpecific.valueOf( APPLICATION_CODE, privPartSequence ) );
 		aos.close();
 		
 		return baos.toByteArray();
 	}
-	
+
 	private DERSequence encodePrivatePartSequence( EncKrbPrivPart message )
 	{
 		DERSequence sequence = new DERSequence();

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncApRepPart.java
Wed Sep 14 22:31:56 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.messages.components;
 
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.KerberosMessage;
 import org.apache.kerberos.messages.MessageType;
 import org.apache.kerberos.messages.value.EncryptionKey;
@@ -24,7 +25,7 @@
 /**
  * Encrypted part of the application response
  */
-public class EncApRepPart extends KerberosMessage
+public class EncApRepPart extends KerberosMessage implements Encodable
 {
     private KerberosTime  clientTime;
     private int           cusec;

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/messages/components/EncKrbPrivPart.java
Wed Sep 14 22:31:56 2005
@@ -16,6 +16,7 @@
  */
 package org.apache.kerberos.messages.components;
 
+import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.KerberosMessage;
 import org.apache.kerberos.messages.MessageType;
 import org.apache.kerberos.messages.value.HostAddress;
@@ -24,7 +25,7 @@
 /**
  * Encrypted part of private messages
  */
-public class EncKrbPrivPart extends KerberosMessage
+public class EncKrbPrivPart extends KerberosMessage implements Encodable
 {
 	private byte[]       userData;
 	private KerberosTime timestamp;        //optional

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java?rev=289153&r1=289152&r2=289153&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/LockBox.java
Wed Sep 14 22:31:56 2005
@@ -35,9 +35,12 @@
 import org.apache.kerberos.io.decoder.AuthorizationDataDecoder;
 import org.apache.kerberos.io.decoder.Decoder;
 import org.apache.kerberos.io.decoder.DecoderFactory;
+import org.apache.kerberos.io.decoder.EncKrbPrivPartDecoder;
 import org.apache.kerberos.io.decoder.EncTicketPartDecoder;
 import org.apache.kerberos.io.decoder.EncryptedTimestampDecoder;
+import org.apache.kerberos.io.encoder.EncApRepPartEncoder;
 import org.apache.kerberos.io.encoder.EncAsRepPartEncoder;
+import org.apache.kerberos.io.encoder.EncKrbPrivPartEncoder;
 import org.apache.kerberos.io.encoder.EncTgsRepPartEncoder;
 import org.apache.kerberos.io.encoder.EncTicketPartEncoder;
 import org.apache.kerberos.io.encoder.Encoder;
@@ -46,6 +49,8 @@
 import org.apache.kerberos.messages.Encodable;
 import org.apache.kerberos.messages.TicketGrantReply;
 import org.apache.kerberos.messages.components.Authenticator;
+import org.apache.kerberos.messages.components.EncApRepPart;
+import org.apache.kerberos.messages.components.EncKrbPrivPart;
 import org.apache.kerberos.messages.components.EncTicketPart;
 import org.apache.kerberos.messages.value.AuthorizationData;
 import org.apache.kerberos.messages.value.EncryptedData;
@@ -73,6 +78,8 @@
         map.put( EncTicketPart.class, EncTicketPartEncoder.class );
         map.put( AuthenticationReply.class, EncAsRepPartEncoder.class );
         map.put( TicketGrantReply.class, EncTgsRepPartEncoder.class );
+        map.put( EncKrbPrivPart.class, EncKrbPrivPartEncoder.class );
+        map.put( EncApRepPart.class, EncApRepPartEncoder.class );
 
         DEFAULT_ENCODERS = Collections.unmodifiableMap( map );
     }
@@ -85,6 +92,7 @@
         map.put( Authenticator.class, AuthenticatorDecoder.class );
         map.put( EncryptedTimeStamp.class, EncryptedTimestampDecoder.class );
         map.put( AuthorizationData.class, AuthorizationDataDecoder.class );
+        map.put( EncKrbPrivPart.class, EncKrbPrivPartDecoder.class );
 
         DEFAULT_DECODERS = Collections.unmodifiableMap( map );
     }



Mime
View raw message