directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject directory-kerby git commit: Fix compile error.
Date Mon, 30 Nov 2015 03:42:13 GMT
Repository: directory-kerby
Updated Branches:
  refs/heads/pkinit-support 9fe0fd885 -> 7a9723943


Fix compile 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/7a972394
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/7a972394
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/7a972394

Branch: refs/heads/pkinit-support
Commit: 7a97239435c26e7e87f34975add0f7f0a34b38d8
Parents: 9fe0fd8
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Mon Nov 30 11:48:26 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Mon Nov 30 11:48:26 2015 +0800

----------------------------------------------------------------------
 .../client/preauth/pkinit/PkinitPreauth.java    |  2 +-
 .../kerb/client/request/KdcRequest.java         |  1 +
 .../kerb/preauth/pkinit/PkinitCrypto.java       |  2 +-
 .../kerb/type/pa/pkinit/DHParameter.java        | 51 --------------------
 .../server/preauth/pkinit/PkinitPreauth.java    |  6 +--
 .../kerby/x509/type/AlgorithmIdentifier.java    | 11 +++--
 .../org/apache/kerby/x509/type/DHParameter.java | 51 ++++++++++++++++++++
 7 files changed, 63 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
index 23954b0..0394888 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/preauth/pkinit/PkinitPreauth.java
@@ -46,11 +46,11 @@ import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack;
-import org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHParameter;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PkAuthenticator;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.TrustedCertifiers;
 import org.apache.kerby.x509.type.AlgorithmIdentifier;
+import org.apache.kerby.x509.type.DHParameter;
 import org.apache.kerby.x509.type.SubjectPublicKeyInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
index 2795cbb..0805ca8 100644
--- a/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
+++ b/kerby-kerb/kerb-client/src/main/java/org/apache/kerby/kerberos/kerb/client/request/KdcRequest.java
@@ -29,6 +29,7 @@ import org.apache.kerby.kerberos.kerb.client.preauth.PreauthContext;
 import org.apache.kerby.kerberos.kerb.client.preauth.PreauthHandler;
 import org.apache.kerby.kerberos.kerb.common.EncryptionUtil;
 import org.apache.kerby.kerberos.kerb.crypto.EncryptionHandler;
+import org.apache.kerby.kerberos.kerb.crypto.dh.DhClient;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/PkinitCrypto.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/PkinitCrypto.java
b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/PkinitCrypto.java
index 5826366..2ecc1dc 100644
--- a/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/PkinitCrypto.java
+++ b/kerby-kerb/kerb-common/src/main/java/org/apache/kerby/kerberos/kerb/preauth/pkinit/PkinitCrypto.java
@@ -20,7 +20,7 @@ package org.apache.kerby.kerberos.kerb.preauth.pkinit;
 
 import org.apache.kerby.kerberos.kerb.KrbErrorCode;
 import org.apache.kerby.kerberos.kerb.KrbException;
-import org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHParameter;
+import org.apache.kerby.x509.type.DHParameter;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import sun.security.pkcs.ContentInfo;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHParameter.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHParameter.java
b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHParameter.java
deleted file mode 100644
index 0716fda..0000000
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/pa/pkinit/DHParameter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.kerby.kerberos.kerb.type.pa.pkinit;
-
-import org.apache.kerby.asn1.Asn1FieldInfo;
-import org.apache.kerby.asn1.type.Asn1Integer;
-import org.apache.kerby.asn1.type.Asn1SequenceType;
-
-import java.math.BigInteger;
-
-public class DHParameter extends Asn1SequenceType {
-
-    private static final int P = 0;
-    private static final int G = 1;
-    private static final int Q = 2;
-
-    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new Asn1FieldInfo(P, Asn1Integer.class),
-            new Asn1FieldInfo(G, Asn1Integer.class),
-            new Asn1FieldInfo(Q, Asn1Integer.class),
-    };
-
-    public DHParameter() {
-        super(fieldInfos);
-    }
-
-    public void setP(BigInteger p) {
-        setFieldAsBigInteger(P, p);
-    }
-
-    public BigInteger getP() {
-        Asn1Integer p = getFieldAs(P, Asn1Integer.class);
-        return p.getValue();
-    }
-
-    public void setG(BigInteger g) {
-        setFieldAsBigInteger(G, g);
-    }
-
-    public BigInteger getG() {
-        Asn1Integer g = getFieldAs(G, Asn1Integer.class);
-        return g.getValue();
-    }
-
-    public void setQ(BigInteger q) {
-        setFieldAsBigInteger(Q, q);
-    }
-
-    public BigInteger getQ() {
-        Asn1Integer q = getFieldAs(Q, Asn1Integer.class);
-        return q.getValue();
-    }
-}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
index 0869476..5f20851 100644
--- a/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
+++ b/kerby-kerb/kerb-server/src/main/java/org/apache/kerby/kerberos/kerb/server/preauth/pkinit/PkinitPreauth.java
@@ -44,12 +44,12 @@ import org.apache.kerby.kerberos.kerb.type.kdc.KdcOption;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataEntry;
 import org.apache.kerby.kerberos.kerb.type.pa.PaDataType;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.AuthPack;
-import org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHParameter;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.DHRepInfo;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.KdcDHKeyInfo;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsRep;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PaPkAsReq;
 import org.apache.kerby.kerberos.kerb.type.pa.pkinit.PkAuthenticator;
+import org.apache.kerby.x509.type.DHParameter;
 import org.apache.kerby.x509.type.SubjectPublicKeyInfo;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -165,7 +165,7 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
             DHParameter dhParameter = null;
             if (authPack.getClientPublicValue() != null) {
                 //TODO
-                dhParameter = (DHParameter) authPack.getClientPublicValue().getAlgorithm().getParameters();
+                dhParameter = authPack.getClientPublicValue().getAlgorithm().getParameters();
                 PkinitCrypto.serverCheckDH(pkinitContext.pluginOpts, pkinitContext.cryptoctx,
dhParameter);
             } else if (!isSigned) {
                 /*Anonymous pkinit requires DH*/
@@ -183,8 +183,6 @@ public class PkinitPreauth extends AbstractPreauthPlugin {
             } catch (KrbException e) {
                 LOG.error("Unable to calculate AS REQ checksum.", e.getMessage());
             }
-
-
             CheckSum receivedCheckSum = KrbCodec.decode(pkAuthenticator.getPaChecksum(),
CheckSum.class);
 
             if(!CheckSumHandler.verify(receivedCheckSum, kdcRequest.getReqBodyBytes())) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
index 8fd4db2..2956e7e 100644
--- a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/AlgorithmIdentifier.java
@@ -19,7 +19,6 @@
  */
 package org.apache.kerby.x509.type;
 
-import org.apache.kerby.asn1.type.Asn1Any;
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.type.Asn1ObjectIdentifier;
 import org.apache.kerby.asn1.type.Asn1SequenceType;
@@ -37,7 +36,7 @@ public class AlgorithmIdentifier extends Asn1SequenceType {
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
             new Asn1FieldInfo(ALGORITHM, Asn1ObjectIdentifier.class),
-            new Asn1FieldInfo(PARAMETERS, Asn1Any.class)
+            new Asn1FieldInfo(PARAMETERS, DHParameter.class)
     };
 
     public AlgorithmIdentifier() {
@@ -56,7 +55,11 @@ public class AlgorithmIdentifier extends Asn1SequenceType {
         return getFieldAsAny(PARAMETERS, t);
     }
 
-    public void setParameters(Asn1Type parameters) {
-        setFieldAsAny(PARAMETERS, parameters);
+    public DHParameter getParameters() {
+        return getFieldAs(PARAMETERS, DHParameter.class);
+    }
+
+    public void setParameters(DHParameter parameters) {
+        setFieldAs(PARAMETERS, parameters);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/7a972394/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DHParameter.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DHParameter.java b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DHParameter.java
new file mode 100644
index 0000000..f66cb70
--- /dev/null
+++ b/kerby-pkix/src/main/java/org/apache/kerby/x509/type/DHParameter.java
@@ -0,0 +1,51 @@
+package org.apache.kerby.x509.type;
+
+import org.apache.kerby.asn1.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1SequenceType;
+
+import java.math.BigInteger;
+
+public class DHParameter extends Asn1SequenceType {
+
+    private static final int P = 0;
+    private static final int G = 1;
+    private static final int Q = 2;
+
+    static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
+            new Asn1FieldInfo(P, Asn1Integer.class),
+            new Asn1FieldInfo(G, Asn1Integer.class),
+            new Asn1FieldInfo(Q, Asn1Integer.class),
+    };
+
+    public DHParameter() {
+        super(fieldInfos);
+    }
+
+    public void setP(BigInteger p) {
+        setFieldAsBigInteger(P, p);
+    }
+
+    public BigInteger getP() {
+        Asn1Integer p = getFieldAs(P, Asn1Integer.class);
+        return p.getValue();
+    }
+
+    public void setG(BigInteger g) {
+        setFieldAsBigInteger(G, g);
+    }
+
+    public BigInteger getG() {
+        Asn1Integer g = getFieldAs(G, Asn1Integer.class);
+        return g.getValue();
+    }
+
+    public void setQ(BigInteger q) {
+        setFieldAsBigInteger(Q, q);
+    }
+
+    public BigInteger getQ() {
+        Asn1Integer q = getFieldAs(Q, Asn1Integer.class);
+        return q.getValue();
+    }
+}


Mime
View raw message