directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r155606 - incubator/directory/protocols/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/AuthenticationService.java
Date Sun, 27 Feb 2005 01:21:19 GMT
Author: erodriguez
Date: Sat Feb 26 17:21:18 2005
New Revision: 155606

URL: http://svn.apache.org/viewcvs?view=rev&rev=155606
Log:
KerberosTime from is optional.

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=155605&r2=155606
==============================================================================
--- 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
Sat Feb 26 17:21:18 2005
@@ -329,14 +329,25 @@
 		else
 			tempRtime = request.getRtime().getTime();
 
-		if (request.getKdcOptions().get(KdcOptions.RENEWABLE))
+		if ( request.getKdcOptions().get( KdcOptions.RENEWABLE ) )
 		{
-			newTicketBody.setFlag(TicketFlags.RENEWABLE);
-			long renewTill = Math.min(request.getFrom().getTime()
-					+ config.getMaximumRenewableLifetime(), tempRtime);
-			newTicketBody.setRenewTill(new KerberosTime(renewTill));
+			newTicketBody.setFlag( TicketFlags.RENEWABLE );
+			
+			/*
+			 * 'from' KerberosTime is OPTIONAL
+			 */
+			KerberosTime fromTime = request.getFrom();
+			
+			if ( fromTime == null )
+			{
+			    fromTime = new KerberosTime();
+			}
+			
+			long renewTill = Math.min( fromTime.getTime()
+					+ config.getMaximumRenewableLifetime(), tempRtime );
+			newTicketBody.setRenewTill( new KerberosTime( renewTill ) );
 		}
-
+		
 		if (request.getAddresses() != null)
 		{
 			newTicketBody.setClientAddresses(request.getAddresses());



Mime
View raw message