directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r548924 - /directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
Date Wed, 20 Jun 2007 04:08:53 GMT
Author: erodriguez
Date: Tue Jun 19 21:08:53 2007
New Revision: 548924

URL: http://svn.apache.org/viewvc?view=rev&rev=548924
Log:
Added some null checks to body checksum verification.

Modified:
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java?view=diff&rev=548924&r1=548923&r2=548924
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
Tue Jun 19 21:08:53 2007
@@ -22,6 +22,8 @@
 
 import org.apache.directory.server.kerberos.shared.crypto.checksum.ChecksumHandler;
 import org.apache.directory.server.kerberos.shared.crypto.encryption.KeyUsage;
+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.value.Checksum;
 import org.apache.mina.common.IoSession;
 import org.apache.mina.handler.chain.IoHandlerCommand;
@@ -47,6 +49,12 @@
         TicketGrantingContext tgsContext = ( TicketGrantingContext ) session.getAttribute(
getContextKey() );
         byte[] bodyBytes = tgsContext.getRequest().getBodyBytes();
         Checksum authenticatorChecksum = tgsContext.getAuthenticator().getChecksum();
+
+        if ( authenticatorChecksum == null || authenticatorChecksum.getChecksumType() ==
null
+            || authenticatorChecksum.getChecksumValue() == null )
+        {
+            throw new KerberosException( ErrorType.KRB_AP_ERR_INAPP_CKSUM );
+        }
 
         log.debug( "Verifying body checksum type '" + authenticatorChecksum.getChecksumType()
+ "'." );
 



Mime
View raw message