2 # Copyright 2023 The OpenSSL Project Authors. All Rights Reserved.
4 # Licensed under the Apache License 2.0 (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
9 # This collects specific use cases, and tests our handling
11 use File::Spec::Functions;
14 use OpenSSL::Test qw(:DEFAULT srctop_file srctop_dir bldtop_file bldtop_dir
16 use OpenSSL::Test::Utils;
18 my $test_name = "test_store_cases";
25 # The case of the garbage PKCS#12 DER file where a passphrase was
26 # prompted for. That should not have happened.
27 $stderr = 'garbage-pkcs12.stderr.txt';
28 ok(!run(app(['openssl', 'storeutl', '-passin', 'pass:invalidapass',
29 data_file('garbage-pkcs12.p12')],
31 "checking that storeutl fails when given a garbage pkcs12 file");
33 @match = grep /try_pkcs12:.*?:maybe wrong password$/, <DATA>;
35 ok(scalar @match > 0 ? 0 : 1,
36 "checking that storeutl didn't ask for a passphrase");