diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-08-14 21:58:34 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-08-20 14:55:34 +0200 |
commit | b3c5aadf4ce3dc2207cc605726bf370a55b531c9 (patch) | |
tree | 5bb19360081b1ab928eb3dcede98f13caaa8ebac /test/recipes/80-test_pkcs12.t | |
parent | Fix mem leaks on PKCS#12 read error in PKCS12_key_gen_{asc,utf8} (diff) | |
download | openssl-b3c5aadf4ce3dc2207cc605726bf370a55b531c9.tar.xz openssl-b3c5aadf4ce3dc2207cc605726bf370a55b531c9.zip |
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 '')
-rw-r--r-- | test/recipes/80-test_pkcs12.t | 25 |
1 files changed, 24 insertions, 1 deletions
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)); |