diff options
| author | Dr. Stephen Henson <[email protected]> | 2006-02-05 22:18:42 +0100 |
|---|---|---|
| committer | Dr. Stephen Henson <[email protected]> | 2006-02-05 22:18:42 +0100 |
| commit | 8aecae520c1c8c65bf1ddfdad3ca0fa15270ac51 (patch) | |
| tree | da9a486e2a3a3e0ae140d73afcaa6073294bffde | |
| parent | Update VC++ build for FIPS mode. (diff) | |
| download | openssl-8aecae520c1c8c65bf1ddfdad3ca0fa15270ac51.tar.gz openssl-8aecae520c1c8c65bf1ddfdad3ca0fa15270ac51.zip | |
Sanity check for FIPS module directory.
| -rwxr-xr-x | util/mk1mf.pl | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/util/mk1mf.pl b/util/mk1mf.pl index c722269477e..80f3123daa7 100755 --- a/util/mk1mf.pl +++ b/util/mk1mf.pl @@ -394,14 +394,16 @@ if ($fips) $ex_build_targets .= " \$(LIB_D)$o$crypto_compat"; $ex_l_libs .= " \$(O_FIPSCANISTER)"; } - if ($fipslibpath == "") + if ($fipslibpath eq "") { open (IN, "util/fipslib_path.txt") || fipslib_error(); $fipslibdir = <IN>; chomp $fipslibdir; close IN; } - + fips_check_files($fipslibdir, + "fipscanister.o", "fipscanister.o.sha1", + "fips_premain.c", "fips_premain.c.sha1"); } @@ -1119,8 +1121,28 @@ sub read_options sub fipslib_error { - print STDERR "FIPS install directory sanity check failed\n"; - print STDERR "Either FIPS module build was not completed, or"; - print STDERR "was deleted.\nPlease rebuild FIPS module\n"; + print STDERR "***FIPS module directory sanity check failed***\n"; + print STDERR "FIPS module build failed, or was deleted\n"; + print STDERR "Please rebuild FIPS module.\n"; exit 1; } + +sub fips_check_files + { + my $dir = shift @_; + my $ret = 1; + if (!-d $dir) + { + print STDERR "FIPS module directory $dir does not exist\n"; + fipslib_error(); + } + foreach (@_) + { + if (!-f "$dir${o}$_") + { + print STDERR "FIPS module file $_ does not exist!\n"; + $ret = 0; + } + } + fipslib_error() if ($ret == 0); + } |
