Lines Matching +full:pass +full:- +full:1
2 # Copyright 2016-2024 The OpenSSL Project Authors. All Rights Reserved.
19 my $pass = "σύνθημα γνώρισμα";
22 if (eval { require Win32::API; 1; }) {
24 # makes it problematic to pass non-ASCII arguments, from perl[!]
27 # system default locale. Since we attempt Greek pass-phrase
30 Win32::API->Import("kernel32","UINT GetSystemDefaultLCID()");
32 plan skip_all => "Non-Greek system locale";
35 Win32::API->Import("kernel32","UINT GetConsoleOutputCP()");
36 Win32::API->Import("kernel32","BOOL SetConsoleOutputCP(UINT cp)");
39 $pass = Encode::encode("cp1253",Encode::decode("utf-8",$pass));
45 # UTF-8 locale...
47 foreach(`locale -a`) {
49 if ($_ =~ m/^C\.UTF\-?8/i) {
55 $ENV{OPENSSL_WIN32_UTF8}=1;
62 ok(run(test(["pkcs12_format_test", "-legacy"])), "test pkcs12 formats using legacy APIs");
63 # Test with a non-default library context (and no loaded providers in the default context)
64 ok(run(test(["pkcs12_format_test", "-context"])), "test pkcs12 formats using a non-default library context");
67 skip "VMS doesn't have command line UTF-8 support yet in DCL", 1
70 # just see that we can read shibboleth.pfx protected with $pass
71 ok(run(app(["openssl", "pkcs12", "-noout",
72 "-password", "pass:$pass",
73 "-in", srctop_file("test", "shibboleth.pfx")])),
84 # Test the -chain option with -untrusted
85 ok(run(app(["openssl", "pkcs12", "-export", "-chain",
86 "-CAfile", srctop_file(@path, "sroot-cert.pem"),
87 "-untrusted", srctop_file(@path, "ca-cert.pem"),
88 "-in", srctop_file(@path, "ee-cert.pem"),
89 "-nokeys", "-passout", "pass:", "-out", $outfile1])),
92 # Test the -passcerts option
94 skip "Skipping PKCS#12 test because DES is disabled in this build", 1
96 ok(run(app(["openssl", "pkcs12", "-export",
97 "-in", srctop_file(@path, "ee-cert.pem"),
98 "-certfile", srctop_file(@path, "v3-certs-TDES.p12"),
99 "-passcerts", "pass:v3-certs",
100 "-nokeys", "-passout", "pass:v3-certs", "-descert",
101 "-out", $outfile2])),
106 skip "Skipping legacy PKCS#12 test because the required algorithms are disabled", 1
109 ok(run(app(["openssl", "pkcs12", "-export",
110 "-in", srctop_file(@path, "v3-certs-RC2.p12"),
111 "-passin", "pass:v3-certs",
112 "-provider", "default", "-provider", "legacy",
113 "-nokeys", "-passout", "pass:v3-certs", "-descert",
114 "-out", $outfile3])),
119 # -nomac necessary to avoid legacy provider requirement
120 ok(run(app(["openssl", "pkcs12", "-export",
121 "-inkey", srctop_file(@path, "cert-key-cert.pem"),
122 "-in", srctop_file(@path, "cert-key-cert.pem"),
123 "-passout", "pass:v3-certs",
124 "-nomac", "-out", $outfile4], stderr => "outerr.txt")),
129 ok(scalar @match > 0 ? 0 : 1, "test_export_pkcs12_outerr_empty");
132 "-in", $outfile4,
133 "-passin", "pass:v3-certs",
134 "-nomacver", "-nodes"])),
137 ok(run(app(["openssl", "pkcs12", "-export", "-out", $outfile5,
138 "-in", srctop_file(@path, "ee-cert.pem"), "-caname", "testname",
139 "-nokeys", "-passout", "pass:", "-certpbe", "NONE"])),
142 my @pkcs12info = run(app(["openssl", "pkcs12", "-info", "-in", $outfile5,
143 "-passin", "pass:"]), capture => 1);
146 ok(grep(/subject=CN = server.example/, @pkcs12info) == 1,
149 ok(grep(/testname/, @pkcs12info) == 1, "test friendly name in output");
152 my $bad1 = srctop_file("test", "recipes", "80-test_pkcs12_data", "bad1.p12");
153 my $bad2 = srctop_file("test", "recipes", "80-test_pkcs12_data", "bad2.p12");
154 my $bad3 = srctop_file("test", "recipes", "80-test_pkcs12_data", "bad3.p12");
156 with({ exit_checker => sub { return shift == 1; } },
158 ok(run(app(["openssl", "pkcs12", "-in", $bad1, "-password", "pass:"])),
159 "test bad pkcs12 file 1");
161 ok(run(app(["openssl", "pkcs12", "-in", $bad1, "-password", "pass:",
162 "-nomacver"])),
163 "test bad pkcs12 file 1 (nomacver)");
165 ok(run(app(["openssl", "pkcs12", "-in", $bad1, "-password", "pass:",
166 "-info"])),
167 "test bad pkcs12 file 1 (info)");
169 ok(run(app(["openssl", "pkcs12", "-in", $bad2, "-password", "pass:"])),
172 ok(run(app(["openssl", "pkcs12", "-in", $bad2, "-password", "pass:",
173 "-info"])),
176 ok(run(app(["openssl", "pkcs12", "-in", $bad3, "-password", "pass:"])),
179 ok(run(app(["openssl", "pkcs12", "-in", $bad3, "-password", "pass:",
180 "-info"])),