summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2016-01-11 15:13:42 -0800
committerKenny Root <kroot@google.com>2016-01-11 15:42:49 -0800
commit20cb4ffdb52c8e5594806ff11960ee4297b28a34 (patch)
tree15132b958bc9c4d8e0b3fd334e480dcc8f36818c
parentf11bf8a0ffd68f584a9413d295a408e57fe811e5 (diff)
downloadnist-pkits-20cb4ffdb52c8e5594806ff11960ee4297b28a34.tar.gz
Fix several tests that were worded incorrectly
The test description lists the CRL signing key and the CA signing key in the description's expected path, but it should only be the CA signing key in the path. This change fixes all the tests that had this ambiguity. Bug: 8030138 Change-Id: I4edd999d94a05d80a0a2e03e49d9a4025bd9bbfe
-rw-r--r--src/libcore/java/security/cert/X509CertificateNistPkitsTest.java77
1 files changed, 66 insertions, 11 deletions
diff --git a/src/libcore/java/security/cert/X509CertificateNistPkitsTest.java b/src/libcore/java/security/cert/X509CertificateNistPkitsTest.java
index b3562d3..d9a81c5 100644
--- a/src/libcore/java/security/cert/X509CertificateNistPkitsTest.java
+++ b/src/libcore/java/security/cert/X509CertificateNistPkitsTest.java
@@ -931,6 +931,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testBasicCertificateRevocationTests_ValidSeparateCertificateandCRLKeysTest19() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidSeparateCertificateandCRLKeysTest19EE.crt",
+ "SeparateCertificateandCRLKeysCertificateSigningCACert.crt",
+ };
+
String[] certs = {
"ValidSeparateCertificateandCRLKeysTest19EE.crt",
"SeparateCertificateandCRLKeysCRLSigningCert.crt",
@@ -942,13 +947,18 @@ public class X509CertificateNistPkitsTest extends TestCase {
"SeparateCertificateandCRLKeysCRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.4.20 */
public void testBasicCertificateRevocationTests_InvalidSeparateCertificateandCRLKeysTest20() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "InvalidSeparateCertificateandCRLKeysTest20EE.crt",
+ "SeparateCertificateandCRLKeysCertificateSigningCACert.crt",
+ };
+
String[] certs = {
"InvalidSeparateCertificateandCRLKeysTest20EE.crt",
"SeparateCertificateandCRLKeysCRLSigningCert.crt",
@@ -960,13 +970,18 @@ public class X509CertificateNistPkitsTest extends TestCase {
"SeparateCertificateandCRLKeysCRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertInvalidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.4.21 */
public void testBasicCertificateRevocationTests_InvalidSeparateCertificateandCRLKeysTest21() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "InvalidSeparateCertificateandCRLKeysTest21EE.crt",
+ "SeparateCertificateandCRLKeysCA2CertificateSigningCACert.crt",
+ };
+
String[] certs = {
"InvalidSeparateCertificateandCRLKeysTest21EE.crt",
"SeparateCertificateandCRLKeysCA2CRLSigningCert.crt",
@@ -978,7 +993,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"SeparateCertificateandCRLKeysCA2CRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertInvalidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.5.1 */
@@ -1040,6 +1055,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testVerifyingPathswithSelfIssuedCertificates_ValidBasicSelfIssuedNewWithOldTest4() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidBasicSelfIssuedNewWithOldTest4EE.crt",
+ "BasicSelfIssuedOldKeyCACert.crt",
+ };
+
String[] certs = {
"ValidBasicSelfIssuedNewWithOldTest4EE.crt",
"BasicSelfIssuedOldKeyNewWithOldCACert.crt",
@@ -1052,7 +1072,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"BasicSelfIssuedOldKeyCACRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.5.5 */
@@ -1078,6 +1098,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testVerifyingPathswithSelfIssuedCertificates_ValidBasicSelfIssuedCRLSigningKeyTest6() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidBasicSelfIssuedCRLSigningKeyTest6EE.crt",
+ "BasicSelfIssuedCRLSigningKeyCACert.crt",
+ };
+
String[] certs = {
"ValidBasicSelfIssuedCRLSigningKeyTest6EE.crt",
"BasicSelfIssuedCRLSigningKeyCRLCert.crt",
@@ -1090,7 +1115,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"BasicSelfIssuedCRLSigningKeyCACRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.5.7 */
@@ -2620,6 +2645,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testDistributionPoints_ValidIDPwithindirectCRLTest24() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidIDPwithindirectCRLTest24EE.crt",
+ "indirectCRLCA2Cert.crt",
+ };
+
String[] certs = {
"ValidIDPwithindirectCRLTest24EE.crt",
"indirectCRLCA1Cert.crt",
@@ -2631,13 +2661,18 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA1CRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.25 */
public void testDistributionPoints_ValidIDPwithindirectCRLTest25() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidIDPwithindirectCRLTest25EE.crt",
+ "indirectCRLCA2Cert.crt",
+ };
+
String[] certs = {
"ValidIDPwithindirectCRLTest25EE.crt",
"indirectCRLCA1Cert.crt",
@@ -2649,7 +2684,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA1CRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.26 */
@@ -2692,6 +2727,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testDistributionPoints_ValidcRLIssuerTest28() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidcRLIssuerTest28EE.crt",
+ "indirectCRLCA3Cert.crt",
+ };
+
String[] certs = {
"ValidcRLIssuerTest28EE.crt",
"indirectCRLCA3cRLIssuerCert.crt",
@@ -2704,13 +2744,18 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA3cRLIssuerCRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.29 */
public void testDistributionPoints_ValidcRLIssuerTest29() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidcRLIssuerTest29EE.crt",
+ "indirectCRLCA3Cert.crt",
+ };
+
String[] certs = {
"ValidcRLIssuerTest29EE.crt",
"indirectCRLCA3cRLIssuerCert.crt",
@@ -2723,13 +2768,18 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA3cRLIssuerCRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.30 */
public void testDistributionPoints_ValidcRLIssuerTest30() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidcRLIssuerTest30EE.crt",
+ "indirectCRLCA4Cert.crt",
+ };
+
String[] certs = {
"ValidcRLIssuerTest30EE.crt",
"indirectCRLCA4cRLIssuerCert.crt",
@@ -2741,7 +2791,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA4cRLIssuerCRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.31 */
@@ -2784,6 +2834,11 @@ public class X509CertificateNistPkitsTest extends TestCase {
public void testDistributionPoints_ValidcRLIssuerTest33() throws Exception {
String trustAnchor = "TrustAnchorRootCertificate.crt";
+ String[] path = {
+ "ValidcRLIssuerTest33EE.crt",
+ "indirectCRLCA6Cert.crt",
+ };
+
String[] certs = {
"ValidcRLIssuerTest33EE.crt",
"indirectCRLCA6Cert.crt",
@@ -2795,7 +2850,7 @@ public class X509CertificateNistPkitsTest extends TestCase {
"indirectCRLCA5CRL.crl",
};
- assertValidPath(trustAnchor, certs, crls);
+ assertValidPath(trustAnchor, path, certs, crls);
}
/** NIST PKITS test 4.14.34 */