directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: rev 57010 - incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/crypto
Date Tue, 09 Nov 2004 10:25:09 GMT
Author: erodriguez
Date: Tue Nov  9 02:25:07 2004
New Revision: 57010

Modified:
   incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/crypto/CryptoService.java
Log:
Moved choosing encryption type to ticket-granting service.  This is a service function, not
crypto.  This also eliminated the need to configure the crypto service.

Modified: incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/crypto/CryptoService.java
==============================================================================
--- incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/crypto/CryptoService.java
(original)
+++ incubator/directory/kerberos/trunk/kerberos/src/java/org/apache/kerberos/crypto/CryptoService.java
Tue Nov  9 02:25:07 2004
@@ -18,23 +18,22 @@
 
 import org.apache.kerberos.crypto.checksum.*;
 import org.apache.kerberos.crypto.encryption.*;
-import org.apache.kerberos.kdc.*;
-import org.apache.kerberos.messages.value.*;
-import org.apache.kerberos.util.*;
+import org.apache.kerberos.kdc.KerberosException;
+import org.apache.kerberos.messages.value.EncryptedData;
+import org.apache.kerberos.messages.value.EncryptionKey;
+import org.apache.kerberos.util.OctetUtils;
 
-import java.util.*;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
 
 public class CryptoService {
 	
 	private static final Map _encryptionEngines = new HashMap();
 	private static final Map _checksumEngines   = new HashMap();
 	
-	private KdcConfiguration _config;
-	
-	public CryptoService(KdcConfiguration config) {
-		
-		_config = config;
-		
+	public CryptoService() {
+
 		_encryptionEngines.put(EncryptionType.NULL,          new NullEncryption());
 		_encryptionEngines.put(EncryptionType.DES_CBC_CRC,   new DesCbcCrcEncryption());
 		_encryptionEngines.put(EncryptionType.DES_CBC_MD4,   new DesCbcMd4Encryption());
@@ -59,21 +58,7 @@
 			throw KerberosException.KDC_ERR_ETYPE_NOSUPP;
 		return (EncryptionEngine)_encryptionEngines.get(type);
 	}
-	
-	public EncryptionType getBestEncryptionType(EncryptionType[] requestedTypes)
-			throws KerberosException {
-		
-		EncryptionType[] encryptionTypes = _config.getEncryptionTypes();
-		
-		for (int i = 0; i < requestedTypes.length; i++) {
-			for (int j = 0; j < encryptionTypes.length; j++) {
-				if (requestedTypes[i] == encryptionTypes[j])
-					return encryptionTypes[j];
-			}
-		}
-		throw KerberosException.KDC_ERR_ETYPE_NOSUPP;
-	}
-	
+
 	public EncryptionKey getNewSessionKey() {
 		byte[] confounder = Confounder.bytes(8);
 		DesStringToKey subSessionKey = new DesStringToKey(new String(confounder));

Mime
View raw message