8 use if $^O eq "VMS", "VMS::Filespec";
12 # First script argument MUST be the build top directory
14 $bldtop_dir = $ARGV[0];
15 # 'use lib' needs Unix-ish paths
16 $bldtop_dir = VMS::Filespec::unixpath($bldtop_dir) if $^O eq "VMS";
21 use lib "$FindBin::Bin/../Configurations";
24 my @providers = ($bldtop_dir, 'providers');
25 my $fips_cnf = File::Spec->catfile(@providers, 'fipsinstall.cnf');
26 my $fips_module = File::Spec->catfile(@providers, platform->dso('fips'));
27 my $openssl = File::Spec->catfile($bldtop_dir, 'apps',
28 platform->bin('openssl'));
30 # We create the command like this to make it readable, then massage it with
31 # a space replacement regexp to make it usable with system()
33 $openssl fipsinstall \
35 -module "{fips_module}" \
36 -provider_name "fips" \
37 -mac_name "HMAC" -macopt "digest:SHA256" -macopt "hexkey:00" \
38 -section_name "fips_sect"
41 $cmd =~ s|{fips_cnf}|$fips_cnf|;
42 $cmd =~ s|{fips_module}|$fips_module|;
46 die "Failed to run '$cmd'\n" if $? == -1;
47 # If there was a signal, use it as exit code with high bit set.
48 $exit = (($? & 255) | 128) if ($? & 255) != 0;
49 # Otherwise, just return fipsinstall's exit code