2016-04-22 19:21:51 +08:00
|
|
|
#! /usr/bin/env perl
|
2018-09-11 20:22:14 +08:00
|
|
|
# Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
|
2016-04-22 19:21:51 +08:00
|
|
|
#
|
2018-12-06 20:05:25 +08:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-04-22 19:21:51 +08:00
|
|
|
# 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
|
|
|
|
|
2015-04-18 02:16:13 +08:00
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
|
2019-07-17 20:26:26 +08:00
|
|
|
use OpenSSL::Test qw(:DEFAULT data_file bldtop_dir srctop_file);
|
2019-08-12 13:04:13 +08:00
|
|
|
use OpenSSL::Test::Utils;
|
2015-04-18 02:16:13 +08:00
|
|
|
|
|
|
|
setup("test_evp");
|
|
|
|
|
2019-08-12 13:04:13 +08:00
|
|
|
# Default config depends on if the legacy module is built or not
|
|
|
|
my $defaultcnf = disabled('legacy') ? 'default.cnf' : 'default-and-legacy.cnf';
|
|
|
|
|
|
|
|
my @configs = ( $defaultcnf );
|
|
|
|
# Only add the FIPS config if the FIPS module has been built
|
|
|
|
push @configs, 'fips.cnf' unless disabled('fips');
|
|
|
|
|
2019-08-05 20:38:25 +08:00
|
|
|
my @files = qw( evpciph.txt evpdigest.txt );
|
|
|
|
my @defltfiles = qw( evpencod.txt evpkdf.txt evppkey_kdf.txt evpmac.txt
|
|
|
|
evppbe.txt evppkey.txt evppkey_ecc.txt evpcase.txt evpaessiv.txt
|
|
|
|
evpccmcavs.txt );
|
2017-05-12 00:17:38 +08:00
|
|
|
|
2019-08-05 20:38:25 +08:00
|
|
|
plan tests => (scalar(@configs) * scalar(@files)) + scalar(@defltfiles);
|
2017-05-12 00:17:38 +08:00
|
|
|
|
2019-07-17 20:26:26 +08:00
|
|
|
foreach (@configs) {
|
|
|
|
$ENV{OPENSSL_CONF} = srctop_file("test", $_);
|
|
|
|
|
|
|
|
foreach my $f ( @files ) {
|
|
|
|
ok(run(test(["evp_test", data_file("$f")])),
|
|
|
|
"running evp_test $f");
|
|
|
|
}
|
2017-05-12 00:17:38 +08:00
|
|
|
}
|
2019-08-05 20:38:25 +08:00
|
|
|
|
|
|
|
#TODO(3.0): As more operations are converted to providers we can move more of
|
|
|
|
# these tests to the loop above
|
|
|
|
|
2019-08-12 13:04:13 +08:00
|
|
|
$ENV{OPENSSL_CONF} = srctop_file("test", $defaultcnf);
|
2019-08-05 20:38:25 +08:00
|
|
|
|
|
|
|
foreach my $f ( @defltfiles ) {
|
|
|
|
ok(run(test(["evp_test", data_file("$f")])),
|
|
|
|
"running evp_test $f");
|
|
|
|
}
|