directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r158588 - in directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc: AuthenticationService.java TicketGrantingService.java
Date Tue, 22 Mar 2005 09:43:52 GMT
Author: erodriguez
Date: Tue Mar 22 01:43:51 2005
New Revision: 158588

URL: http://svn.apache.org/viewcvs?view=rev&rev=158588
Log:
o  Updated AS and TGS services to use new command pattern-based backing store operations packages.
o  Added a guard clause to return a Kerberos null key error instead of returning a decrypted
field integrity check failure error.

Modified:
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java?view=diff&r1=158587&r2=158588
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java
(original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java
Tue Mar 22 01:43:51 2005
@@ -92,19 +92,19 @@
 	{
 		KerberosPrincipal clientPrincipal = request.getClientPrincipal();
 		
-		PrincipalStoreEntry entry = store.getEntry( clientPrincipal );
+		PrincipalStoreEntry entry = getEntryForClient( clientPrincipal );
 		
-        if ( entry == null )
-        {
-            throw new KerberosException( ErrorType.KDC_ERR_C_PRINCIPAL_UNKNOWN );
-        }
-        
         EncryptionKey clientKey = null;
         
 		if ( entry.getSamType() == null )
 		{
 		    clientKey = entry.getEncryptionKey();
 		    
+	        if ( clientKey == null )
+	        {
+	            throw new KerberosException( ErrorType.KDC_ERR_NULL_KEY );
+	        }
+		    
 		    if ( config.isPaEncTimestampRequired() )
 		    {
 			    PreAuthenticationData[] preAuthData = request.getPreAuthData();
@@ -242,13 +242,8 @@
 	private Ticket generateNewTicket( KdcRequest request ) throws KerberosException
 	{
 		KerberosPrincipal serverPrincipal = request.getServerPrincipal();
-
-        EncryptionKey serverKey = getKeyForPrincipal( serverPrincipal );
-
-        if ( serverKey == null )
-        {
-            throw new KerberosException( ErrorType.KDC_ERR_S_PRINCIPAL_UNKNOWN );
-        }
+		
+        EncryptionKey serverKey = getServerKey( serverPrincipal );
         
 		KerberosPrincipal ticketPrincipal = request.getServerPrincipal();
 		

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java?view=diff&r1=158587&r2=158588
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java
(original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java
Tue Mar 22 01:43:51 2005
@@ -159,32 +159,6 @@
 			throw new KerberosException( ErrorType.KRB_AP_ERR_MODIFIED );
 		}
 	}
-
-	private EncryptionKey getServerKey( KerberosPrincipal serverPrincipal )
-			throws KerberosException
-	{
-		EncryptionKey serverKey = null;
-		// TODO - allow lookup with realm
-		try
-        {
-			serverKey = getKeyForPrincipal( serverPrincipal );
-		}
-        catch (Exception e)
-        {
-			/*
-			if (!server) then
-			        if (is_foreign_tgt_name(server)) then
-			                server := best_intermediate_tgs(server);
-			        else
-			                // no server in Database
-			                error_out(KDC_ERR_S_PRINCIPAL_UNKNOWN);
-			        endif
-			endif
-			*/
-			throw new KerberosException( ErrorType.KDC_ERR_S_PRINCIPAL_UNKNOWN );
-		}
-		return serverKey;
-	}
 	
 	private Ticket getNewTicket( KdcRequest request, Ticket tgt, EncryptionKey sessionKey,
 			Authenticator authenticator ) throws KerberosException



Mime
View raw message