2 # FIPS assembly language preprocessor
3 # Renames all symbols in the file to
4 # their modified fips versions.
10 my $target = shift @ARGS;
12 # HACK to disable operation if no OPENSSL_FIPSSYMS option.
13 # will go away when tested more fully.
17 foreach (@ARGS) { $enabled = 1 if /-DOPENSSL_FIPSSYMS/ ; }
25 # Open symbol rename file.
26 open(IN, "$top/fips/fipssyms.h") || die "Can't open fipssyms.h";
28 # Skip to assembler symbols
37 if (/^#define\s+(\w+)\s+(\w+)\b/)
45 #rename target temporarily
46 rename($target, "tmptarg.s") || die "Can't rename $target\n";
54 while (($from, $to) = each %edits)
56 s/(\b)$from(\b)/$1$to$2/g;
67 rename "tmptarg.s", $target;
69 die "Error executing assembler!" if $rv != 0;