my $top = shift @ARGS;
my $target = shift @ARGS;
+my $tmptarg = $target;
+
+$tmptarg =~ s/\.[^\\\/\.]+$/.tmp/;
my $runasm = 1;
shift @ARGS;
}
-# HACK to disable operation if no OPENSSL_FIPSSYMS option.
-# will go away when tested more fully.
-
my $enabled = 0;
-foreach (@ARGS) { $enabled = 1 if /-DOPENSSL_FIPSSYMS/ ; }
+$enabled = 1 if $ENV{FIPSCANISTERINTERNAL} eq "y";
if ($enabled == 0 && $runasm)
{
my ($from, $to);
+#delete any temp file lying around
+
+unlink $tmptarg;
+
#rename target temporarily
-rename($target, "tmptarg.s") || die "Can't rename $target\n";
+rename($target, $tmptarg) || die "Can't rename $target";
#edit target
-open IN,"tmptarg.s";
-open OUT, ">$target";
+open(IN,$tmptarg) || die "Can't open temporary file";
+open(OUT, ">$target") || die "Can't open output file $target";
while (<IN>)
{
# restore target
unlink $target;
- rename "tmptarg.s", $target;
+ rename $tmptarg, $target;
die "Error executing assembler!" if $rv != 0;
}
else
{
# Don't care about target
- unlink "tmptarg.s";
+ unlink $tmptarg;
}
-
-
-
-