directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r264832 - in /directory/protocol-providers/kerberos/trunk: ./ src/java/org/apache/kerberos/kdc/ src/java/org/apache/kerberos/kdc/authentication/ src/java/org/apache/kerberos/kdc/preauthentication/ src/java/org/apache/kerberos/kdc/ticketgran...
Date Tue, 30 Aug 2005 19:25:43 GMT
Author: erodriguez
Date: Tue Aug 30 12:24:54 2005
New Revision: 264832

URL: http://svn.apache.org/viewcvs?rev=264832&view=rev
Log:
Merged refactor-to-chain branch changes r232946:264829 into the kerberos-protocol trunk.

Added:
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/KdcConfiguration.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/KdcConfiguration.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/KdcContext.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/KdcContext.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorContext.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/MonitorContext.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorReply.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/MonitorReply.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorRequest.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/MonitorRequest.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/SelectChecksumType.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/SelectChecksumType.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/SelectEncryptionType.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/SelectEncryptionType.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/
      - copied from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationContext.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/AuthenticationContext.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationExceptionHandler.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/AuthenticationExceptionHandler.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationServiceChain.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/AuthenticationServiceChain.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/BuildReply.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/BuildReply.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/ConfigureAuthenticationChain.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/ConfigureAuthenticationChain.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GenerateTicket.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/GenerateTicket.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GetClientEntry.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/GetClientEntry.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GetServerEntry.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/GetServerEntry.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/SealReply.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/authentication/SealReply.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/
      - copied from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/preauthentication/
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/PreAuthenticationChain.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/preauthentication/PreAuthenticationChain.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifierBase.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/preauthentication/VerifierBase.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifyEncryptedTimestamp.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/preauthentication/VerifyEncryptedTimestamp.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifySam.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/preauthentication/VerifySam.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/
      - copied from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/BuildReply.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/BuildReply.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/ConfigureTicketGrantingChain.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/ConfigureTicketGrantingChain.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GenerateTicket.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/GenerateTicket.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetAuthHeader.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/GetAuthHeader.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetRequestPrincipalEntry.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/GetRequestPrincipalEntry.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetTicketPrincipalEntry.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/GetTicketPrincipalEntry.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/MonitorContext.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/MonitorContext.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/SealReply.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/SealReply.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingContext.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingContext.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingExceptionHandler.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingExceptionHandler.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingServiceChain.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingServiceChain.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgt.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgt.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgtAuthHeader.java   (props changed)
      - copied unchanged from r264829, directory/protocol-providers/kerberos/branches/refactor-to-chain/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgtAuthHeader.java
Removed:
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/AuthenticationService.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ErrorService.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/TicketGrantingService.java
Modified:
    directory/protocol-providers/kerberos/trunk/project.xml
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosDecoder.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosEncoder.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolHandler.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolProvider.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/KeyIntegrityChecker.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamException.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamSubsystem.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamVerifier.java
    directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/TimestampChecker.java
    directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/kdc/TestUtils.java
    directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/messages/value/OptionsTest.java

Modified: directory/protocol-providers/kerberos/trunk/project.xml
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/project.xml?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/project.xml (original)
+++ directory/protocol-providers/kerberos/trunk/project.xml Tue Aug 30 12:24:54 2005
@@ -78,19 +78,25 @@
 
   <dependencies>
     <dependency>
-      <groupId>commons-logging</groupId>
-      <artifactId>commons-logging</artifactId>
-      <version>1.0.4</version>
+      <groupId>org.slf4j</groupId>
+      <artifactId>nlog4j</artifactId>
+      <version>1.2.14</version>
+      <url>http://slf4j.org/nlog4j</url>
     </dependency>
     <dependency>
       <groupId>directory-shared</groupId>
       <artifactId>kerberos-common</artifactId>
-      <version>0.5-SNAPSHOT</version>
+      <version>0.5.1-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>directory-network</groupId>
       <artifactId>mina</artifactId>
       <version>0.7.3</version>
+    </dependency>
+    <dependency>
+      <groupId>directory-asn1</groupId>
+      <artifactId>asn1-der</artifactId>
+      <version>0.3.1</version>
     </dependency>
     <dependency>
       <groupId>junit</groupId>

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/KdcConfiguration.java
------------------------------------------------------------------------------
    svn:keywords = Rev

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/KdcContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/MonitorRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/SelectChecksumType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/SelectEncryptionType.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationExceptionHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/AuthenticationServiceChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/BuildReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/ConfigureAuthenticationChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GenerateTicket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GetClientEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/GetServerEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/authentication/SealReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/PreAuthenticationChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifierBase.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifyEncryptedTimestamp.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/preauthentication/VerifySam.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/BuildReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/ConfigureTicketGrantingChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GenerateTicket.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetAuthHeader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetRequestPrincipalEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/GetTicketPrincipalEntry.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/MonitorContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/SealReply.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingContext.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingExceptionHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/TicketGrantingServiceChain.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyBodyChecksum.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgt.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/kdc/ticketgrant/VerifyTgtAuthHeader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosDecoder.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosDecoder.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosDecoder.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosDecoder.java Tue Aug 30 12:24:54 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.protocol;
 
 import java.io.IOException;
@@ -26,22 +25,20 @@
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.ProtocolViolationException;
 
-
 public class KerberosDecoder implements ProtocolDecoder
 {
-	private KdcRequestDecoder decoder = new KdcRequestDecoder();
-	
+    private KdcRequestDecoder decoder = new KdcRequestDecoder();
+
     public void decode( ProtocolSession session, ByteBuffer in, ProtocolDecoderOutput out )
             throws ProtocolViolationException
     {
         try
-		{
-        	out.write( decoder.decode( in.buf() ) );
+        {
+            out.write( decoder.decode( in.buf() ) );
         }
-        catch ( IOException ioe)
-		{
-        	ioe.printStackTrace();
+        catch ( IOException ioe )
+        {
+            ioe.printStackTrace();
         }
     }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosEncoder.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosEncoder.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosEncoder.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosEncoder.java Tue Aug 30 12:24:54 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.protocol;
 
 import java.io.IOException;
@@ -29,39 +28,37 @@
 import org.apache.mina.protocol.ProtocolSession;
 import org.apache.mina.protocol.ProtocolViolationException;
 
-
 public class KerberosEncoder implements ProtocolEncoder
 {
-	private KdcReplyEncoder     replyEncoder = new KdcReplyEncoder();
-	private ErrorMessageEncoder errorEncoder = new ErrorMessageEncoder();
-	
+    private KdcReplyEncoder replyEncoder = new KdcReplyEncoder();
+    private ErrorMessageEncoder errorEncoder = new ErrorMessageEncoder();
+
     public void encode( ProtocolSession session, Object message, ProtocolEncoderOutput out )
             throws ProtocolViolationException
     {
-    	ByteBuffer buf = ByteBuffer.allocate( 1024 );
-    	
-    	try
-		{
-	    	if ( message instanceof KdcReply )
-	    	{
-	    		replyEncoder.encode( (KdcReply)message, buf.buf() );
-	    	}
-	    	else
-	    	{
-	        	if ( message instanceof ErrorMessage )
-	        	{
-	        		errorEncoder.encode( (ErrorMessage)message, buf.buf() );
-	        	}
-	    	}
-	    	
-	        buf.flip();
-	        
-	        out.write( buf );
-		}
-    	catch ( IOException ioe )
-		{
-    		throw new ProtocolViolationException();
-		}
+        ByteBuffer buf = ByteBuffer.allocate( 1024 );
+
+        try
+        {
+            if ( message instanceof KdcReply )
+            {
+                replyEncoder.encode( (KdcReply) message, buf.buf() );
+            }
+            else
+            {
+                if ( message instanceof ErrorMessage )
+                {
+                    errorEncoder.encode( (ErrorMessage) message, buf.buf() );
+                }
+            }
+
+            buf.flip();
+
+            out.write( buf );
+        }
+        catch ( IOException ioe )
+        {
+            throw new ProtocolViolationException();
+        }
     }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolHandler.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolHandler.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolHandler.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolHandler.java Tue Aug 30 12:24:54 2005
@@ -14,28 +14,22 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.protocol;
 
-import java.io.IOException;
-
+import org.apache.kerberos.chain.Command;
 import org.apache.kerberos.exceptions.ErrorType;
-import org.apache.kerberos.exceptions.KerberosException;
-import org.apache.kerberos.kdc.AuthenticationService;
-import org.apache.kerberos.kdc.ErrorService;
-import org.apache.kerberos.kdc.TicketGrantingService;
-import org.apache.kerberos.messages.AuthenticationReply;
-import org.apache.kerberos.messages.ErrorMessage;
+import org.apache.kerberos.kdc.KdcConfiguration;
+import org.apache.kerberos.kdc.authentication.AuthenticationContext;
+import org.apache.kerberos.kdc.authentication.AuthenticationServiceChain;
+import org.apache.kerberos.kdc.ticketgrant.TicketGrantingContext;
+import org.apache.kerberos.kdc.ticketgrant.TicketGrantingServiceChain;
 import org.apache.kerberos.messages.KdcRequest;
-import org.apache.kerberos.messages.TicketGrantReply;
-import org.apache.kerberos.service.KdcConfiguration;
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.mina.common.IdleStatus;
 import org.apache.mina.protocol.ProtocolHandler;
 import org.apache.mina.protocol.ProtocolSession;
-import org.apache.commons.logging.LogFactory;
-import org.apache.commons.logging.Log;
-
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * The Kerberos protocol handler for MINA which handles requests for the authentication
@@ -46,17 +40,22 @@
  */
 public class KerberosProtocolHandler implements ProtocolHandler
 {
-    private static final Log log = LogFactory.getLog( KerberosProtocolHandler.class );
-	private AuthenticationService authService;
-	private TicketGrantingService tgsService;
-	private ErrorService          errorService;
-	
-	public KerberosProtocolHandler( KdcConfiguration config, PrincipalStore store )
-    {
-		errorService = new ErrorService( config );
-		authService  = new AuthenticationService( config, store );
-		tgsService   = new TicketGrantingService( config, store );
-	}
+    private static final Logger log = LoggerFactory.getLogger( KerberosProtocolHandler.class );
+
+    private KdcConfiguration config;
+    private PrincipalStore store;
+
+    private Command authService;
+    private Command tgsService;
+
+    public KerberosProtocolHandler( KdcConfiguration config, PrincipalStore store )
+    {
+        this.config = config;
+        this.store = store;
+
+        authService = new AuthenticationServiceChain();
+        tgsService = new TicketGrantingServiceChain();
+    }
 
     public void sessionCreated( ProtocolSession session )
     {
@@ -103,42 +102,48 @@
             log.debug( session.getRemoteAddress() + " RCVD: " + message );
         }
 
-		try
-		{
-			KdcRequest request = ( KdcRequest ) message;
-			
-			int messageType = request.getMessageType().getOrdinal();
-			
-			switch ( messageType )
-			{
-				case 10:
-					AuthenticationReply authReply = authService.getReplyFor( request );
-					session.write( authReply );
-					break;
-				
-				case 12:
-					TicketGrantReply ticketReply = tgsService.getReplyFor( request );
-					session.write( ticketReply );
-		    		break;
-		    		
-		    	case 11:
-		    	case 13:
-		    		throw new KerberosException( ErrorType.KRB_AP_ERR_BADDIRECTION );
-		    		
-				default:
-					throw new KerberosException( ErrorType.KRB_AP_ERR_MSG_TYPE );
-			}
-		}
-		catch ( KerberosException ke )
-		{
-			log.error( "Returning error message:  " + ke.getMessage(), ke );
-			ErrorMessage errorMessage = errorService.getReplyFor( ke );
-			session.write( errorMessage );
-		}
-		catch ( IOException ioe )
-		{
-			log.error( ioe );
-		}
+        KdcRequest request = (KdcRequest) message;
+
+        int messageType = request.getMessageType().getOrdinal();
+
+        try
+        {
+            switch ( messageType )
+            {
+                case 10:
+                    AuthenticationContext authContext = new AuthenticationContext();
+                    authContext.setConfig( config );
+                    authContext.setStore( store );
+                    authContext.setRequest( request );
+
+                    authService.execute( authContext );
+
+                    session.write( authContext.getReply() );
+                    break;
+
+                case 12:
+                    TicketGrantingContext tgsContext = new TicketGrantingContext();
+                    tgsContext.setConfig( config );
+                    tgsContext.setStore( store );
+                    tgsContext.setRequest( request );
+
+                    tgsService.execute( tgsContext );
+
+                    session.write( tgsContext.getReply() );
+                    break;
+
+                case 11:
+                case 13:
+                    log.error( "Kerberos error:  " + ErrorType.KRB_AP_ERR_BADDIRECTION.getMessage() );
+
+                default:
+                    log.error( "Kerberos error:  " + ErrorType.KRB_AP_ERR_MSG_TYPE.getMessage() );
+            }
+        }
+        catch ( Exception e )
+        {
+            log.error( e.getMessage() );
+        }
     }
 
     public void messageSent( ProtocolSession session, Object message )
@@ -149,4 +154,3 @@
         }
     }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolProvider.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolProvider.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolProvider.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/protocol/KerberosProtocolProvider.java Tue Aug 30 12:24:54 2005
@@ -14,10 +14,9 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.protocol;
 
-import org.apache.kerberos.service.KdcConfiguration;
+import org.apache.kerberos.kdc.KdcConfiguration;
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.mina.protocol.ProtocolCodecFactory;
 import org.apache.mina.protocol.ProtocolDecoder;
@@ -25,7 +24,6 @@
 import org.apache.mina.protocol.ProtocolHandler;
 import org.apache.mina.protocol.ProtocolProvider;
 
-
 public class KerberosProtocolProvider implements ProtocolProvider
 {
     // Protocol handler is usually a singleton.
@@ -47,10 +45,10 @@
         }
     };
 
-	public KerberosProtocolProvider( KdcConfiguration config, PrincipalStore store )
+    public KerberosProtocolProvider( KdcConfiguration config, PrincipalStore store )
     {
-		HANDLER = new KerberosProtocolHandler( config, store );
-	}
+        HANDLER = new KerberosProtocolHandler( config, store );
+    }
 
     public ProtocolCodecFactory getCodecFactory()
     {
@@ -62,4 +60,3 @@
         return HANDLER;
     }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/KeyIntegrityChecker.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/KeyIntegrityChecker.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/KeyIntegrityChecker.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/KeyIntegrityChecker.java Tue Aug 30 12:24:54 2005
@@ -16,9 +16,7 @@
  */
 package org.apache.kerberos.sam;
 
-
 import javax.security.auth.kerberos.KerberosKey;
-
 
 /**
  * Checks the integrity of a kerberos key to decode-decrypt an encrypted

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamException.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamException.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamException.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamException.java Tue Aug 30 12:24:54 2005
@@ -18,7 +18,6 @@
 
 import org.apache.kerberos.messages.value.SamType;
 
-
 /**
  * Base class for all SAM subsystem errors.
  *
@@ -31,7 +30,6 @@
     /** the SAM type that caused this exception */
     private final SamType type;
 
-
     /**
      * Creates a SamException for a specific SamType.
      *
@@ -44,7 +42,6 @@
         this.type = type;
     }
 
-
     /**
      * Creates a SamException for a specific SamType, with message.
      *
@@ -58,7 +55,6 @@
         this.type = type;
     }
 
-
     /**
      * Creates a SamException for a specific SamType, with the cause resulted in
      * this exception.
@@ -73,7 +69,6 @@
         this.type = type;
     }
 
-
     /**
      * Creates a SamException for a specific SamType, with a message and the
      * cause that resulted in this exception.
@@ -89,7 +84,6 @@
 
         this.type = type;
     }
-
 
     /**
      * Gets the registered SAM algorithm type associated with this SamException.

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamSubsystem.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamSubsystem.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamSubsystem.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamSubsystem.java Tue Aug 30 12:24:54 2005
@@ -16,17 +16,15 @@
  */
 package org.apache.kerberos.sam;
 
-
 import java.util.HashMap;
 import java.util.Hashtable;
 
-import javax.security.auth.kerberos.KerberosKey;
 import javax.naming.NamingException;
 import javax.naming.directory.DirContext;
+import javax.security.auth.kerberos.KerberosKey;
 
 import org.apache.kerberos.store.PrincipalStoreEntry;
 
-
 /**
  * The Subsystem that enables the Kerberos server to use plugable Single-use
  * Authentication mechanisms.
@@ -51,7 +49,6 @@
     private DirContext userContext;
     private String userBaseRdn;
 
-
     /**
      * Gets the singleton instance of the SamSubsystem.
      *
@@ -67,7 +64,6 @@
         return instance;
     }
 
-
     /**
      * Sets the KeyIntegrityChecker used by the entire SamSubsystem.
      *
@@ -78,7 +74,6 @@
         this.keyChecker = keyChecker;
     }
 
-
     /**
      * Uses the principal entry information to load the approapriate SamVerifier
      * and verify the Single-use password.
@@ -105,7 +100,7 @@
 
         if ( verifiers.containsKey( entry.getSamType() ) )
         {
-            verifier = ( SamVerifier ) verifiers.get( entry.getSamType() );
+            verifier = (SamVerifier) verifiers.get( entry.getSamType() );
 
             return verifier.verify( entry.getPrincipal(), sad );
         }
@@ -118,31 +113,31 @@
         {
             env.putAll( userContext.getEnvironment() );
         }
-        catch (NamingException e)
+        catch ( NamingException e )
         {
             e.printStackTrace();
         }
 
-        if ( ! env.containsKey( key ) )
+        if ( !env.containsKey( key ) )
         {
             String msg = "Could not find property '" + key + "'";
 
             throw new SamException( entry.getSamType(), msg );
         }
 
-        String fqcn = ( String ) env.get( key );
+        String fqcn = (String) env.get( key );
 
         try
         {
             Class c = Class.forName( fqcn );
 
-            verifier = ( SamVerifier ) c.newInstance();
+            verifier = (SamVerifier) c.newInstance();
 
             try
             {
-                verifier.setUserContext( ( DirContext ) userContext.lookup( userBaseRdn ) );
+                verifier.setUserContext( (DirContext) userContext.lookup( userBaseRdn ) );
             }
-            catch (NamingException e)
+            catch ( NamingException e )
             {
                 e.printStackTrace();
 
@@ -152,7 +147,7 @@
 
             verifier.startup();
 
-            if ( ! verifier.getSamType().equals( entry.getSamType() ) )
+            if ( !verifier.getSamType().equals( entry.getSamType() ) )
             {
                 String msg = "Expecting entries with SAM type of " + verifier.getSamType();
 
@@ -169,7 +164,7 @@
         {
             String msg = "Could not find verifier class '" + fqcn;
 
-            msg += "' for SamType( " + entry.getSamType() + " ) " ;
+            msg += "' for SamType( " + entry.getSamType() + " ) ";
 
             throw new SamException( entry.getSamType(), msg, e );
         }
@@ -177,7 +172,7 @@
         {
             String msg = "No public default constructor on class '" + fqcn;
 
-            msg += "' for SamType( " + entry.getSamType() + " ) " ;
+            msg += "' for SamType( " + entry.getSamType() + " ) ";
 
             throw new SamException( entry.getSamType(), msg, e );
         }
@@ -185,12 +180,11 @@
         {
             String msg = "Failed on default constructor invocation for class '" + fqcn;
 
-            msg += "' for SamType( " + entry.getSamType() + " ) " ;
+            msg += "' for SamType( " + entry.getSamType() + " ) ";
 
             throw new SamException( entry.getSamType(), msg, e );
         }
     }
-
 
     /**
      * Sets the context under which user entries can be found.

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamVerifier.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamVerifier.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamVerifier.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/SamVerifier.java Tue Aug 30 12:24:54 2005
@@ -16,13 +16,11 @@
  */
 package org.apache.kerberos.sam;
 
-
+import javax.naming.directory.DirContext;
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
-import javax.naming.directory.DirContext;
 
 import org.apache.kerberos.messages.value.SamType;
-
 
 /**
  * Single-use Authentication Mechanism verifier (subsystem) interface.

Modified: directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/TimestampChecker.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/TimestampChecker.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/TimestampChecker.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/java/org/apache/kerberos/sam/TimestampChecker.java Tue Aug 30 12:24:54 2005
@@ -14,7 +14,6 @@
  *   limitations under the License.
  *
  */
-
 package org.apache.kerberos.sam;
 
 import java.io.IOException;
@@ -32,53 +31,51 @@
 import org.apache.kerberos.messages.value.EncryptionKey;
 import org.apache.kerberos.messages.value.KerberosTime;
 
-
 public class TimestampChecker implements KeyIntegrityChecker
 {
     private static final long FIVE_MINUTES = 300000;
-    
+
     public boolean checkKeyIntegrity( byte[] encryptedData, KerberosKey kerberosKey )
     {
         EncryptionType keyType = EncryptionType.getTypeByOrdinal( kerberosKey.getKeyType() );
         EncryptionKey key = new EncryptionKey( keyType, kerberosKey.getEncoded() );
-        
+
         try
         {
-	        // Since the pre-auth value is of type PA-ENC-TIMESTAMP, it should be a valid
-	        // ASN.1 PA-ENC-TS-ENC structure, so we can decode it into EncryptedData.
-	        EncryptedData sadValue = EncryptedDataDecoder.decode( encryptedData );
-	        
-	        // Decrypt the EncryptedData structure to get the PA-ENC-TS-ENC
+            // Since the pre-auth value is of type PA-ENC-TIMESTAMP, it should be a valid
+            // ASN.1 PA-ENC-TS-ENC structure, so we can decode it into EncryptedData.
+            EncryptedData sadValue = EncryptedDataDecoder.decode( encryptedData );
+
+            // Decrypt the EncryptedData structure to get the PA-ENC-TS-ENC
             EncryptionEngine engine = EncryptionEngineFactory.getEncryptionEngineFor( key );
             byte[] decryptedTimestamp = engine.getDecryptedData( key, sadValue );
-            
+
             // Decode the decrypted timestamp into our timestamp object.
             EncryptedTimestampDecoder decoder = new EncryptedTimestampDecoder();
             EncryptedTimeStamp timestamp = decoder.decode( decryptedTimestamp );
-            
+
             // Since we got here we must have a valid timestamp structure that we can
             // validate to be within a five minute skew.
             KerberosTime time = timestamp.getTimeStamp();
-            
+
             if ( time.isInClockSkew( FIVE_MINUTES ) )
             {
                 return true;
             }
         }
-        catch (IOException ioe)
+        catch ( IOException ioe )
         {
             return false;
         }
-        catch (KerberosException ke)
+        catch ( KerberosException ke )
         {
             return false;
         }
-        catch (ClassCastException cce)
+        catch ( ClassCastException cce )
         {
             return false;
         }
-        
+
         return false;
     }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/kdc/TestUtils.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/kdc/TestUtils.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/kdc/TestUtils.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/kdc/TestUtils.java Tue Aug 30 12:24:54 2005
@@ -16,150 +16,191 @@
  */
 package org.apache.kerberos.kdc;
 
-import java.io.*;
+import java.io.BufferedInputStream;
+import java.io.CharArrayWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.Reader;
+
+public class TestUtils
+{
+    public static char[] getControlDocument( String resource ) throws IOException
+    {
+        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream( resource );
+
+        Reader reader = new InputStreamReader( new BufferedInputStream( is ) );
+
+        CharArrayWriter writer = new CharArrayWriter();
+
+        try
+        {
+            char[] buf = new char[ 2048 ];
+            int len = 0;
+            while ( len >= 0 )
+            {
+                len = reader.read( buf );
+                if ( len > 0 )
+                {
+                    writer.write( buf, 0, len );
+                }
+            }
+        }
+        finally
+        {
+            try
+            {
+                reader.close();
+            }
+            catch ( IOException ioe )
+            {
+            }
+        }
+
+        char[] isca = writer.toCharArray();
+        return isca;
+    }
+
+    public static byte[] getBytesFromResource( String resource ) throws IOException
+    {
+        InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream( resource );
+
+        BufferedInputStream stream = new BufferedInputStream( is );
+        int len = stream.available();
+        byte[] bytes = new byte[ len ];
+        stream.read( bytes, 0, len );
+
+        return bytes;
+    }
+
+    public static void hexdump( byte[] data )
+    {
+        hexdump( data, true );
+    }
+
+    public static void hexdump( byte[] data, boolean delimit )
+    {
+        String delimiter = new String( "-------------------------------------------------" );
+
+        if ( delimit )
+        {
+            System.out.println( delimiter );
+        }
+
+        int lineLength = 0;
+        for ( int ii = 0; ii < data.length; ii++ )
+        {
+            System.out.print( byte2hexString( data[ ii ] ) + " " );
+            lineLength++;
+            
+            if ( lineLength == 8 )
+            {
+                System.out.print( "  " );
+            }
+            
+            if ( lineLength == 16 )
+            {
+                System.out.println();
+                lineLength = 0;
+            }
+        }
+
+        if ( delimit )
+        {
+            System.out.println();
+            System.out.println( delimiter );
+        }
+    }
+
+    public static final String[] hex_digit = { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
+            "a", "b", "c", "d", "e", "f" };
+
+    public static String byte2hexString( byte x )
+    {
+        String s = "";
+        for ( int ii = 0; ii < 2; ii++ )
+        {
+            s = hex_digit[ ( ( ( x ) & 0xff ) & ( 15 << ( ii * 4 ) ) ) >>> ( ii * 4 ) ] + s;
+        }
+
+        return s;
+    }
+
+    public static String int2hexString( int x )
+    {
+        String s = "";
+        for ( int ii = 0; ii < 8; ii++ )
+        {
+            s = hex_digit[ ( x & ( 15 << ( ii * 4 ) ) ) >>> ( ii * 4 ) ] + s;
+        }
+
+        return s;
+    }
+
+    public static String int2binString( int x )
+    {
+        String s = "";
+        for ( int ii = 0; ii < 32; ii++ )
+        {
+            if ( ( ii > 0 ) && ( ii % 4 == 0 ) ) 
+            {
+                s = " " + s;
+            }
+
+            s = hex_digit[ ( x & ( 1 << ii ) ) >>> ii ] + s;
+        }
+
+        return s;
+    }
+
+    public static String long2hexString( long x )
+    {
+        String s = "";
+        for ( int ii = 0; ii < 16; ii++ )
+        {
+            s = hex_digit[ (int) ( ( x & ( 15L << ( ii * 4 ) ) ) >>> ( ii * 4 ) ) ] + s;
+        }
+
+        return s;
+    }
+
+    public static String long2binString( long x )
+    {
+        String s = "";
+        for ( int ii = 0; ii < 64; ii++ )
+        {
+            if ( ( ii > 0 ) && ( ii % 4 == 0 ) )
+            {
+                s = " " + s;
+            }
+
+            s = hex_digit[ (int) ( ( x & ( 1L << ii ) ) >>> ii ) ] + s;
+        }
+
+        return s;
+    }
+
+    public static String byte2hexString( byte[] input )
+    {
+        return byte2hexString( input, 0, input.length );
+    }
+
+    public static String byte2hexString( byte[] input, int offset )
+    {
+        return byte2hexString( input, offset, input.length );
+    }
+
+    public static String byte2hexString( byte[] input, int offset, int length )
+    {
+        String result = "";
+        for ( int ii = 0; ii < length; ii++ )
+        {
+            if ( ii + offset < input.length )
+            {
+                result += byte2hexString( input[ ii + offset ] );
+            }
+        }
 
-public class TestUtils {
-
-	public static char[] getControlDocument(String resource) throws IOException
-    {
-		InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(resource);
-
-		Reader reader = new InputStreamReader(new BufferedInputStream(is));
-
-		CharArrayWriter writer = new CharArrayWriter();
-
-		try {
-			char[] buf = new char[2048];
-			int len = 0;
-			while (len >= 0) {
-				len = reader.read(buf);
-				if (len > 0)
-					writer.write(buf, 0, len);
-			}
-		} finally {
-			try {
-				reader.close();
-			} catch (IOException ioe) {
-			}
-		}
-
-		char[] isca = writer.toCharArray();
-		return isca;
-	}
-
-	public static byte[] getBytesFromResource(String resource) throws IOException
-    {
-		InputStream is = ClassLoader.getSystemClassLoader().getResourceAsStream(resource);
-		
-		BufferedInputStream stream = new BufferedInputStream(is);
-		int len = stream.available();
-		byte[] bytes = new byte[len];
-		stream.read(bytes, 0, len);
-		return bytes;
-	}
-	
-	public static void hexdump(byte[] data)
-    {
-		hexdump(data, true);
-	}
-	
-	public static void hexdump(byte[] data, boolean delimit)
-    {
-		String delimiter = new String("-------------------------------------------------");
-		
-		if (delimit)
-			System.out.println(delimiter);
-		
-		int lineLength = 0;
-		for (int i = 0;i < data.length; i++) {
-			System.out.print(byte2hexString(data[i]) + " ");
-			lineLength++;
-			if (lineLength == 8) {
-				System.out.print("  ");
-			}
-			if (lineLength == 16) {
-				System.out.println();
-				lineLength = 0;
-			}
-		}
-		if (delimit) {
-			System.out.println();
-			System.out.println(delimiter);
-		}
-	}
-
-	public static final String[] hex_digit =
-    {
-		"0", "1", "2", "3", "4", "5", "6", "7",
-		"8", "9", "a", "b", "c", "d", "e", "f"
-	};
-
-	public static String byte2hexString(byte x)
-    {
-		String s = "";
-		for (int i = 0; i < 2; i++) {
-			s = hex_digit[(((x) & 0xff) & (15 << (i * 4))) >>> (i * 4)] + s;
-		}
-		return s;
-	}
-
-	public static String int2hexString(int x)
-    {
-		String s = "";
-		for (int i = 0; i < 8; i++) {
-			s = hex_digit[(x & (15 << (i * 4))) >>> (i * 4)] + s;
-		}
-		return s;
-	}
-
-	public static String int2binString(int x)
-    {
-		String s = "";
-		for (int i = 0; i < 32; i++) {
-			if ((i > 0) && (i % 4 == 0)) s = " " + s;
-			s = hex_digit[(x & (1 << i)) >>> i] + s;
-		}
-		return s;
-	}
-
-	public static String long2hexString(long x)
-    {
-		String s = "";
-		for (int i = 0; i < 16; i++) {
-			s = hex_digit[(int)((x & (15L << (i * 4))) >>> (i * 4))] + s;
-		}
-		return s;
-	}
-
-	public static String long2binString(long x)
-    {
-		String s = "";
-		for (int i = 0; i < 64; i++) {
-			if ((i > 0) && (i % 4 == 0)) s = " " + s;
-			s = hex_digit[(int)((x & (1L << i)) >>> i)] + s;
-		}
-		return s;
-	}
-
-	public static String byte2hexString(byte[] input)
-    {
-		return byte2hexString(input, 0, input.length);
-	}
-
-	public static String byte2hexString(byte[] input, int offset)
-    {
-		return byte2hexString(input, offset, input.length);
-	}
-
-	public static String byte2hexString(byte[] input, int offset, int length)
-    {
-		String result = "";
-		for (int i = 0; i < length; i++) {
-			if (i + offset < input.length) {
-				result += byte2hexString(input[i + offset]);
-			}
-		}
-		return result;
-	}
+        return result;
+    }
 }
-

Modified: directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/messages/value/OptionsTest.java
URL: http://svn.apache.org/viewcvs/directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/messages/value/OptionsTest.java?rev=264832&r1=264831&r2=264832&view=diff
==============================================================================
--- directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/messages/value/OptionsTest.java (original)
+++ directory/protocol-providers/kerberos/trunk/src/test/org/apache/kerberos/messages/value/OptionsTest.java Tue Aug 30 12:24:54 2005
@@ -16,39 +16,38 @@
  */
 package org.apache.kerberos.messages.value;
 
-import junit.framework.TestCase;
-
 import java.util.Arrays;
 
+import junit.framework.TestCase;
+
 public class OptionsTest extends TestCase
- {
-    private byte[] fpriOptions = {(byte) 0x50, (byte)0x00, (byte)0x00, (byte)0x10};
+{
+    private byte[] fpriOptions = { (byte) 0x50, (byte) 0x00, (byte) 0x00, (byte) 0x10 };
 
     public void testToString()
     {
         TicketFlags flags = new TicketFlags();
-		flags.set(TicketFlags.FORWARDABLE);
-		flags.set(TicketFlags.PROXIABLE);
-		flags.set(TicketFlags.RENEWABLE);
-		flags.set(TicketFlags.INITIAL);
-        assertEquals(flags.toString(), "FORWARDABLE PROXIABLE RENEWABLE INITIAL");
+        flags.set( TicketFlags.FORWARDABLE );
+        flags.set( TicketFlags.PROXIABLE );
+        flags.set( TicketFlags.RENEWABLE );
+        flags.set( TicketFlags.INITIAL );
+        assertEquals( flags.toString(), "FORWARDABLE PROXIABLE RENEWABLE INITIAL" );
     }
 
-	public void testDuplicateSetting()
+    public void testDuplicateSetting()
     {
-		TicketFlags flags = new TicketFlags();
-        flags.set(TicketFlags.MAY_POSTDATE);
-		flags.set(TicketFlags.FORWARDABLE);
-		flags.set(TicketFlags.PROXIABLE);
-        flags.set(TicketFlags.MAY_POSTDATE);
-		flags.set(TicketFlags.RENEWABLE);
-        assertEquals(flags.toString(), "FORWARDABLE PROXIABLE MAY_POSTDATE RENEWABLE");
-	}
+        TicketFlags flags = new TicketFlags();
+        flags.set( TicketFlags.MAY_POSTDATE );
+        flags.set( TicketFlags.FORWARDABLE );
+        flags.set( TicketFlags.PROXIABLE );
+        flags.set( TicketFlags.MAY_POSTDATE );
+        flags.set( TicketFlags.RENEWABLE );
+        assertEquals( flags.toString(), "FORWARDABLE PROXIABLE MAY_POSTDATE RENEWABLE" );
+    }
 
     public void testConstruction()
     {
-		KdcOptions options = new KdcOptions(fpriOptions);
-        assertTrue(Arrays.equals(options.getBytes(), fpriOptions));
+        KdcOptions options = new KdcOptions( fpriOptions );
+        assertTrue( Arrays.equals( options.getBytes(), fpriOptions ) );
     }
 }
-



Mime
View raw message