#! /usr/bin/env perl
-# Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
+# Copyright 2015-2021 The OpenSSL Project Authors. All Rights Reserved.
#
# Licensed under the Apache License 2.0 (the "License"). You may not use
# this file except in compliance with the License. You can obtain a copy
use lib srctop_dir('Configurations');
use lib bldtop_dir('.');
-use platform;
my $no_fips = disabled('fips') || ($ENV{NO_FIPS} // 0);
my @types = ( "digest", "cipher" );
-$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
-$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
-
-my @setups = ();
my @testdata = (
{ config => srctop_file("test", "default.cnf"),
providers => [ 'default' ],
);
unless ($no_fips) {
- push @setups, {
- cmd => app(['openssl', 'fipsinstall',
- '-out', bldtop_file('providers', 'fipsinstall.cnf'),
- '-module', bldtop_file('providers', platform->dso('fips')),
- '-provider_name', 'fips', '-mac_name', 'HMAC',
- '-macopt', 'digest:SHA256', '-macopt', 'hexkey:00',
- '-section_name', 'fips_sect']),
- message => "fipsinstall"
- };
push @testdata, (
{ config => srctop_file("test", "fips.cnf"),
providers => [ 'fips' ],
$testcount += scalar @{$_->{tests}};
}
-plan tests => 1 + scalar @setups + $testcount * scalar(@types);
+plan tests => 1 + $testcount * scalar(@types);
ok(run(test(["evp_fetch_prov_test", "-defaultctx"])),
"running evp_fetch_prov_test using the default libctx");
-foreach my $setup (@setups) {
- ok(run($setup->{cmd}), $setup->{message});
-}
-
foreach my $alg (@types) {
foreach my $testcase (@testdata) {
- $ENV{OPENSSL_CONF} = $testcase->{config};
+ $ENV{OPENSSL_CONF} = "";
foreach my $test (@{$testcase->{tests}}) {
my @testproviders =
@{ $test->{providers} // $testcase->{providers} };
"running evp_fetch_prov_test with $alg$testprovstr$testmsg";
ok(run(test(["evp_fetch_prov_test", "-type", "$alg",
+ "-config", "$testcase->{config}",
@testargs, @testproviders])),
$message);
}