2 # Copyright 2015-2018 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
13 use OpenSSL::Test qw(:DEFAULT data_file bldtop_dir srctop_file srctop_dir bldtop_file);
14 use OpenSSL::Test::Utils;
20 use lib srctop_dir('Configurations');
21 use lib bldtop_dir('.');
24 # Default config depends on if the legacy module is built or not
25 my $defaultcnf = disabled('legacy') ? 'default.cnf' : 'default-and-legacy.cnf';
27 my @configs = ( $defaultcnf );
28 # Only add the FIPS config if the FIPS module has been built
29 push @configs, 'fips.cnf' unless disabled('fips');
31 my @files = qw( evpciph.txt evpdigest.txt );
32 my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt
33 evppbe.txt evppkey.txt evppkey_ecc.txt evpcase.txt evpaessiv.txt
36 plan tests => (scalar(@configs) * scalar(@files)) + scalar(@defltfiles) + 1;
38 my $infile = bldtop_file('providers', platform->dso('fips'));
39 $ENV{OPENSSL_MODULES} = bldtop_dir("providers");
40 $ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
42 ok(run(app(['openssl', 'fipsinstall', '-out', bldtop_file('providers', 'fipsinstall.conf'),
44 '-provider_name', 'fips', '-mac_name', 'HMAC',
45 '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
46 '-section_name', 'fips_sect'])), "fipinstall");
49 $ENV{OPENSSL_CONF} = srctop_file("test", $_);
51 foreach my $f ( @files ) {
52 ok(run(test(["evp_test", data_file("$f")])),
53 "running evp_test $f");
57 #TODO(3.0): As more operations are converted to providers we can move more of
58 # these tests to the loop above
60 $ENV{OPENSSL_CONF} = srctop_file("test", $defaultcnf);
62 foreach my $f ( @defltfiles ) {
63 ok(run(test(["evp_test", data_file("$f")])),
64 "running evp_test $f");