You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by er...@apache.org on 2005/02/09 16:27:37 UTC

svn commit: r153077 - incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java

Author: erodriguez
Date: Wed Feb  9 07:27:35 2005
New Revision: 153077

URL: http://svn.apache.org/viewcvs?view=rev&rev=153077
Log:
Improved Linux krb5 libs compatibility.

Modified:
    incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java

Modified: incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java
URL: http://svn.apache.org/viewcvs/incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java?view=diff&r1=153076&r2=153077
==============================================================================
--- incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java (original)
+++ incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java Wed Feb  9 07:27:35 2005
@@ -53,7 +53,6 @@
 import org.apache.kerberos.messages.value.TransitedEncoding;
 import org.apache.kerberos.sam.SamException;
 import org.apache.kerberos.sam.SamSubsystem;
-import org.apache.kerberos.sam.SamType;
 import org.apache.kerberos.sam.TimestampChecker;
 
 
@@ -160,15 +159,15 @@
 		}
 		else
 		{
+		    PreAuthenticationData[] preAuthData = request.getPreAuthData();
+		    
+	        if ( preAuthData == null || preAuthData.length == 0 )
+	        {
+	            throw new KdcErrorPreauthRequired( preparePreAuthenticationError() );
+	        }
+	        
 		    try
 		    {
-			    PreAuthenticationData[] preAuthData = request.getPreAuthData();
-			    
-		        if ( preAuthData == null )
-		        {
-		            throw new SamException( SamType.PA_SAM_TYPE_APACHE, "Client principal requires SAM pre-authentication." );
-		        }
-		        
 			    for ( int ii = 0; ii < preAuthData.length; ii++ )
 			    {
 			        if ( preAuthData[ii].getDataType().equals( PreAuthenticationDataType.PA_ENC_TIMESTAMP ) )
@@ -180,7 +179,7 @@
 		    }
 		    catch (SamException se)
 		    {
-		        throw new KdcErrorPreauthRequired( preparePreAuthenticationError() );
+		        throw new KerberosException( 77, se.getMessage() );
 		    }
 	    }