#! /usr/bin/env perl
-# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
#
-# Licensed under the OpenSSL license (the "License"). You may not use
+# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
# in the file LICENSE in the source distribution or at
# https://www.openssl.org/source/license.html
my $test_name = "test_store";
setup($test_name);
+my $mingw = config('target') =~ m|^mingw|;
+my $cnf = srctop_file("test", "ca-and-certs.cnf");
+
my @noexist_files =
( "test/blahdiblah.pem",
"test/blahdibleh.der" );
ok(run(app(["openssl", "storeutl", "-noout", $file])));
ok(run(app(["openssl", "storeutl", "-noout", to_abs_file($file)])));
+ SKIP:
{
- local $ENV{MSYS2_ARG_CONV_EXCL} = "file:";
+ skip "file: tests disabled on MingW", 4 if $mingw;
ok(run(app(["openssl", "storeutl", "-noout",
to_abs_file_uri($file)])));
ok(run(app(["openssl", "storeutl", "-noout", "-passin",
"pass:password", to_abs_file($_)])));
+ SKIP:
{
- local $ENV{MSYS2_ARG_CONV_EXCL} = "file:";
+ skip "file: tests disabled on MingW", 2 if $mingw;
ok(run(app(["openssl", "storeutl", "-noout", "-passin",
"pass:password", to_abs_file_uri($_)])));
}
}
foreach (values %generated_file_files) {
- local $ENV{MSYS2_ARG_CONV_EXCL} = "file:";
+ SKIP:
+ {
+ skip "file: tests disabled on MingW", 1 if $mingw;
- ok(run(app(["openssl", "storeutl", "-noout", $_])));
+ ok(run(app(["openssl", "storeutl", "-noout", $_])));
+ }
}
foreach (@noexist_file_files) {
- local $ENV{MSYS2_ARG_CONV_EXCL} = "file:";
+ SKIP:
+ {
+ skip "file: tests disabled on MingW", 1 if $mingw;
- ok(!run(app(["openssl", "storeutl", "-noout", $_])));
+ ok(!run(app(["openssl", "storeutl", "-noout", $_])));
+ }
}
{
my $dir = srctop_dir("test", "certs");
ok(run(app(["openssl", "storeutl", "-noout", $dir])));
ok(run(app(["openssl", "storeutl", "-noout",
to_abs_file($dir, 1)])));
+ SKIP:
{
- local $ENV{MSYS2_ARG_CONV_EXCL} = "file:";
+ skip "file: tests disabled on MingW", 1 if $mingw;
ok(run(app(["openssl", "storeutl", "-noout",
to_abs_file_uri($dir, 1)])));
}, grep(/-key-pkcs8-pbes2-sha256\.pem$/, @generated_files))
# *-cert.pem (intermediary for the .p12 inits)
&& run(app(["openssl", "req", "-x509",
- "-config", data_file("ca.cnf"), "-nodes",
+ "-config", $cnf, "-nodes",
"-out", "cacert.pem", "-keyout", "cakey.pem"]))
&& runall(sub {
my $srckey = shift;
(my $csr = $dstfile) =~ s|\.pem|.csr|;
(run(app(["openssl", "req", "-new",
- "-config", data_file("user.cnf"),
+ "-config", $cnf,
"-key", $srckey, "-out", $csr]))
&&
run(app(["openssl", "x509", "-days", "3650",
}
run(app(["openssl", "pkcs12", "-inkey", $srckey,
"-in", $srccert, "-passout", "pass:password",
+ "-chain", "-CAfile", "cacert.pem",
"-export", "-macalg", $macalg,
"-certpbe", $certpbe, "-keypbe", $keypbe,
"-out", $dstfile]));