2016-06-07 23:35:38 +08:00
|
|
|
#! /usr/bin/env perl
|
2018-04-17 21:18:40 +08:00
|
|
|
# Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
|
2016-06-07 23:35:38 +08:00
|
|
|
#
|
2018-12-06 20:05:25 +08:00
|
|
|
# Licensed under the Apache License 2.0 (the "License"). You may not use
|
2016-06-07 23:35:38 +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
|
|
|
|
|
|
|
|
|
|
|
|
use OpenSSL::Test::Utils;
|
2020-03-19 01:17:37 +08:00
|
|
|
use OpenSSL::Test qw/:DEFAULT srctop_file srctop_dir bldtop_dir bldtop_file/;
|
2018-04-10 21:51:12 +08:00
|
|
|
use File::Temp qw(tempfile);
|
2016-06-07 23:35:38 +08:00
|
|
|
|
2020-03-19 01:17:37 +08:00
|
|
|
BEGIN {
|
2016-06-09 20:33:27 +08:00
|
|
|
setup("test_sslapi");
|
2020-03-19 01:17:37 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
use lib srctop_dir('Configurations');
|
|
|
|
use lib bldtop_dir('.');
|
|
|
|
use platform;
|
|
|
|
|
2016-06-07 23:35:38 +08:00
|
|
|
|
|
|
|
plan skip_all => "No TLS/SSL protocols are supported by this OpenSSL build"
|
|
|
|
if alldisabled(grep { $_ ne "ssl3" } available_protocols("tls"));
|
|
|
|
|
2020-03-19 01:17:37 +08:00
|
|
|
plan tests => 2;
|
2016-06-07 23:35:38 +08:00
|
|
|
|
2018-04-10 21:51:12 +08:00
|
|
|
(undef, my $tmpfilename) = tempfile();
|
|
|
|
|
2020-03-19 01:17:37 +08:00
|
|
|
|
|
|
|
$ENV{OPENSSL_MODULES} = bldtop_dir("providers");
|
|
|
|
$ENV{OPENSSL_CONF_INCLUDE} = bldtop_dir("providers");
|
|
|
|
|
|
|
|
ok(run(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'])),
|
|
|
|
"fipsinstall");
|
|
|
|
|
2019-07-24 00:10:05 +08:00
|
|
|
ok(run(test(["sslapitest", srctop_dir("test", "certs"),
|
2018-04-10 21:51:12 +08:00
|
|
|
srctop_file("test", "recipes", "90-test_sslapi_data",
|
2020-03-19 01:17:37 +08:00
|
|
|
"passwd.txt"), $tmpfilename, "default",
|
|
|
|
srctop_file("test", "default.cnf")])),
|
2018-04-10 21:51:12 +08:00
|
|
|
"running sslapitest");
|
|
|
|
|
|
|
|
unlink $tmpfilename;
|