]>
git.ipfire.org Git - thirdparty/openssl.git/blob - test/recipes/30-test_evp.t
32639b77a5c48287644353cd75ee1c7a91c9dea3
2 # Copyright 2015-2020 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 my $no_fips = disabled
('fips') || ($ENV{NO_FIPS
} // 0);
25 my $no_legacy = disabled
('legacy') || ($ENV{NO_LEGACY
} // 0);
27 # Default config depends on if the legacy module is built or not
28 my $defaultcnf = $no_legacy ?
'default.cnf' : 'default-and-legacy.cnf';
30 my @configs = ( $defaultcnf );
31 # Only add the FIPS config if the FIPS module has been built
32 push @configs, 'fips.cnf' unless $no_fips;
34 my @files = qw( evprand.txt evpciph.txt evpdigest.txt evppkey.txt
35 evppkey_ecc.txt evpciph_aes_cts.txt);
37 my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt
38 evppbe.txt evpcase.txt evpccmcavs.txt );
39 my @ideafiles = qw( evpciph_idea.txt );
40 push @defltfiles, @ideafiles unless disabled
("idea");
42 my @sivfiles = qw( evpaessiv.txt );
43 push @defltfiles, @sivfiles unless disabled
("siv");
45 my @castfiles = qw( evpciph_cast5.txt );
46 push @defltfiles, @castfiles unless disabled
("cast");
48 my @seedfiles = qw( evpciph_seed.txt );
49 push @defltfiles, @seedfiles unless disabled
("seed");
51 my @sm4files = qw( evpciph_sm4.txt );
52 push @defltfiles, @sm4files unless disabled
("sm4");
54 my @desfiles = qw( evpciph_des.txt );
55 push @defltfiles, @desfiles unless disabled
("des");
57 my @rc4files = qw( evpciph_rc4.txt );
58 push @defltfiles, @rc4files unless disabled
("rc4");
60 my @rc5files = qw( evpciph_rc5.txt );
61 push @defltfiles, @rc5files unless disabled
("rc5");
63 my @rc2files = qw( evpciph_rc2.txt );
64 push @defltfiles, @rc2files unless disabled
("rc2");
66 my @chachafiles = qw( evpciph_chacha.txt );
67 push @defltfiles, @chachafiles unless disabled
("chacha");
69 my @bffiles = qw( evpciph_bf.txt );
70 push @defltfiles, @bffiles unless disabled
("bf");
72 my @md2files = qw( evpmd_md2.txt );
73 push @defltfiles, @md2files unless disabled
("md2");
75 my @mdc2files = qw( evpmd_mdc2.txt );
76 push @defltfiles, @mdc2files unless disabled
("mdc2");
79 ($no_fips ?
0 : 1) # FIPS install test
80 + (scalar(@configs) * scalar(@files))
81 + scalar(@defltfiles);
84 my $infile = bldtop_file
('providers', platform
->dso('fips'));
86 ok
(run
(app
(['openssl', 'fipsinstall',
87 '-out', bldtop_file
('providers', 'fipsmodule.cnf'),
89 '-provider_name', 'fips',
90 '-section_name', 'fips_sect'])),
95 $ENV{OPENSSL_CONF
} = srctop_file
("test", $_);
97 foreach my $f ( @files ) {
98 ok
(run
(test
(["evp_test", data_file
("$f")])),
99 "running evp_test $f");
103 #TODO(3.0): As more operations are converted to providers we can move more of
104 # these tests to the loop above
106 $ENV{OPENSSL_CONF
} = srctop_file
("test", $defaultcnf);
108 foreach my $f ( @defltfiles ) {
109 ok
(run
(test
(["evp_test", data_file
("$f")])),
110 "running evp_test $f");