directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r125799 - in incubator/directory/kerberos/trunk/core: . src/java/org/apache/kerberos/io/decoder src/java/org/apache/kerberos/io/encoder src/java/org/apache/kerberos/kdc/store
Date Thu, 20 Jan 2005 17:52:00 GMT
Author: erodriguez
Date: Thu Jan 20 09:51:57 2005
New Revision: 125799

URL: http://svn.apache.org/viewcvs?view=rev&rev=125799
Log:
Updated Kerberos core to maven build with Apache DER and fixed a ByteBuffer to stream conversion
bug.
Modified:
   incubator/directory/kerberos/trunk/core/project.xml
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
   incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java

Modified: incubator/directory/kerberos/trunk/core/project.xml
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/project.xml?view=diff&rev=125799&p1=incubator/directory/kerberos/trunk/core/project.xml&r1=125798&p2=incubator/directory/kerberos/trunk/core/project.xml&r2=125799
==============================================================================
--- incubator/directory/kerberos/trunk/core/project.xml	(original)
+++ incubator/directory/kerberos/trunk/core/project.xml	Thu Jan 20 09:51:57 2005
@@ -7,7 +7,7 @@
   <id>kerberos-core</id>
   <name>Kerberos Server Core</name>
   <package>org.apache.kerberos</package>
-  <inceptionYear>2002</inceptionYear>
+  <inceptionYear>2004</inceptionYear>
   <shortDescription>The Apache Kerberos Server Core</shortDescription>
   <description>
     A Kerberos 5 protocol server.
@@ -20,6 +20,11 @@
       <properties>
         <gump.project>bcprov</gump.project>
       </properties>
+    </dependency>
+    <dependency>
+      <groupId>incubator-directory</groupId>
+      <artifactId>asn1-der</artifactId>
+      <version>0.3-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>incubator-directory</groupId>

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java?view=diff&rev=125799&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java&r1=125798&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java&r2=125799
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KdcRequestDecoder.java
Thu Jan 20 09:51:57 2005
@@ -51,6 +51,7 @@
 		DERApplicationSpecific app = (DERApplicationSpecific) ais.readObject();
 		
 		DERSequence kdcreq = (DERSequence) app.getObject();
+		
 		return decodeKdcRequestSequence( kdcreq );
 	}
 	

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java?view=diff&rev=125799&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java&r1=125798&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java&r2=125799
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/decoder/KerberosMessageDecoder.java
Thu Jan 20 09:51:57 2005
@@ -57,6 +57,7 @@
 import org.apache.kerberos.messages.value.TransitedEncoding;
 import org.apache.kerberos.messages.value.TransitedEncodingType;
 
+
 public abstract class KerberosMessageDecoder
 {
     public InputStream newInputStream( final ByteBuffer buf )
@@ -69,7 +70,10 @@
                 {
                     return -1;
                 }
-                return buf.get();
+                
+                int result = buf.get() & 0x000000FF;
+                
+                return result;
             }
     
             public synchronized int read( byte[] bytes, int off, int len ) throws IOException

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java?view=diff&rev=125799&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java&r1=125798&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java&r2=125799
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/io/encoder/KerberosMessageEncoder.java
Thu Jan 20 09:51:57 2005
@@ -51,15 +51,16 @@
 import org.apache.kerberos.messages.value.TicketFlags;
 import org.apache.kerberos.messages.value.TransitedEncoding;
 
+
 public abstract class KerberosMessageEncoder
 {
 	public static OutputStream newOutputStream( final ByteBuffer buf )
 	{
         return new OutputStream()
 		{
-            public synchronized void write( int b ) throws IOException
+            public synchronized void write( int integer ) throws IOException
 			{
-                buf.put( (byte)b );
+                buf.put( (byte)integer );
             }
     
             public synchronized void write( byte[] bytes, int off, int len ) throws IOException

Modified: incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java
Url: http://svn.apache.org/viewcvs/incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java?view=diff&rev=125799&p1=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java&r1=125798&p2=incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java&r2=125799
==============================================================================
--- incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java
(original)
+++ incubator/directory/kerberos/trunk/core/src/java/org/apache/kerberos/kdc/store/EmbeddedEveStore.java
Thu Jan 20 09:51:57 2005
@@ -14,8 +14,8 @@
  *   limitations under the License.
  *
  */
-package org.apache.kerberos.kdc.store;
 
+package org.apache.kerberos.kdc.store;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -39,16 +39,14 @@
 import org.apache.ldap.common.name.LdapName;
 import org.apache.ldap.common.util.NestableRuntimeException;
 
-
 /**
- * KDC backing store implementation using an embedded Eve DIT
+ * KDC backing store implementation using an embedded ApacheDS DIT
  *
  * @author <a href="mailto:directory-dev@incubator.apache.org">Apache Directory Project</a>
  * @version $Rev$
  */
 public class EmbeddedEveStore implements PrincipalStore
 {
-
     // ------------------------------------------------------------------------
     // Krb5 Schema Attributes
     // ------------------------------------------------------------------------
@@ -60,16 +58,16 @@
      * efficient search is conducted on the more specific DN.
      */
     public static final String KDC_ENTRY_BASEDN_KEY = "kdc.entry.basedn";
-    public static final String KDC_ENTRY_LDIF_FILE = "kdc.entry.ldif.file";
+    public static final String KDC_ENTRY_LDIF_FILE  = "kdc.entry.ldif.file";
 
     /** the krb5kdc schema key for a krb5KDCEntry */
-    private static final String KEY_ATTR = "krb5Key";
+    private static final String KEY_ATTR       = "krb5Key";
     /** the krb5kdc schema key encryption type for a krb5KDCEntry */
-    private static final String TYPE_ATTR = "krb5EncryptionType";
+    private static final String TYPE_ATTR      = "krb5EncryptionType";
     /** the krb5kdc schema principal name for a krb5KDCEntry */
     private static final String PRINCIPAL_ATTR = "krb5PrincipalName";
     /** the krb5kdc schema key version identifier for a krb5KDCEntry */
-    private static final String VERSION_ATTR = "krb5KeyVersionNumber";
+    private static final String VERSION_ATTR   = "krb5KeyVersionNumber";
 
     /** JNDI environment properties and more */
     private final Hashtable env;
@@ -78,22 +76,19 @@
     /** the search base relative to provider URL to use for reading entries */
     private Name searchBaseDn;
 
-
     /**
-     * Creates the embedded Eve principal store.
+     * Creates the embedded ApacheDS principal store.
      *
-     * @param env the environment properties used to initialize the Eve
+     * @param env the environment properties used to initialize the ApacheDS
      * Kerberos environment
      */
     public EmbeddedEveStore( Hashtable env )
     {
         this.env = ( Hashtable ) env.clone();
-        this.env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.ldap.server.jndi.ServerContextFactory"
);
     }
 
-
     /**
-     * Fires up the Eve backing store using the environment properties supplied to the
+     * Fires up the ApacheDS backing store using the environment properties supplied to the
      * constructor.  The JNDI default context factor and some other parameters
      * are automatically set though.  This method then checks to see if the
      * suffix is installed and setup according to the needed DIT structure.
@@ -114,7 +109,7 @@
         {
             // @todo for now until we can find a better means of error handling
             e.printStackTrace();
-            String msg = "Failed to create initial context for Eve provider";
+            String msg = "Failed to create initial context for ApacheDS provider";
             NestableRuntimeException fault;
             fault = new NestableRuntimeException( msg, e );
             throw fault;
@@ -127,7 +122,7 @@
             {
                 ctxRoot = new LdapName( ctx.getNameInNamespace() );
                 searchBaseDn = new LdapName( ( String ) env.get( KDC_ENTRY_BASEDN_KEY ) );
-
+                
                 if ( searchBaseDn.startsWith( ctxRoot ) )
                 {
                     for ( int ii = 0; ii < ctxRoot.size(); ii++ )
@@ -137,7 +132,7 @@
                 }
                 else
                 {
-                    String msg = "Failed to create initial context for Eve provider";
+                    String msg = "Failed to create initial context for ApacheDS provider";
                     IllegalArgumentException fault;
                     fault = new IllegalArgumentException( msg );
                     throw fault;
@@ -147,7 +142,7 @@
             {
                 // @todo for now until we can find a better means of error handling
                 e.printStackTrace();
-                String msg = "Failed to find search base for Eve store";
+                String msg = "Failed to find search base for ApacheDS store";
                 NestableRuntimeException fault;
                 fault = new NestableRuntimeException( msg, e );
                 throw fault;
@@ -217,13 +212,12 @@
         {
             // @todo for now until we can find a better means of error handling
             e.printStackTrace();
-            String msg = "Failed to import initial LDIF into Eve store";
+            String msg = "Failed to import initial LDIF into ApacheDS store";
             NestableRuntimeException fault;
             fault = new NestableRuntimeException( msg, e );
             throw fault;
         }
 
-
         try
         {
             String ldifFile = ( String ) env.get( KDC_ENTRY_LDIF_FILE );
@@ -250,14 +244,13 @@
         {
             // @todo for now until we can find a better means of error handling
             e.printStackTrace();
-            String msg = "Failed to import initial LDIF into Eve store";
+            String msg = "Failed to import initial LDIF into ApacheDS store";
             NestableRuntimeException fault;
             fault = new NestableRuntimeException( msg, e );
             throw fault;
         }
     }
 
-
     public Name getRelativeName( Context base, String dn ) throws NamingException
     {
         LdapName rdn = new LdapName( dn );
@@ -279,7 +272,6 @@
         return rdn;
     }
 
-
     public PrincipalStoreEntry getEntry( KerberosPrincipal principal ) throws KerberosException
     {
         if ( principal == null )
@@ -314,7 +306,6 @@
         }
     }
 
-
     /**
      * Marshals an a PrincipalStoreEntry from an Attributes object.
      *
@@ -337,3 +328,4 @@
         return modifier.getEntry();
     }
 }
+

Mime
View raw message