directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject directory-kerby git commit: Pick an EncryptionType that we actually support...
Date Tue, 21 Apr 2015 13:11:16 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/master 23ce24ea7 -> d4367fa28


Pick an EncryptionType that we actually support...


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/d4367fa2
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/d4367fa2
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/d4367fa2

Branch: refs/heads/master
Commit: d4367fa28608a12cd893e47bd10217a5a3b4a024
Parents: 23ce24e
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Apr 21 14:11:00 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Apr 21 14:11:00 2015 +0100

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/server/request/KdcRequest.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/d4367fa2/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
index 2165e17..e6bcef0 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/request/KdcRequest.java
@@ -239,9 +239,13 @@ public abstract class KdcRequest {
         KrbIdentity clientEntry = getEntry(clientPrincipal.getName());
         setClientEntry(clientEntry);
 
-        EncryptionType encType = request.getReqBody().getEtypes().listIterator().next();
-        EncryptionKey clientKey = clientEntry.getKeys().get(encType);
-        setClientKey(clientKey);
+        for (EncryptionType encType : request.getReqBody().getEtypes()) {
+            if (clientEntry.getKeys().containsKey(encType)) {
+                EncryptionKey clientKey = clientEntry.getKeys().get(encType);
+                setClientKey(clientKey);
+                break;
+            }
+        }
     }
 
     protected void preauth() throws KrbException {


Mime
View raw message