summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-14 21:58:34 +0200
committerDr. David von Oheimb <David.von.Oheimb@siemens.com>2020-08-20 14:55:34 +0200
commitb3c5aadf4ce3dc2207cc605726bf370a55b531c9 (patch)
tree5bb19360081b1ab928eb3dcede98f13caaa8ebac /test
parented4faae00cdab23244704660c099e41ec64f5dc0 (diff)
apps: make use of OSSL_STORE for generalized certs and CRLs loading
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/12647)
Diffstat (limited to 'test')
-rw-r--r--test/certs/v3-certs-RC2.p12bin0 -> 1568 bytes
-rw-r--r--test/certs/v3-certs-TDES.p12bin0 -> 1568 bytes
-rw-r--r--test/recipes/80-test_pkcs12.t25
3 files changed, 24 insertions, 1 deletions
diff --git a/test/certs/v3-certs-RC2.p12 b/test/certs/v3-certs-RC2.p12
new file mode 100644
index 0000000000..0cdbcc1f26
--- /dev/null
+++ b/test/certs/v3-certs-RC2.p12
Binary files differ
diff --git a/test/certs/v3-certs-TDES.p12 b/test/certs/v3-certs-TDES.p12
new file mode 100644
index 0000000000..d203dc2986
--- /dev/null
+++ b/test/certs/v3-certs-TDES.p12
Binary files differ
diff --git a/test/recipes/80-test_pkcs12.t b/test/recipes/80-test_pkcs12.t
index fa95649212..24247b8c25 100644
--- a/test/recipes/80-test_pkcs12.t
+++ b/test/recipes/80-test_pkcs12.t
@@ -57,7 +57,7 @@ if (eval { require Win32::API; 1; }) {
}
$ENV{OPENSSL_WIN32_UTF8}=1;
-plan tests => 2;
+plan tests => 4;
# Test different PKCS#12 formats
ok(run(test(["pkcs12_format_test"])), "test pkcs12 formats");
@@ -68,4 +68,27 @@ ok(run(app(["openssl", "pkcs12", "-noout",
"-in", srctop_file("test", "shibboleth.pfx")])),
"test_pkcs12");
+my @path = qw(test certs);
+my $tmpfile = "tmp.p12";
+
+# Test the -passcerts option
+ok(run(app(["openssl", "pkcs12", "-export",
+ "-in", srctop_file(@path, "ee-cert.pem"),
+ "-certfile", srctop_file(@path, "v3-certs-TDES.p12"),
+ "-passcerts", "pass:v3-certs",
+ "-nokeys", "-passout", "pass:v3-certs", "-descert",
+ "-out", $tmpfile])),
+ "test_pkcs12_passcert");
+unlink $tmpfile;
+
+# Test reading legacy PKCS#12 file
+ok(run(app(["openssl", "pkcs12", "-export",
+ "-in", srctop_file(@path, "v3-certs-RC2.p12"),
+ "-passin", "pass:v3-certs",
+ "-provider", "default", "-provider", "legacy",
+ "-nokeys", "-passout", "pass:v3-certs", "-descert",
+ "-out", $tmpfile])),
+ "test_pkcs12_passcert");
+unlink $tmpfile;
+
SetConsoleOutputCP($savedcp) if (defined($savedcp));