directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r557136 - /directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java
Date Wed, 18 Jul 2007 03:53:09 GMT
Author: erodriguez
Date: Tue Jul 17 20:53:08 2007
New Revision: 557136

URL: http://svn.apache.org/viewvc?view=rev&rev=557136
Log:
Returning additional errors with Change Password:
o  Checking for supported version.
o  Checking for null service ticket.

Modified:
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java?view=diff&rev=557136&r1=557135&r2=557136
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/service/GetAuthHeader.java
Tue Jul 17 20:53:08 2007
@@ -20,6 +20,8 @@
 package org.apache.directory.server.changepw.service;
 
 
+import org.apache.directory.server.changepw.exceptions.ChangePasswordException;
+import org.apache.directory.server.changepw.exceptions.ErrorType;
 import org.apache.directory.server.changepw.messages.ChangePasswordRequest;
 import org.apache.directory.server.kerberos.shared.messages.ApplicationRequest;
 import org.apache.directory.server.kerberos.shared.messages.components.Ticket;
@@ -42,6 +44,16 @@
     {
         ChangePasswordContext changepwContext = ( ChangePasswordContext ) session.getAttribute(
getContextKey() );
         ChangePasswordRequest request = ( ChangePasswordRequest ) changepwContext.getRequest();
+
+        if ( request.getVersionNumber() != 1 )
+        {
+            throw new ChangePasswordException( ErrorType.KRB5_KPASSWD_BAD_VERSION );
+        }
+
+        if ( request.getAuthHeader() == null || request.getAuthHeader().getTicket() == null
)
+        {
+            throw new ChangePasswordException( ErrorType.KRB5_KPASSWD_AUTHERROR );
+        }
 
         ApplicationRequest authHeader = request.getAuthHeader();
         Ticket ticket = authHeader.getTicket();



Mime
View raw message