directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [3/5] directory-kerby git commit: Add tests to decode mit pkinit anonymous AsReq and AsRep.
Date Thu, 10 Dec 2015 08:10:02 GMT
Add tests to decode mit pkinit anonymous AsReq and AsRep.


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

Branch: refs/heads/pkinit-support
Commit: 35f89244bfe0f4a87e7cd8c4184fefbb5bb1d9de
Parents: 5f32419
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Thu Dec 10 15:42:19 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Thu Dec 10 15:42:19 2015 +0800

----------------------------------------------------------------------
 .../kerberos/kerb/codec/CodecTestUtil.java      |   9 ++
 .../kerberos/kerb/codec/TestAsReqCodec.java     |   2 +-
 .../codec/TestPkinitAnonymousAsRepCodec.java    |  89 +++++++++++++++
 .../codec/TestPkinitAnonymousAsReqCodec.java    | 107 +++++++++++++++++++
 .../test/resources/pkinit_anonymous_asrep.token |   1 +
 .../test/resources/pkinit_anonymous_asreq.token |   1 +
 .../org/apache/kerby/cms/TestSignedData.java    |  19 ++++
 kerby-pkix/src/test/resources/anonymous.txt     |  20 ++++
 8 files changed, 247 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/CodecTestUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/CodecTestUtil.java
b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/CodecTestUtil.java
index e2fb3cf..3f78570 100644
--- a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/CodecTestUtil.java
+++ b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/CodecTestUtil.java
@@ -19,6 +19,9 @@
  */
 package org.apache.kerby.kerberos.kerb.codec;
 
+import org.apache.kerby.asn1.util.HexUtil;
+import org.apache.kerby.asn1.util.IOUtil;
+
 import java.io.IOException;
 import java.io.InputStream;
 
@@ -30,4 +33,10 @@ public class CodecTestUtil {
         is.read(bytes);
         return bytes;
     }
+
+    static byte[] readDataFile(String resource) throws IOException {
+        InputStream is = CodecTestUtil.class.getResourceAsStream(resource);
+        String hexStr = IOUtil.readInput(is);
+        return HexUtil.hex2bytes(hexStr);
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestAsReqCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestAsReqCodec.java
b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestAsReqCodec.java
index b8599a7..30fe74c 100644
--- a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestAsReqCodec.java
+++ b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestAsReqCodec.java
@@ -54,7 +54,7 @@ public class TestAsReqCodec {
     @Test
     public void test() throws IOException, ParseException {
         byte[] bytes = CodecTestUtil.readBinaryFile("/asreq.token");
-        Asn1.dump(bytes);
+        Asn1.dump(bytes, false);
         ByteBuffer asReqToken = ByteBuffer.wrap(bytes);
 
         AsReq asReq = new AsReq();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
new file mode 100644
index 0000000..448b44d
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsRepCodec.java
@@ -0,0 +1,89 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.kerberos.kerb.codec;
+
+import org.apache.kerby.asn1.Asn1;
+import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsRep;
+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.PaPkAsRep;
+import org.apache.kerby.kerberos.kerb.type.ticket.Ticket;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitAnonymousAsRepCodec {
+    @Test
+    public void test() throws IOException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_anonymous_asrep.token");
+        Asn1.dump(bytes, true);
+        ByteBuffer asRepToken = ByteBuffer.wrap(bytes);
+
+        AsRep asRep = new AsRep();
+        asRep.decode(asRepToken);
+        Asn1.dump(asRep, false);
+
+        assertThat(asRep.getPvno()).isEqualTo(5);
+        assertThat(asRep.getMsgType()).isEqualTo(KrbMessageType.AS_REP);
+        PaData paData = asRep.getPaData();
+
+        PaDataEntry pkAsRepEntry = paData.findEntry(PaDataType.PK_AS_REP);
+        assertThat(pkAsRepEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REP);
+
+        PaPkAsRep paPkAsRep = new PaPkAsRep();
+        paPkAsRep.decode(pkAsRepEntry.getPaDataValue());
+        //Failed
+//        assertThat(paPkAsRep.getDHRepInfo()).isNotNull();
+
+        PaDataEntry etypeInfo2Entry = paData.findEntry(PaDataType.ETYPE_INFO2);
+        assertThat(etypeInfo2Entry.getPaDataType()).isEqualTo(PaDataType.ETYPE_INFO2);
+
+        PaDataEntry pkinitKxEntry = paData.findEntry(PaDataType.PKINIT_KX);
+        assertThat(pkinitKxEntry.getPaDataType()).isEqualTo(PaDataType.PKINIT_KX);
+
+        assertThat(asRep.getPvno()).isEqualTo(5);
+        assertThat(asRep.getMsgType()).isEqualTo(KrbMessageType.AS_REP);
+        assertThat(asRep.getCrealm()).isEqualTo("WELLKNOWN:ANONYMOUS");
+
+        PrincipalName cName = asRep.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_UNKNOWN);
+        assertThat(cName.getNameStrings()).hasSize(2).contains("WELLKNOWN", "ANONYMOUS");
+
+        Ticket ticket = asRep.getTicket();
+        assertThat(ticket.getTktvno()).isEqualTo(5);
+        assertThat(ticket.getRealm()).isEqualTo("EXAMPLE.COM");
+        PrincipalName sName = ticket.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_INST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("krbtgt", "EXAMPLE.COM");
+
+        EncryptedData encryptedData = ticket.getEncryptedEncPart();
+        assertThat(encryptedData.getKvno()).isEqualTo(1);
+        assertThat(encryptedData.getEType().getValue()).isEqualTo(0x0012);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
new file mode 100644
index 0000000..e9965cf
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/test/java/org/apache/kerby/kerberos/kerb/codec/TestPkinitAnonymousAsReqCodec.java
@@ -0,0 +1,107 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ *
+ */
+package org.apache.kerby.kerberos.kerb.codec;
+
+import org.apache.kerby.asn1.Asn1;
+import org.apache.kerby.cms.type.ContentInfo;
+import org.apache.kerby.kerberos.kerb.type.base.EncryptionType;
+import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
+import org.apache.kerby.kerberos.kerb.type.base.NameType;
+import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
+import org.apache.kerby.kerberos.kerb.type.kdc.AsReq;
+import org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody;
+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.PaPkAsReq;
+import org.junit.Test;
+
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.text.ParseException;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TestPkinitAnonymousAsReqCodec {
+    @Test
+    public void test() throws IOException, ParseException {
+        byte[] bytes = CodecTestUtil.readDataFile("/pkinit_anonymous_asreq.token");
+//        Asn1.dump(bytes, true);
+        ByteBuffer asReqToken = ByteBuffer.wrap(bytes);
+
+        AsReq asReq = new AsReq();
+        asReq.decode(asReqToken);
+//        Asn1.dump(asReq, false);
+
+        assertThat(asReq.getPvno()).isEqualTo(5);
+        assertThat(asReq.getMsgType()).isEqualTo(KrbMessageType.AS_REQ);
+
+        PaData paData = asReq.getPaData();
+
+        PaDataEntry paFxCookieEntry = paData.findEntry(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataType()).isEqualTo(PaDataType.FX_COOKIE);
+        assertThat(paFxCookieEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes,
38, 41));
+
+        PaDataEntry pkAsReqEntry = paData.findEntry(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataType()).isEqualTo(PaDataType.PK_AS_REQ);
+        assertThat(pkAsReqEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 58,
1366));
+
+        PaPkAsReq paPkAsReq = new PaPkAsReq();
+        paPkAsReq.decode(pkAsReqEntry.getPaDataValue());
+        ContentInfo contentInfo = new ContentInfo();
+        Asn1.dump(paPkAsReq.getSignedAuthPack(), true);
+        contentInfo.decode(paPkAsReq.getSignedAuthPack());
+        assertThat(contentInfo.getContentType().getValue()).isEqualTo("1.2.840.113549.1.7.2");
+        Asn1.dump(contentInfo);
+        //Failed
+//        SignedData signedData = contentInfo.getContentAs(SignedData.class);
+//        assertThat(signedData.getCertificates()).isNull();
+//        assertThat(signedData.getEncapContentInfo().getContentType()).isEqualTo("1.3.6.1.5.2.3.1");
+
+        PaDataEntry encpaEntry = paData.findEntry(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataType()).isEqualTo(PaDataType.ENCPADATA_REQ_ENC_PA_REP);
+        assertThat(encpaEntry.getPaDataValue()).isEqualTo(Arrays.copyOfRange(bytes, 1376,
1376));
+
+        KdcReqBody body = asReq.getReqBody();
+        assertThat(body.getKdcOptions().getPadding()).isEqualTo(0);
+        assertThat(body.getKdcOptions().getValue()).isEqualTo(Arrays.copyOfRange(bytes, 1389,
1393));
+        PrincipalName cName = body.getCname();
+        assertThat(cName.getNameType()).isEqualTo(NameType.NT_UNKNOWN);
+        assertThat(cName.getName()).isEqualTo("WELLKNOWN/ANONYMOUS");
+        assertThat(body.getRealm()).isEqualTo("EXAMPLE.COM");
+        PrincipalName sName = body.getSname();
+        assertThat(sName.getNameType()).isEqualTo(NameType.NT_SRV_INST);
+        assertThat(sName.getNameStrings()).hasSize(2)
+                .contains("krbtgt", "EXAMPLE.COM");
+
+        assertThat(body.getNonce()).isEqualTo(1797404543);
+
+        List<EncryptionType> types = body.getEtypes();
+        assertThat(types).hasSize(6);
+        assertThat(types.get(0).getValue()).isEqualTo(0x0012);
+        assertThat(types.get(1).getValue()).isEqualTo(0x0011);
+        assertThat(types.get(2).getValue()).isEqualTo(0x0010);
+        assertThat(types.get(3).getValue()).isEqualTo(0x0017);
+        assertThat(types.get(4).getValue()).isEqualTo(0x0019);
+        assertThat(types.get(5).getValue()).isEqualTo(0x001A);
+    }
+}

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asrep.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asrep.token b/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asrep.token
new file mode 100644
index 0000000..91eba94
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asrep.token
@@ -0,0 +1 @@
+6b820adb30820ad7a003020105a10302010ba282085530820851308207baa103020111a28207b1048207ada08207a9308207a5808207913082078d06092a864886f70d010702a082077e3082077a020103310b300906052b0e03021a05003082012a06072b060105020302a082011d0482011930820115a08201090382010500028201000cdc45eedbf7daa0bc998f34b68f102a6fb1eaa4f7e6938cba8a27e9b78c9423f090a6f99f9ab892ad8bb48cb192bd7155b83444aaa0e2f07398bd118b73955bb80739b35c5da1b3dc9b1f75d168f9b37b0550734c63f874f2ffe7361944e17b55929601fdfd1d12aa32d740e5183167df3d1ad2558c80c277a3f8d4f9c5014557a588a75081c1a95070f3de737693ed5b7373fbb6916a9439a4d8636963a136bf3fd732b61426fd7161b19c12129e676743c4c60262d479e1a7bb79744cec7bdbe6a8741fbc665e45bb1771ad1fe8c6c35a1214c880b8217015ababddd5c6da157b085869b17a0f9cd449471d0763bd530ed4deab4d5c07219ca759888095c3a10602046b22377fa08204443082044030820328a003020102020900957b3b7d599fdde1300d06092a864886f70d0101050500307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e3
 00c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d301e170d3135303931353032313935395a170d3136303931343032313935395a307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d30820122300d06092a864886f70d01010105000382010f003082010a0282010100b490346b97ea3dbfa85d596c94b404fbacaf3b8a0f25aaddf1799008f4def1c231bdc7d6e927d29679ff8894fd7bc9912cec6d863ba32522cd9283eeb89e3fb6150d1a7d0d622e7c77b18f33a0b2569c0124cd82acc794d3a139a3037d2cf07a9decd5d27dfe2e10d52b7c80d14b5b859bb423644c1a9e97eaff6ab16a7bd157bcc24d6cf39f5f14135fa0051d47f8e3351c7dd9d5008eb074d2767e0ae7a7f58f20fb43b2c38036594c4a60aa720d5cc3d89395fe58a9ff5fcfe85fd009bc2e59c7a080eedd883ce5c151f698836cbbb9f3b8c8bad45fdcf0390ddbc9e45ddbe6cbe75c501287dbb9744f09bea7a638ef
 c03d74b25933bc0f39744423f9f2610203010001a381c43081c130090603551d1304023000300b0603551d0f0404030203e830120603551d25040b300906072b060105020305301d0603551d0e041604141f9467fe30efc615c9aa4e81097e11436ca4df09301f0603551d23041830168014423d560a460d97a08abad00436f8a4d42661d7b030090603551d120402300030480603551d110441303fa03d06062b0601050202a0333031a00d1b0b4558414d504c452e434f4da120301ea003020101a11730151b066b72627467741b0b4558414d504c452e434f4d300d06092a864886f70d010105050003820101008ef86de60f1eb04f4b611beec70bcd10294144a2e4616d7f1fc0246cd0a160f862078ced3ef41eaefb4c41a20028afa43d47c3cdaef9e3fd8b3984fb5c5092d39b6254335e55f27b2c170878415c3624c45c71297980b1d179393016209d1f338de31fc1333fd2d1d5e4556dde24a509ec46d90215ff9625302ac6dd1073be73a40f526d0153df2d9fa8fd040974b5d95344300c0b8d0c18ea27090b34a381c615e1886f02d8c714b43b4a28eb5bcc147633772cdd99bca2c601929e6672199cb250f6e863503eed53c231dbf0c417ab777044bd2ded683a3ad9946f5eb99299c2ad6e59b5164c4bcba0368a5ce16c9ff7e550dade9866bd557bdd01c71f9823318201f
 0308201ec020101308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d020900957b3b7d599fdde1300906052b0e03021a0500a03d301606092a864886f70d010903310906072b060105020302302306092a864886f70d010904311604147ba5ddc6130b5e088e9b225e90ce6996f48d8878300d06092a864886f70d0101050500048201009e1651dd0bb1b37baa7bf9c2629e161974c08a12687bf3670edc0eb43a9ecd140ae2caf4b95f71a55cf5a393ee73c6313d10e1542519cc6c6a054e63dc3bebe4584f068020ff9cb4c63d7dcd02c3e9a740b05886d0bab669b2e0611319d75f4b889ac6b306ad8694dbdc47963efa8a2c8dc775e4b060980f9bd68714aa2bde1760ecd1d40fd79f9e9ebe619918b5db7f669eac35923bd27df1d3fc69d5e496c12d53d53a4f28dd5e40517ccb02c449ba793bfd6d97fb1b0011d48c8ce555a72bc63b4ab04c5e65d09010c526f9167dba6c516f9bd1850f257ffbaaf4f4b36b14186424a7c5a537d8630dea9e5fff73cf56c8443e17bf248339525e6ec7a1890fa20e
 300ca00a06082b060105020306023033a103020113a22c042a30283026a003020112a11f1b1d4558414d504c452e434f4d57454c4c4b4e4f574e414e4f4e594d4f5553305ca10402020093a25404523050a003020112a249044716e179a3dcd5469db874d6368831355831c7e114ce594c1fd02967f0283521138719aa671409d9789d9b885c89332eb5062f95e4b7578d3d31251ff3ef4c64524a8ba7457726a2a3151b1357454c4c4b4e4f574e3a414e4f4e594d4f5553a421301fa00302010ba11830161b0957454c4c4b4e4f574e1b09414e4f4e594d4f5553a58201196182011530820111a003020105a10d1b0b4558414d504c452e434f4da220301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da381d83081d5a003020112a103020101a281c80481c5ce3b2d0bb66f8d9cd0b2c50a2c34885e718a821f78d7cc8b0e951f12115b723acf4388e3c4416a53eb5d380d08a0ca7af47d1946cecd586db4881ef62c8cfa9b1152dc9e4a28d9bb65994d58ad6acbc56f403d0092a82758855ba9d6e881cabf74ff0952fc897962186c786fb60baf75459590cce9e9b807d164f5054446ee88b3a7cce307cf5eccce040e478d291fb23f7de11c8c781217561eadf3635283271146cafa0042a90affe3ff9bc70cb824273a53bef7eb1e10dcb807440fbc054
 e815effa526a682011930820115a003020112a282010c048201084f01264b02e309704682ec1c44c550ff0a097d892e5802fbd4899215bc60be074373bf53e820a3fab5e755dae7ac938ff6b4866e3fb869913b910ff3a1b8238105b26c592a470291d864bd2780a4c91d706464f4560e0abd1998c1fa1c22e2bb35f80764ab3b39a3b273ed05f4d069722e66d0415d5e56c9acd82e2226ab7efb85ea53aa9f4f40aa057780a003e926a3d0c824165005ebbb4ce2bb9c4cf3c6e07e8b9eef74bfa7d41d445fc563e9d9ef8c3574cb804eae3d7de534b616ca4854e5919322bbd71dfb71f125f626c99aca05e1f95126b1ec8b8c5b50ca8874cf1524e682966eebfc5264e3a03086b64ac5dc66a3484265843f2336b0ca5d0c8abca96abe6fcd15a51c
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asreq.token
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asreq.token b/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asreq.token
new file mode 100644
index 0000000..5144f1e
--- /dev/null
+++ b/kerby-kerb/kerb-core/src/main/test/resources/pkinit_anonymous_asreq.token
@@ -0,0 +1 @@
+6a8205f2308205eea103020105a20302010aa382054c30820548300da10402020085a20504034d495430820529a103020110a28205200482051c30820518808203e1308203dd06092a864886f70d010702a08203ce308203ca0201033100308203bf06072b060105020301a08203b2048203ae308203aaa03c303aa005020306c39ca111180f32303135313231303032353031355aa20602046b22377fa3160414e592c909d320dd4ce1ccaa4708e8bc73d48d03bfa182032a308203263082021906072a8648ce3e02013082020c0282010100ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff020102028201007fffffffffffffffe487ed5110b4611a62633145c06e0e689
 48127044533e63a0105df531d89cd9128a5043cc71a026ef7ca8cd9e69d218d98158536f92f8a1ba7f09ab6b6a8e122f242dabb312f3f637a262174d31bf6b585ffae5b7a035bf6f71c35fdad44cfd2d74f9208be258ff324943328f6722d9ee1003e5c50b1df82cc6d241b0e2ae9cd348b1fd47e9267afc1b2ae91ee51d6cb0e3179ab1042a95dcf6a9483b84b4b36b3861aa7255e4c0278ba3604650c10be19482f23171b671df1cf3b960c074301cd93c1d17603d147dae2aef837a62964ef15e5fb4aac0b8c1ccaa4be754ab5728ae9130c4c7d02880ab9472d455655347fffffffffffffff0382010500028201006c3c8337692b63f663ab2d953c5adce3dbc840339a426408761c1bced206e84c9898b2d44f35a2f0d8604752b1530580dfeb3d7649d9736ca12dcab7dafa34a8c1c143a20ff7f9103b3fdedc6208e39330bf0c3fa6be6c3a6821270d194d9f27a80f0b8e4d6f59a75a0e384a588cfbecf75ac294d85ab8966ba26f49562c56f57c450cd1eacad30f5994dac89ab11d3229e9d1d6aaa4e80aead122115aa2a737dc82a70a99e6f50892135d5d50442b88243c564b6c5b7975def3dbc7c541e4c83b55aee3b44a989cb577b6c7d3b583463d026eb8aad908bfc8d9e4186ac7a7ba17d4c9c591e035fd9ab1325bb21544bb63f18bb499c8af244cc92ee4497533b1a20e
 300c300a06082a864886f70d0307a42c302a300ca00a06082b06010502030602300ca00a06082b06010502030601300ca00a06082b060105020306033100a182012f3082012b30820127807e307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d81818c308189307c310b300906035504061302434e310b300906035504080c025348310b300906035504070c025348310e300c060355040a0c05494e54454c310e300c060355040b0c05494e54454c310f300d06035504030c064a49414a49413122302006092a864886f70d01090116134a49414a49412e4c4940494e54454c2e434f4d0209009f561dd97cee1bf982160414423d560a460d97a08abad00436f8a4d42661d7b0300aa10402020095a2020400a4819130818ea00703050000008010a121301fa00302010ba11830161b0957454c4c4b4e4f574e1b09414e4f4e594d4f5553a20d1b0b4558414d504c452e434f4da320301ea003020102a11730151b066b72627467741b0b4558414d504c452e434f4da511180f32303135313231313032353031355
 aa70602046b22377fa814301202011202011102011002011702011902011a
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-pkix/src/test/java/org/apache/kerby/cms/TestSignedData.java
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/test/java/org/apache/kerby/cms/TestSignedData.java b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestSignedData.java
index bd2cef1..edf56ce 100644
--- a/kerby-pkix/src/test/java/org/apache/kerby/cms/TestSignedData.java
+++ b/kerby-pkix/src/test/java/org/apache/kerby/cms/TestSignedData.java
@@ -75,4 +75,23 @@ public class TestSignedData extends CmsTestBase {
                 decodedContentInfo.getContentAs(SignedData.class);
         Asn1.dump(decodedSignedData);
     }
+
+    @Test
+    public void testContentInfo() throws IOException {
+        byte[] data = readDataFile("/anonymous.txt");
+        try {
+            Asn1.dump(data, true);
+
+            ContentInfo contentInfo = new ContentInfo();
+            contentInfo.decode(data);
+            Asn1.dump(contentInfo);
+/** Failed in DigestAlgorithmIdentifiers*/
+//            SignedData signedData =
+//                    contentInfo.getContentAs(SignedData.class);
+//            Asn1.dump(signedData);
+        } catch (Exception e) {
+            e.printStackTrace();
+            Assert.fail();
+        }
+    }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/35f89244/kerby-pkix/src/test/resources/anonymous.txt
----------------------------------------------------------------------
diff --git a/kerby-pkix/src/test/resources/anonymous.txt b/kerby-pkix/src/test/resources/anonymous.txt
new file mode 100644
index 0000000..017a748
--- /dev/null
+++ b/kerby-pkix/src/test/resources/anonymous.txt
@@ -0,0 +1,20 @@
+308203DD06092A864886F70D010702A08203CE308203CA0201033100308203BF06072B060105020301A08203B2048203AE30
+8203AAA03C303AA005020306C39CA111180F32303135313231303032353031355AA20602046B22377FA3160414E592C909D3
+20DD4CE1CCAA4708E8BC73D48D03BFA182032A308203263082021906072A8648CE3E02013082020C0282010100FFFFFFFFFF
+FFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A43
+1B302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE
+9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F3
+56208552BB9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3BE39E772C180E86039B2783A2EC
+07A28FB5C55DF06F4C52C9DE2BCBF6955817183995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFF
+FF020102028201007FFFFFFFFFFFFFFFE487ED5110B4611A62633145C06E0E68948127044533E63A0105DF531D89CD9128A5
+043CC71A026EF7CA8CD9E69D218D98158536F92F8A1BA7F09AB6B6A8E122F242DABB312F3F637A262174D31BF6B585FFAE5B
+7A035BF6F71C35FDAD44CFD2D74F9208BE258FF324943328F6722D9EE1003E5C50B1DF82CC6D241B0E2AE9CD348B1FD47E92
+67AFC1B2AE91EE51D6CB0E3179AB1042A95DCF6A9483B84B4B36B3861AA7255E4C0278BA3604650C10BE19482F23171B671D
+F1CF3B960C074301CD93C1D17603D147DAE2AEF837A62964EF15E5FB4AAC0B8C1CCAA4BE754AB5728AE9130C4C7D02880AB9
+472D455655347FFFFFFFFFFFFFFF0382010500028201006C3C8337692B63F663AB2D953C5ADCE3DBC840339A426408761C1B
+CED206E84C9898B2D44F35A2F0D8604752B1530580DFEB3D7649D9736CA12DCAB7DAFA34A8C1C143A20FF7F9103B3FDEDC62
+08E39330BF0C3FA6BE6C3A6821270D194D9F27A80F0B8E4D6F59A75A0E384A588CFBECF75AC294D85AB8966BA26F49562C56
+F57C450CD1EACAD30F5994DAC89AB11D3229E9D1D6AAA4E80AEAD122115AA2A737DC82A70A99E6F50892135D5D50442B8824
+3C564B6C5B7975DEF3DBC7C541E4C83B55AEE3B44A989CB577B6C7D3B583463D026EB8AAD908BFC8D9E4186AC7A7BA17D4C9
+C591E035FD9AB1325BB21544BB63F18BB499C8AF244CC92EE4497533B1A20E300C300A06082A864886F70D0307A42C302A30
+0CA00A06082B06010502030602300CA00A06082B06010502030601300CA00A06082B060105020306033100
\ No newline at end of file


Mime
View raw message