directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r544729 - in /directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store: ./ operations/
Date Wed, 06 Jun 2007 05:01:26 GMT
Author: erodriguez
Date: Tue Jun  5 22:01:24 2007
New Revision: 544729

URL: http://svn.apache.org/viewvc?view=rev&rev=544729
Log:
Changes to Kerberos principal entries:
o  Removed encryption type as an attribute.  Now that multiple encryption types are supported,
the per-entry type is unused.
o  Added support for distinguished name (DN) and key version number (kvno).

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosAttribute.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/DeletePrincipal.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosAttribute.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosAttribute.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosAttribute.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/KerberosAttribute.java
Tue Jun  5 22:01:24 2007
@@ -32,8 +32,6 @@
 
     /** the krb5kdc schema key for a krb5KDCEntry */
     public static final String KEY = "krb5Key";
-    /** the krb5kdc schema key encryption type for a krb5KDCEntry */
-    public static final String TYPE = "krb5EncryptionType";
     /** the krb5kdc schema principal name for a krb5KDCEntry */
     public static final String PRINCIPAL = "krb5PrincipalName";
     /** the krb5kdc schema key version identifier for a krb5KDCEntry */

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntry.java
Tue Jun  5 22:01:24 2007
@@ -37,6 +37,7 @@
 public class PrincipalStoreEntry
 {
     // principal
+    private String distinguishedName;
     private String commonName;
     private KerberosPrincipal principal;
     private String realmName;
@@ -48,6 +49,7 @@
     private KerberosTime validStart;
     private KerberosTime validEnd;
     private KerberosTime passwordEnd;
+    private int keyVersionNumber;
     private int maxLife;
     private int maxRenew;
     private int kdcFlags;
@@ -60,17 +62,19 @@
     private Map<EncryptionType, EncryptionKey> keyMap;
 
 
-    PrincipalStoreEntry( String commonName, String userId, KerberosPrincipal principal, int
keyVersionNumber,
-        KerberosTime validStart, KerberosTime validEnd, KerberosTime passwordEnd, int maxLife,
int maxRenew,
-        int kdcFlags, int keyType, Map<EncryptionType, EncryptionKey> keyMap, String
realmName, SamType samType,
+    PrincipalStoreEntry( String distinguishedName, String commonName, String userId, KerberosPrincipal
principal,
+        int keyVersionNumber, KerberosTime validStart, KerberosTime validEnd, KerberosTime
passwordEnd, int maxLife,
+        int maxRenew, int kdcFlags, Map<EncryptionType, EncryptionKey> keyMap, String
realmName, SamType samType,
         boolean disabled, boolean lockedOut, KerberosTime expiration )
     {
+        this.distinguishedName = distinguishedName;
         this.commonName = commonName;
         this.userId = userId;
         this.principal = principal;
         this.validStart = validStart;
         this.validEnd = validEnd;
         this.passwordEnd = passwordEnd;
+        this.keyVersionNumber = keyVersionNumber;
         this.maxLife = maxLife;
         this.maxRenew = maxRenew;
         this.kdcFlags = kdcFlags;
@@ -117,6 +121,17 @@
 
 
     /**
+     * Returns the distinguished name.
+     *
+     * @return The distinguished name.
+     */
+    public String getDistinguishedName()
+    {
+        return distinguishedName;
+    }
+
+
+    /**
      * Returns the common name.
      *
      * @return The common name.
@@ -157,6 +172,17 @@
     public int getKDCFlags()
     {
         return kdcFlags;
+    }
+
+
+    /**
+     * Returns the key version number (kvno).
+     *
+     * @return The key version number (kvno).
+     */
+    public int getKeyVersionNumber()
+    {
+        return keyVersionNumber;
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/PrincipalStoreEntryModifier.java
Tue Jun  5 22:01:24 2007
@@ -42,6 +42,7 @@
 public class PrincipalStoreEntryModifier
 {
     // principal
+    private String distinguishedName;
     private String commonName;
     private KerberosPrincipal principal;
     private String realmName;
@@ -59,7 +60,6 @@
     private int maxLife;
     private int maxRenew;
     private int kdcFlags;
-    private int encryptionType;
     private SamType samType;
 
     private boolean disabled = false;
@@ -76,8 +76,8 @@
      */
     public PrincipalStoreEntry getEntry()
     {
-        return new PrincipalStoreEntry( commonName, userId, principal, keyVersionNumber,
validStart, validEnd,
-            passwordEnd, maxLife, maxRenew, kdcFlags, encryptionType, keyMap, realmName,
samType, disabled, lockedOut,
+        return new PrincipalStoreEntry( distinguishedName, commonName, userId, principal,
keyVersionNumber, validStart,
+            validEnd, passwordEnd, maxLife, maxRenew, kdcFlags, keyMap, realmName, samType,
disabled, lockedOut,
             expiration );
     }
 
@@ -116,6 +116,17 @@
 
 
     /**
+     * Sets the distinguished name (DN).
+     *
+     * @param distinguishedName
+     */
+    public void setDistinguishedName( String distinguishedName )
+    {
+        this.distinguishedName = distinguishedName;
+    }
+
+
+    /**
      * Sets the common name (cn).
      *
      * @param commonName
@@ -134,17 +145,6 @@
     public void setUserId( String userId )
     {
         this.userId = userId;
-    }
-
-
-    /**
-     * Sets the encryption type.
-     *
-     * @param encryptionType
-     */
-    public void setEncryptionType( int encryptionType )
-    {
-        this.encryptionType = encryptionType;
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ChangePassword.java
Tue Jun  5 22:01:24 2007
@@ -94,7 +94,7 @@
     private String search( DirContext ctx, String principal ) throws NamingException
     {
         String[] attrIDs =
-            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE,
KerberosAttribute.KEY };
+            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.KEY
};
 
         Attributes matchAttrs = new AttributesImpl( true );
         matchAttrs.put( new AttributeImpl( KerberosAttribute.PRINCIPAL, principal ) );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/DeletePrincipal.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/DeletePrincipal.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/DeletePrincipal.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/DeletePrincipal.java
Tue Jun  5 22:01:24 2007
@@ -91,7 +91,7 @@
     private String search( DirContext ctx, Name searchBaseDn, String principal ) throws NamingException
     {
         String[] attrIDs =
-            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.TYPE,
KerberosAttribute.KEY };
+            { KerberosAttribute.PRINCIPAL, KerberosAttribute.VERSION, KerberosAttribute.KEY
};
 
         Attributes matchAttrs = new AttributesImpl( true );
         matchAttrs.put( new AttributeImpl( KerberosAttribute.PRINCIPAL, principal ) );

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/GetAllPrincipals.java
Tue Jun  5 22:01:24 2007
@@ -107,7 +107,6 @@
         PrincipalStoreEntryModifier modifier = new PrincipalStoreEntryModifier();
 
         String principal = ( String ) attrs.get( KerberosAttribute.PRINCIPAL ).get();
-        String encryptionType = ( String ) attrs.get( KerberosAttribute.TYPE ).get();
         String keyVersionNumber = ( String ) attrs.get( KerberosAttribute.VERSION ).get();
 
         String commonName = ( String ) attrs.get( SchemaConstants.CN_AT ).get();
@@ -136,7 +135,6 @@
 
         modifier.setCommonName( commonName );
         modifier.setPrincipal( new KerberosPrincipal( principal ) );
-        modifier.setEncryptionType( Integer.parseInt( encryptionType ) );
         modifier.setKeyVersionNumber( Integer.parseInt( keyVersionNumber ) );
 
         return modifier.getEntry();

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalObjectFactory.java
Tue Jun  5 22:01:24 2007
@@ -80,7 +80,6 @@
             }
         }
 
-        modifier.setEncryptionType( Integer.parseInt( ( String ) attrs.get( KerberosAttribute.TYPE
).get() ) );
         modifier.setKeyVersionNumber( Integer.parseInt( ( String ) attrs.get( KerberosAttribute.VERSION
).get() ) );
 
         return modifier.getEntry();

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java?view=diff&rev=544729&r1=544728&r2=544729
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/PrincipalStateFactory.java
Tue Jun  5 22:01:24 2007
@@ -148,11 +148,9 @@
                     throw new InvalidAttributeValueException( "Unable to encode Kerberos
key." );
                 }
 
-                int keyType = encryptionKey.getKeyType().getOrdinal();
                 int keyVersion = encryptionKey.getKeyVersion();
 
                 outAttrs.put( KerberosAttribute.PRINCIPAL, principal );
-                outAttrs.put( KerberosAttribute.TYPE, Integer.toString( keyType ) );
                 outAttrs.put( KerberosAttribute.VERSION, Integer.toString( keyVersion ) );
             }
 



Mime
View raw message