directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [45/48] directory-kerby git commit: DIRKRB-438 Build failure with maven-surefire-plugin error.
Date Wed, 04 Nov 2015 08:26:11 GMT
DIRKRB-438 Build failure with maven-surefire-plugin error.


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

Branch: refs/heads/pkinit-support
Commit: 6006704d8d1daf508e2c799b800ccead899a2493
Parents: 8ee7c59
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Thu Oct 29 11:41:07 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Thu Oct 29 11:41:07 2015 +0800

----------------------------------------------------------------------
 kerby-kerb/kerb-server/pom.xml                  |  5 --
 .../kerb/server/preauth/token/TokenPreauth.java | 61 ++++++++++----------
 2 files changed, 29 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6006704d/kerby-kerb/kerb-server/pom.xml
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/pom.xml b/kerby-kerb/kerb-server/pom.xml
index 117cfb6..edb355c 100644
--- a/kerby-kerb/kerb-server/pom.xml
+++ b/kerby-kerb/kerb-server/pom.xml
@@ -47,10 +47,5 @@
       <artifactId>kerb-identity</artifactId>
       <version>${project.version}</version>
     </dependency>
-    <dependency>
-      <groupId>org.apache.kerby</groupId>
-      <artifactId>token-provider</artifactId>
-      <version>${project.version}</version>
-    </dependency>
   </dependencies>
 </project>

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6006704d/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/token/TokenPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/token/TokenPreauth.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/token/TokenPreauth.java
index 7316070..adabe9f 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/token/TokenPreauth.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/token/TokenPreauth.java
@@ -42,7 +42,6 @@ import org.apache.kerby.kerberos.kerb.spec.pa.PaDataEntry;
 import org.apache.kerby.kerberos.kerb.spec.pa.PaDataType;
 import org.apache.kerby.kerberos.kerb.spec.pa.token.PaTokenRequest;
 import org.apache.kerby.kerberos.kerb.spec.pa.token.TokenInfo;
-import org.apache.kerby.kerberos.provider.token.JwtTokenDecoder;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -88,7 +87,7 @@ public class TokenPreauth extends AbstractPreauthPlugin {
             AuthToken authToken = null;
             try {
                 authToken = tokenDecoder.decodeFromBytes(token.getTokenValue());
-                if (!((JwtTokenDecoder) tokenDecoder).isSigned()) {
+                if (!tokenDecoder.isSigned()) {
                     throw new KrbException("Token should be signed.");
                 }
             } catch (IOException e) {
@@ -118,40 +117,38 @@ public class TokenPreauth extends AbstractPreauthPlugin {
             return false;
         }
     }
-    
+
     private void configureKeys(TokenDecoder tokenDecoder, KdcRequest kdcRequest, String issuer)
{
-        if (tokenDecoder instanceof JwtTokenDecoder) {
-            String verifyKeyPath = kdcRequest.getKdcContext().getConfig().getVerifyKeyConfig();
-            if (verifyKeyPath != null) {
-                File verifyKeyFile = getKeyFile(verifyKeyPath, issuer);
-                if (verifyKeyFile != null) {
-                    PublicKey verifyKey = null;
-                    try {
-                        FileInputStream fis = new FileInputStream(verifyKeyFile);
-                        verifyKey = PublicKeyReader.loadPublicKey(fis);
-                    } catch (FileNotFoundException e) {
-                        e.printStackTrace();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    ((JwtTokenDecoder) tokenDecoder).setVerifyKey(verifyKey);
+        String verifyKeyPath = kdcRequest.getKdcContext().getConfig().getVerifyKeyConfig();
+        if (verifyKeyPath != null) {
+            File verifyKeyFile = getKeyFile(verifyKeyPath, issuer);
+            if (verifyKeyFile != null) {
+                PublicKey verifyKey = null;
+                try {
+                    FileInputStream fis = new FileInputStream(verifyKeyFile);
+                    verifyKey = PublicKeyReader.loadPublicKey(fis);
+                } catch (FileNotFoundException e) {
+                    e.printStackTrace();
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
+                tokenDecoder.setVerifyKey(verifyKey);
             }
-            String decryptionKeyPath = kdcRequest.getKdcContext().getConfig().getDecryptionKeyConfig();
-            if (decryptionKeyPath != null) {
-                File decryptionKeyFile = getKeyFile(decryptionKeyPath, issuer);
-                if (decryptionKeyFile != null) {
-                    PrivateKey decryptionKey = null;
-                    try {
-                        FileInputStream fis = new FileInputStream(decryptionKeyFile);
-                        decryptionKey = PrivateKeyReader.loadPrivateKey(fis);
-                    } catch (FileNotFoundException e) {
-                        e.printStackTrace();
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                    ((JwtTokenDecoder) tokenDecoder).setDecryptionKey(decryptionKey);
+        }
+        String decryptionKeyPath = kdcRequest.getKdcContext().getConfig().getDecryptionKeyConfig();
+        if (decryptionKeyPath != null) {
+            File decryptionKeyFile = getKeyFile(decryptionKeyPath, issuer);
+            if (decryptionKeyFile != null) {
+                PrivateKey decryptionKey = null;
+                try {
+                    FileInputStream fis = new FileInputStream(decryptionKeyFile);
+                    decryptionKey = PrivateKeyReader.loadPrivateKey(fis);
+                } catch (FileNotFoundException e) {
+                    e.printStackTrace();
+                } catch (Exception e) {
+                    e.printStackTrace();
                 }
+                tokenDecoder.setDecryptionKey(decryptionKey);
             }
         }
     }


Mime
View raw message