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
12 use OpenSSL::Test qw(:DEFAULT bldtop_dir srctop_file srctop_dir data_file);
13 use OpenSSL::Test::Utils;
16 setup("test_pairwise_fail");
19 use lib srctop_dir('Configurations');
20 use lib bldtop_dir('.');
22 plan skip_all => "These tests are unsupported in a non fips build"
26 my $provconf = srctop_file("test", "fips-and-base.cnf");
28 run(test(["fips_version_test", "-config", $provconf, ">=3.1.0"]),
29 capture => 1, statusvar => \my $fips_exit);
32 skip "Skip RSA test because of no rsa in this build", 1
34 ok(run(test(["pairwise_fail_test", "-config", $provconf,
35 "-pairwise", "rsa"])),
36 "fips provider rsa keygen pairwise failure test");
40 skip "Skip EC test because of no ec in this build", 2
42 ok(run(test(["pairwise_fail_test", "-config", $provconf,
44 "fips provider ec keygen pairwise failure test");
46 skip "FIPS provider version is too old", 1
48 ok(run(test(["pairwise_fail_test", "-config", $provconf,
49 "-pairwise", "eckat"])),
50 "fips provider ec keygen kat failure test");
54 skip "Skip DSA tests because of no dsa in this build", 2
56 ok(run(test(["pairwise_fail_test", "-config", $provconf,
57 "-pairwise", "dsa", "-dsaparam", data_file("dsaparam.pem")])),
58 "fips provider dsa keygen pairwise failure test");
60 skip "FIPS provider version is too old", 1
62 ok(run(test(["pairwise_fail_test", "-config", $provconf,
63 "-pairwise", "dsakat", "-dsaparam", data_file("dsaparam.pem")])),
64 "fips provider dsa keygen kat failure test");