Update VC++ build for new FIPS paths.
This commit is contained in:
@@ -12,23 +12,23 @@ sub check_env
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my ($fips_cc,$fips_cc_args, $fips_link,$fips_target, $fips_libdir)
|
my ($fips_cc,$fips_cc_args, $fips_link,$fips_target, $fips_libdir, $sha1_exe)
|
||||||
= check_env("FIPS_CC", "FIPS_CC_ARGS", "FIPS_LINK", "FIPS_TARGET",
|
= check_env("FIPS_CC", "FIPS_CC_ARGS", "FIPS_LINK", "FIPS_TARGET",
|
||||||
"FIPS_LIBDIR");
|
"FIPSLIB_D", "FIPS_SHA1_EXE");
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (exists $ENV{"FIPS_PREMAIN_DSO"})
|
if (exists $ENV{"PREMAIN_DSO_EXE"})
|
||||||
{
|
{
|
||||||
$fips_premain_dso = $ENV{"FIPS_PREMAIN_DSO"};
|
$fips_premain_dso = $ENV{"PREMAIN_DSO_EXE"};
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$fips_premain_dso = "";
|
$fips_premain_dso = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
check_hash("fips_premain.c");
|
check_hash($sha1_exe, "fips_premain.c");
|
||||||
check_hash("fipscanister.o");
|
check_hash($sha1_exe, "fipscanister.o");
|
||||||
|
|
||||||
|
|
||||||
print "Integrity check OK\n";
|
print "Integrity check OK\n";
|
||||||
@@ -59,13 +59,13 @@ die "Second stage Link failure" if $? != 0;
|
|||||||
|
|
||||||
sub check_hash
|
sub check_hash
|
||||||
{
|
{
|
||||||
my ($filename) = @_;
|
my ($sha1_exe, $filename) = @_;
|
||||||
my ($hashfile, $hashval);
|
my ($hashfile, $hashval);
|
||||||
|
|
||||||
open(IN, "${fips_libdir}/${filename}.sha1") || die "Cannot open file hash file ${fips_libdir}/${filename}.sha1";
|
open(IN, "${fips_libdir}/${filename}.sha1") || die "Cannot open file hash file ${fips_libdir}/${filename}.sha1";
|
||||||
$hashfile = <IN>;
|
$hashfile = <IN>;
|
||||||
close IN;
|
close IN;
|
||||||
$hashval = `${fips_libdir}/fips_standalone_sha1.exe ${fips_libdir}/$filename`;
|
$hashval = `$sha1_exe ${fips_libdir}/$filename`;
|
||||||
chomp $hashfile;
|
chomp $hashfile;
|
||||||
chomp $hashval;
|
chomp $hashval;
|
||||||
$hashfile =~ s/^.*=\s+//;
|
$hashfile =~ s/^.*=\s+//;
|
||||||
|
|||||||
@@ -377,7 +377,7 @@ if ($fips_premain_c_path eq "")
|
|||||||
if ($fips_sha1_exe_path eq "")
|
if ($fips_sha1_exe_path eq "")
|
||||||
{
|
{
|
||||||
$fips_sha1_exe_path =
|
$fips_sha1_exe_path =
|
||||||
"fips-1.0${o}sha${o}fips_sha1_standalone$exep";
|
"fips-1.0${o}sha${o}fips_standalone_sha1$exep";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($fips_premain_dso_exe_path eq "")
|
if ($fips_premain_dso_exe_path eq "")
|
||||||
@@ -499,14 +499,6 @@ MLFLAGS=$mlflags
|
|||||||
ASM=$bin_dir$asm
|
ASM=$bin_dir$asm
|
||||||
MKCANISTER=$mkcanister
|
MKCANISTER=$mkcanister
|
||||||
|
|
||||||
######################################################
|
|
||||||
# You should not need to touch anything below this point
|
|
||||||
######################################################
|
|
||||||
|
|
||||||
E_EXE=openssl
|
|
||||||
SSL=$ssl
|
|
||||||
CRYPTO=$crypto
|
|
||||||
|
|
||||||
# FIPS validated module and support file locations
|
# FIPS validated module and support file locations
|
||||||
|
|
||||||
E_PREMAIN_DSO=fips_premain_dso
|
E_PREMAIN_DSO=fips_premain_dso
|
||||||
@@ -517,6 +509,14 @@ O_FIPSCANISTER=$fips_canister_path
|
|||||||
FIPS_SHA1_EXE=$fips_sha1_exe_path
|
FIPS_SHA1_EXE=$fips_sha1_exe_path
|
||||||
PREMAIN_DSO_EXE=$fips_premain_dso_exe_path
|
PREMAIN_DSO_EXE=$fips_premain_dso_exe_path
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
# You should not need to touch anything below this point
|
||||||
|
######################################################
|
||||||
|
|
||||||
|
E_EXE=openssl
|
||||||
|
SSL=$ssl
|
||||||
|
CRYPTO=$crypto
|
||||||
|
|
||||||
# BIN_D - Binary output directory
|
# BIN_D - Binary output directory
|
||||||
# TEST_D - Binary test file output directory
|
# TEST_D - Binary test file output directory
|
||||||
# LIB_D - library output directory
|
# LIB_D - library output directory
|
||||||
@@ -764,8 +764,7 @@ if ($fips)
|
|||||||
{
|
{
|
||||||
$rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)",
|
$rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(O_FIPSCANISTER)",
|
||||||
"\$(O_CRYPTO)",$crypto,$shlib, "\$(SO_CRYPTO)",
|
"\$(O_CRYPTO)",$crypto,$shlib, "\$(SO_CRYPTO)",
|
||||||
"0xFB00000", "\$(PREMAIN_DSO_EXE)",
|
"0xFB00000");
|
||||||
"\$(FIPS_PREMAIN_SRC)");
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -113,7 +113,7 @@ $cflags.=" /Fd$out_def";
|
|||||||
|
|
||||||
sub do_lib_rule
|
sub do_lib_rule
|
||||||
{
|
{
|
||||||
local($objs,$target,$name,$shlib,$ign,$base_addr, $fips_get_sig, $fips_premain_src)=@_;
|
local($objs,$target,$name,$shlib,$ign,$base_addr) = @_;
|
||||||
local($ret,$Name);
|
local($ret,$Name);
|
||||||
|
|
||||||
$taget =~ s/\//$o/g if $o ne '/';
|
$taget =~ s/\//$o/g if $o ne '/';
|
||||||
@@ -143,16 +143,17 @@ sub do_lib_rule
|
|||||||
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
local($ex)=($target =~ /O_SSL/)?' $(L_CRYPTO)':'';
|
||||||
$ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib';
|
$ex.=' wsock32.lib gdi32.lib advapi32.lib user32.lib';
|
||||||
$ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
|
$ex.=" $zlib_lib" if $zlib_opt == 1 && $target =~ /O_CRYPTO/;
|
||||||
$ex.=" ms${o}_chkstk.o" if $fips && $target =~ /O_CRYPTO/;
|
if ($fips && $target =~ /O_CRYPTO/)
|
||||||
if (defined $fips_get_sig)
|
|
||||||
{
|
{
|
||||||
|
$ex.=" ms${o}_chkstk.o";
|
||||||
$ret.="$target: $objs $fips_get_sig\n";
|
$ret.="$target: $objs $fips_get_sig\n";
|
||||||
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
|
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
|
||||||
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
||||||
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
||||||
$ret.="\tSET FIPS_PREMAIN_DSO=$fips_get_sig\n";
|
$ret.="\tSET PREMAIN_DSO_EXE=\$(PREMAIN_DSO_EXE)\n";
|
||||||
|
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
|
||||||
$ret.="\tSET FIPS_TARGET=$target\n";
|
$ret.="\tSET FIPS_TARGET=$target\n";
|
||||||
$ret.="\tSET FIPS_LIBDIR=\$(FIPSLIB_D)\n";
|
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
|
||||||
$ret.="\t\$(FIPSLINK) \$(MLFLAGS) $base_arg $efile$target ";
|
$ret.="\t\$(FIPSLINK) \$(MLFLAGS) $base_arg $efile$target ";
|
||||||
$ret.="/def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs ";
|
$ret.="/def:ms/${Name}.def @<<\n \$(SHLIB_EX_OBJ) $objs ";
|
||||||
$ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n";
|
$ret.="\$(OBJ_D)${o}fips_premain.obj $ex\n<<\n";
|
||||||
@@ -184,9 +185,10 @@ sub do_link_rule
|
|||||||
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
|
$ret.="\tSET FIPS_LINK=\$(LINK)\n";
|
||||||
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
$ret.="\tSET FIPS_CC=\$(CC)\n";
|
||||||
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
$ret.="\tSET FIPS_CC_ARGS=/Fo\$(OBJ_D)${o}fips_premain.obj \$(SHLIB_CFLAGS) -c\n";
|
||||||
$ret.="\tSET FIPS_PREMAIN_DSO=\n";
|
$ret.="\tSET PREMAIN_DSO_EXE=\n";
|
||||||
$ret.="\tSET FIPS_TARGET=$target\n";
|
$ret.="\tSET FIPS_TARGET=$target\n";
|
||||||
$ret.="\tSET FIPS_LIBDIR=\$(FIPSLIB_D)\n";
|
$ret.="\tSET FIPS_SHA1_EXE=\$(FIPS_SHA1_EXE)\n";
|
||||||
|
$ret.="\tSET FIPSLIB_D=\$(FIPSLIB_D)\n";
|
||||||
$ret.=" \$(FIPSLINK) \$(LFLAGS) $efile$target @<<\n";
|
$ret.=" \$(FIPSLINK) \$(LFLAGS) $efile$target @<<\n";
|
||||||
$ret.=" \$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n";
|
$ret.=" \$(APP_EX_OBJ) $files \$(OBJ_D)${o}fips_premain.obj $libs\n<<\n";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user