summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2016-07-26 01:46:03 +0200
committerAndy Polyakov <appro@openssl.org>2016-08-22 13:52:51 +0200
commit70bf33d1821baf44764555be6a63488798c4d086 (patch)
tree4d4e7a1ef1637d150fb0ec4f5226d95325fcfde3 /test
parent9e6b2f54e449009c6dc11e8860d125d967f3a3ed (diff)
Add PKCS#12 UTF-8 interoperability test.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'test')
-rw-r--r--test/recipes/80-test_pkcs12.t31
-rw-r--r--test/shibboleth.pfxbin0 -> 2519 bytes
2 files changed, 31 insertions, 0 deletions
diff --git a/test/recipes/80-test_pkcs12.t b/test/recipes/80-test_pkcs12.t
new file mode 100644
index 0000000000..681ce45fcb
--- /dev/null
+++ b/test/recipes/80-test_pkcs12.t
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+
+use OpenSSL::Test qw/:DEFAULT srctop_file/;
+use Encode;
+
+setup("test_pkcs12");
+
+plan tests => 1;
+
+my $pass = "σύνθημα γνώρισμα";
+
+my $savedcp;
+if (eval { require Win32::Console; 1; }) {
+ # Trouble is that Win32 perl uses CreateProcessA, which
+ # makes it problematic to pass non-ASCII arguments. The only
+ # feasible option is to pick one language, set corresponding
+ # code page and reencode the problematic string...
+
+ $savedcp = Win32::Console::OutputCP();
+ Win32::Console::OutputCP(1253);
+ $pass = Encode::encode("cp1253",Encode::decode("utf-8",$pass));
+}
+
+# just see that we can read shibboleth.pfx protected with $pass
+ok(run(app(["openssl", "pkcs12", "-noout",
+ "-password", "pass:$pass",
+ "-in", srctop_file("test", "shibboleth.pfx")])),
+ "test_pkcs12");
+
+Win32::Console::OutputCP($savedcp) if (defined($savedcp));
diff --git a/test/shibboleth.pfx b/test/shibboleth.pfx
new file mode 100644
index 0000000000..9c5cc546b8
--- /dev/null
+++ b/test/shibboleth.pfx
Binary files differ