fipsobj.pl 777 B

12345678910111213141516171819202122232425262728293031
  1. # Filter script. Take all FIPS object files from the environment
  2. # and print out only those in the given directory.
  3. my $dir = $ARGV[0];
  4. my $asmobjs = "";
  5. # Add any needed assembly language files.
  6. $asmobjs = $ENV{AES_ENC} if $dir eq "aes";
  7. $asmobjs = $ENV{BN_ASM} if $dir eq "bn";
  8. $asmobjs = $ENV{DES_ENC} if $dir eq "des";
  9. $asmobjs = $ENV{SHA1_ASM_OBJ} if $dir eq "sha";
  10. $asmobjs = $ENV{MODES_ASM_OBJ} if $dir eq "modes";
  11. # Get all other FIPS object files, filtered by directory.
  12. my @objlist = grep {/crypto\/$dir\//} split / /, $ENV{FIPS_EX_OBJ};
  13. push @objlist, split / /, $asmobjs;
  14. # Fatal error if no matches
  15. die "No objects in $dir!" if (scalar @objlist == 0);
  16. # Output all matches removing pathname.
  17. foreach (@objlist)
  18. {
  19. s|../crypto/$dir/||;
  20. print "$_\n";
  21. }