2 # FIPS distribution filter.
3 # Takes tarball listing and removes unnecessary files and directories.
8 foreach (split / /, "FIPS_EX_OBJ AES_ENC BN_ASM DES_ENC SHA1_ASM_OBJ MODES_ASM_OBJ")
14 my @objlist = split / /, $objs;
16 foreach (@objlist) { $tarobjs{"$1.c"} = 1 if /([^\/]+).o$/};
18 $tarobjs{"ncbc_enc.c"} = 1;
19 $tarobjs{"mem_clr.c"} = 1;
20 $tarobjs{"ppc_cap.c"} = 1;
22 foreach (split / /, $ENV{LINKDIRS} ) { $cdirs{$_} = 1 };
26 if (exists $ENV{NOEC2M})
28 delete $tarobjs{"bn_gf2m.c"};
29 delete $tarobjs{"ec2_mult.c"};
30 delete $tarobjs{"ec2_smpl.c"};
36 "Makefile.shared" => 1,
47 # Keep top level files in list
50 next unless exists $keep{$_};
54 next unless (/^(fips\/|crypto|util|test|include|ms)/);
56 if (/^crypto\/([^\/]+)/)
58 # Skip unused directories under crypto/
59 next if -d "crypto/$1" && !exists $cdirs{$1};
60 # Keep assembly language dir, Makefile or certain extensions
61 if (!/\/asm\// && !/\/Makefile$/ && !/\.(in|pl|h)$/)
63 # If C source file must be on list.
64 next if !/(\w+\.c)$/ || !exists $tarobjs{$1};
69 next unless /Makefile/ || /dummytest.c/;