summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/certs/Makefile.am2
-rw-r--r--build/certs/redhat-newca.derbin0 -> 948 bytes
-rw-r--r--trust/tests/files/distrusted.pem23
-rw-r--r--trust/tests/test-parser.c15
4 files changed, 40 insertions, 0 deletions
diff --git a/build/certs/Makefile.am b/build/certs/Makefile.am
index f8ec1c2..a1a7017 100644
--- a/build/certs/Makefile.am
+++ b/build/certs/Makefile.am
@@ -14,6 +14,8 @@ prepare-certs:
-setalias "Custom Label"
cp -v cacert-ca.der $(TRUST)/certificates
cp -v cacert-ca.der $(TRUST)/files
+ openssl x509 -in redhat-newca.der -inform DER -out $(TRUST)/files/distrusted.pem \
+ -addreject clientAuth -setalias "Red Hat Is the CA"
cp -v self-server.der $(TRUST)/files
cp -v self-signed-with-eku.der $(TRUST)/certificates
cp -v self-signed-with-ku.der $(TRUST)/certificates
diff --git a/build/certs/redhat-newca.der b/build/certs/redhat-newca.der
new file mode 100644
index 0000000..affae24
--- /dev/null
+++ b/build/certs/redhat-newca.der
Binary files differ
diff --git a/trust/tests/files/distrusted.pem b/trust/tests/files/distrusted.pem
new file mode 100644
index 0000000..8de6ff0
--- /dev/null
+++ b/trust/tests/files/distrusted.pem
@@ -0,0 +1,23 @@
+-----BEGIN TRUSTED CERTIFICATE-----
+MIIDsDCCAxmgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCVVMx
+FzAVBgNVBAgTDk5vcnRoIENhcm9saW5hMRAwDgYDVQQHEwdSYWxlaWdoMRYwFAYD
+VQQKEw1SZWQgSGF0LCBJbmMuMQswCQYDVQQLEwJJUzEWMBQGA1UEAxMNUmVkIEhh
+dCBJUyBDQTEmMCQGCSqGSIb3DQEJARYXc3lzYWRtaW4tcmR1QHJlZGhhdC5jb20w
+HhcNMDkwOTE2MTg0NTI1WhcNMTkwOTE0MTg0NTI1WjCBnTELMAkGA1UEBhMCVVMx
+FzAVBgNVBAgTDk5vcnRoIENhcm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
--- a/trust/tests/test-parser.c
+++ b/trust/tests/test-parser.c
@@ -183,6 +183,20 @@ test_parse_openssl_trusted (CuTest *cu)
}
static void
+test_parse_distrusted (CuTest *cu)
+{
+ int ret;
+
+ setup (cu);
+
+ ret = p11_parse_file (test.parser, SRCDIR "/files/distrusted.pem",
+ 0, on_parse_object, cu);
+ CuAssertIntEquals (cu, P11_PARSE_SUCCESS, ret);
+
+ teardown (cu);
+}
+
+static void
test_parse_anchor (CuTest *cu)
{
CK_ATTRIBUTE *attrs;
@@ -372,6 +386,7 @@ main (void)
SUITE_ADD_TEST (suite, test_parse_der_certificate);
SUITE_ADD_TEST (suite, test_parse_pem_certificate);
SUITE_ADD_TEST (suite, test_parse_openssl_trusted);
+ SUITE_ADD_TEST (suite, test_parse_distrusted);
SUITE_ADD_TEST (suite, test_parse_anchor);
SUITE_ADD_TEST (suite, test_parse_no_sink);
SUITE_ADD_TEST (suite, test_parse_invalid_file);