2 # Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the OpenSSL license (the "License"). You may not use
5 # this file except in compliance with the License. You can obtain a copy
6 # in the file LICENSE in the source distribution or at
7 # https://www.openssl.org/source/license.html
12 use OpenSSL::Test qw/:DEFAULT srctop_file/;
13 use OpenSSL::Test::Utils;
19 plan skip_all => "The PKCS12 command line utility is not supported by this OpenSSL build"
24 my $pass = "σύνθημα γνώρισμα";
27 if (eval { require Win32::Console; 1; }) {
28 # Trouble is that Win32 perl uses CreateProcessA, which
29 # makes it problematic to pass non-ASCII arguments. The only
30 # feasible option is to pick one language, set corresponding
31 # code page and reencode the problematic string...
33 $savedcp = Win32::Console::OutputCP();
34 Win32::Console::OutputCP(1253);
35 $pass = Encode::encode("cp1253",Encode::decode("utf-8",$pass));
37 # Running MinGW tests transparenly under Wine apparently requires
40 foreach(`locale -a`) {
42 if ($_ =~ m/^C\.UTF\-?8/i) {
49 # just see that we can read shibboleth.pfx protected with $pass
50 ok(run(app(["openssl", "pkcs12", "-noout",
51 "-password", "pass:$pass",
52 "-in", srctop_file("test", "shibboleth.pfx")])),
55 Win32::Console::OutputCP($savedcp) if (defined($savedcp));