directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r547131 - in /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared: io/encoder/ messages/components/
Date Thu, 14 Jun 2007 05:41:07 GMT
Author: erodriguez
Date: Wed Jun 13 22:41:06 2007
New Revision: 547131

URL: http://svn.apache.org/viewvc?view=rev&rev=547131
Log:
Improvements to kerberos-shared, driven by client-side:
o  Added capability to use KerberosPrincipal's when creating new Authenticators and Tickets.
o  Some Javadocs.

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java?view=diff&rev=547131&r1=547130&r2=547131
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/io/encoder/EncKrbPrivPartEncoder.java
Wed Jun 13 22:41:06 2007
@@ -61,6 +61,21 @@
     }
 
 
+    /**
+     * Encodes an {@link EncKrbPrivPart} into a {@link DERSequence}.
+     * 
+     * EncKrbPrivPart  ::= [APPLICATION 28] SEQUENCE {
+     *         user-data       [0] OCTET STRING,
+     *         timestamp       [1] KerberosTime OPTIONAL,
+     *         usec            [2] Microseconds OPTIONAL,
+     *         seq-number      [3] UInt32 OPTIONAL,
+     *         s-address       [4] HostAddress -- sender's addr --,
+     *         r-address       [5] HostAddress OPTIONAL -- recip's addr
+     * }
+     *
+     * @param message
+     * @return The {@link DERSequence};
+     */
     private DERSequence encodePrivatePartSequence( EncKrbPrivPart message )
     {
         DERSequence sequence = new DERSequence();

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java?view=diff&rev=547131&r1=547130&r2=547131
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/AuthenticatorModifier.java
Wed Jun 13 22:41:06 2007
@@ -38,6 +38,7 @@
 {
     private int versionNumber;
     private KerberosPrincipalModifier clientModifier = new KerberosPrincipalModifier();
+    private KerberosPrincipal clientPrincipal;
     private Checksum checksum;
     private int clientMicroSecond;
     private KerberosTime clientTime;
@@ -53,7 +54,10 @@
      */
     public Authenticator getAuthenticator()
     {
-        KerberosPrincipal clientPrincipal = clientModifier.getKerberosPrincipal();
+        if ( clientPrincipal == null )
+        {
+            clientPrincipal = clientModifier.getKerberosPrincipal();
+        }
 
         return new Authenticator( versionNumber, clientPrincipal, checksum, clientMicroSecond,
clientTime,
             subSessionKey, sequenceNumber, authorizationData );
@@ -90,6 +94,17 @@
     public void setClientRealm( String realm )
     {
         clientModifier.setRealm( realm );
+    }
+
+
+    /**
+     * Sets the client {@link KerberosPrincipal}.
+     *
+     * @param clientPrincipal
+     */
+    public void setClientPrincipal( KerberosPrincipal clientPrincipal )
+    {
+        this.clientPrincipal = clientPrincipal;
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java?view=diff&rev=547131&r1=547130&r2=547131
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/EncTicketPartModifier.java
Wed Jun 13 22:41:06 2007
@@ -95,11 +95,11 @@
     /**
      * Sets the client {@link KerberosPrincipal}.
      *
-     * @param principal
+     * @param clientPrincipal
      */
-    public void setClientPrincipal( KerberosPrincipal principal )
+    public void setClientPrincipal( KerberosPrincipal clientPrincipal )
     {
-        clientPrincipal = principal;
+        this.clientPrincipal = clientPrincipal;
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java?view=diff&rev=547131&r1=547130&r2=547131
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/messages/components/TicketModifier.java
Wed Jun 13 22:41:06 2007
@@ -35,6 +35,7 @@
 {
     private int ticketVersionNumber;
     private KerberosPrincipalModifier serverModifier = new KerberosPrincipalModifier();
+    private KerberosPrincipal serverPrincipal;
     private EncryptedData encPart;
 
 
@@ -45,7 +46,11 @@
      */
     public Ticket getTicket()
     {
-        KerberosPrincipal serverPrincipal = serverModifier.getKerberosPrincipal();
+        if ( serverPrincipal == null )
+        {
+            serverPrincipal = serverModifier.getKerberosPrincipal();
+        }
+
         return new Ticket( ticketVersionNumber, serverPrincipal, encPart );
     }
 
@@ -91,5 +96,16 @@
     public void setServerRealm( String realm )
     {
         serverModifier.setRealm( realm );
+    }
+
+
+    /**
+     * Sets the server {@link KerberosPrincipal}.
+     *
+     * @param serverPrincipal
+     */
+    public void setServerPrincipal( KerberosPrincipal serverPrincipal )
+    {
+        this.serverPrincipal = serverPrincipal;
     }
 }



Mime
View raw message