directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r589781 - in /directory/apacheds/branches/bigbang/protocol-changepw/src: main/java/org/apache/directory/server/changepw/service/ test/java/org/apache/directory/server/changepw/protocol/
Date Mon, 29 Oct 2007 18:16:38 GMT
Author: elecharny
Date: Mon Oct 29 11:16:35 2007
New Revision: 589781

URL: http://svn.apache.org/viewvc?rev=589781&view=rev
Log:
Align this project with the modification made in Ticket

Modified:
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java
    directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java
    directory/apacheds/branches/bigbang/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/BuildReply.java
Mon Oct 29 11:16:35 2007
@@ -101,7 +101,7 @@
 
         try
         {
-            encRepPart = cipherTextHandler.seal( ticket.getSessionKey(), repPart, KeyUsage.NUMBER12
);
+            encRepPart = cipherTextHandler.seal( ticket.getEncTicketPart().getSessionKey(),
repPart, KeyUsage.NUMBER12 );
         }
         catch ( KerberosException ke )
         {

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetServerEntry.java
Mon Oct 29 11:16:35 2007
@@ -40,7 +40,7 @@
     {
         ChangePasswordContext changepwContext = ( ChangePasswordContext ) session.getAttribute(
getContextKey() );
 
-        KerberosPrincipal principal = changepwContext.getTicket().getServerPrincipal();
+        KerberosPrincipal principal =  changepwContext.getTicket().getServerPrincipal();
         PrincipalStore store = changepwContext.getStore();
 
         changepwContext.setServerEntry( getEntry( principal, store, ErrorType.KDC_ERR_S_PRINCIPAL_UNKNOWN
) );

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/MonitorContext.java
Mon Oct 29 11:16:35 2007
@@ -71,13 +71,13 @@
                 String desiredPassword = changepwContext.getPassword();
 
                 InetAddress clientAddress = changepwContext.getClientAddress();
-                HostAddresses clientAddresses = ticket.getClientAddresses();
+                HostAddresses clientAddresses = ticket.getEncTicketPart().getClientAddresses();
 
                 boolean caddrContainsSender = false;
 
-                if ( ticket.getClientAddresses() != null )
+                if ( ticket.getEncTicketPart().getClientAddresses() != null )
                 {
-                    caddrContainsSender = ticket.getClientAddresses().contains( new HostAddress(
clientAddress ) );
+                    caddrContainsSender = ticket.getEncTicketPart().getClientAddresses().contains(
new HostAddress( clientAddress ) );
                 }
 
                 StringBuffer sb = new StringBuffer();
@@ -92,11 +92,10 @@
                 sb.append( "\n\t" + "clientAddress          " + clientAddress );
                 sb.append( "\n\t" + "clientAddresses        " + clientAddresses );
                 sb.append( "\n\t" + "caddr contains sender  " + caddrContainsSender );
-
-                KerberosPrincipal ticketServerPrincipal = ticket.getServerPrincipal();
-                sb.append( "\n\t" + "Ticket principal       " + ticketServerPrincipal );
+                sb.append( "\n\t" + "Ticket principal       " + ticket.getServerPrincipal()
);
 
                 PrincipalStoreEntry ticketPrincipal = changepwContext.getServerEntry();
+                
                 sb.append( "\n\t" + "cn                     " + ticketPrincipal.getCommonName()
);
                 sb.append( "\n\t" + "realm                  " + ticketPrincipal.getRealmName()
);
                 sb.append( "\n\t" + "Service principal      " + ticketPrincipal.getPrincipal()
);

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicket.java
Mon Oct 29 11:16:35 2007
@@ -23,6 +23,7 @@
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.changepw.ChangePasswordServer;
+import org.apache.directory.server.kerberos.shared.KerberosUtils;
 import org.apache.directory.server.kerberos.shared.exceptions.ErrorType;
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.components.Ticket;
@@ -46,8 +47,9 @@
         Ticket ticket = changepwContext.getTicket();
         String primaryRealm = config.getPrimaryRealm();
         KerberosPrincipal changepwPrincipal = config.getServicePrincipal();
+        KerberosPrincipal serverPrincipal = ticket.getServerPrincipal(); 
 
-        if ( !ticket.getRealm().equals( primaryRealm ) || !ticket.getServerPrincipal().equals(
changepwPrincipal ) )
+        if ( !ticket.getRealm().equals( primaryRealm ) || !serverPrincipal.equals( changepwPrincipal
) )
         {
             throw new KerberosException( ErrorType.KRB_AP_ERR_NOT_US );
         }

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/VerifyServiceTicketAuthHeader.java
Mon Oct 29 11:16:35 2007
@@ -68,7 +68,7 @@
 
         ChangePasswordRequest request = ( ChangePasswordRequest ) changepwContext.getRequest();
 
-        if ( request.getVersionNumber() == 1 && !ticket.getFlag( TicketFlags.INITIAL
) )
+        if ( request.getVersionNumber() == 1 && !ticket.getEncTicketPart().getFlags().get(
TicketFlags.INITIAL ) )
         {
             throw new ChangePasswordException( ErrorType.KRB5_KPASSWD_INITIAL_FLAG_NEEDED
);
         }

Modified: directory/apacheds/branches/bigbang/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/bigbang/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java?rev=589781&r1=589780&r2=589781&view=diff
==============================================================================
--- directory/apacheds/branches/bigbang/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
(original)
+++ directory/apacheds/branches/bigbang/protocol-changepw/src/test/java/org/apache/directory/server/changepw/protocol/ChangepwProtocolHandlerTest.java
Mon Oct 29 11:16:35 2007
@@ -36,6 +36,7 @@
 import org.apache.directory.server.changepw.messages.ChangePasswordRequest;
 import org.apache.directory.server.changepw.value.ChangePasswordData;
 import org.apache.directory.server.changepw.value.ChangePasswordDataModifier;
+import org.apache.directory.server.kerberos.shared.KerberosMessageType;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.CipherTextHandler;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.EncryptionType;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KeyUsage;
@@ -43,7 +44,6 @@
 import org.apache.directory.server.kerberos.shared.exceptions.KerberosException;
 import org.apache.directory.server.kerberos.shared.messages.ApplicationRequest;
 import org.apache.directory.server.kerberos.shared.messages.ErrorMessage;
-import org.apache.directory.server.kerberos.shared.messages.MessageType;
 import org.apache.directory.server.kerberos.shared.messages.application.PrivateMessage;
 import org.apache.directory.server.kerberos.shared.messages.components.AuthenticatorModifier;
 import org.apache.directory.server.kerberos.shared.messages.components.EncKrbPrivPart;
@@ -164,7 +164,7 @@
 
         modifier.setSubSessionKey( subSessionKey );
 
-        EncryptedData encryptedAuthenticator = cipherTextHandler.seal( serviceTicket.getSessionKey(),
modifier
+        EncryptedData encryptedAuthenticator = cipherTextHandler.seal( serviceTicket.getEncTicketPart().getSessionKey(),
modifier
                 .getAuthenticator(), KeyUsage.NUMBER11 );
 
         ApplicationRequest apReq = new ApplicationRequest( apOptions, serviceTicket, encryptedAuthenticator
);
@@ -275,7 +275,7 @@
         // Make private message with private message part.
         PrivateMessage privateMessage = new PrivateMessage();
         privateMessage.setProtocolVersionNumber( 5 );
-        privateMessage.setMessageType( MessageType.ENC_PRIV_PART );
+        privateMessage.setMessageType( KerberosMessageType.ENC_PRIV_PART );
         privateMessage.setEncryptedPart( encryptedPrivPart );
 
         return privateMessage;
@@ -312,7 +312,7 @@
         // Make private message with private message part.
         PrivateMessage privateMessage = new PrivateMessage();
         privateMessage.setProtocolVersionNumber( 5 );
-        privateMessage.setMessageType( MessageType.ENC_PRIV_PART );
+        privateMessage.setMessageType( KerberosMessageType.ENC_PRIV_PART );
         privateMessage.setEncryptedPart( encryptedPrivPart );
 
         return privateMessage;



Mime
View raw message