| OLD | NEW | 
|---|
| 1 #!/usr/local/bin/perl | 1 #!/usr/local/bin/perl | 
| 2 # A bit of an evil hack but it post processes the file ../MINFO which | 2 # A bit of an evil hack but it post processes the file ../MINFO which | 
| 3 # is generated by `make files` in the top directory. | 3 # is generated by `make files` in the top directory. | 
| 4 # This script outputs one mega makefile that has no shell stuff or any | 4 # This script outputs one mega makefile that has no shell stuff or any | 
| 5 # funny stuff | 5 # funny stuff | 
| 6 # | 6 # | 
| 7 | 7 | 
| 8 $INSTALLTOP="/usr/local/ssl"; | 8 $INSTALLTOP="/usr/local/ssl"; | 
|  | 9 $OPENSSLDIR="/usr/local/ssl"; | 
| 9 $OPTIONS=""; | 10 $OPTIONS=""; | 
| 10 $ssl_version=""; | 11 $ssl_version=""; | 
| 11 $banner="\t\@echo Building OpenSSL"; | 12 $banner="\t\@echo Building OpenSSL"; | 
| 12 | 13 | 
| 13 my $no_static_engine = 0; | 14 my $no_static_engine = 1; | 
| 14 my $engines = ""; | 15 my $engines = ""; | 
|  | 16 my $otherlibs = ""; | 
| 15 local $zlib_opt = 0;    # 0 = no zlib, 1 = static, 2 = dynamic | 17 local $zlib_opt = 0;    # 0 = no zlib, 1 = static, 2 = dynamic | 
| 16 local $zlib_lib = ""; | 18 local $zlib_lib = ""; | 
|  | 19 local $perl_asm = 0;    # 1 to autobuild asm files from perl scripts | 
| 17 | 20 | 
| 18 local $fips_canister_path = ""; | 21 # Options to import from top level Makefile | 
| 19 my $fips_premain_dso_exe_path = ""; |  | 
| 20 my $fips_premain_c_path = ""; |  | 
| 21 my $fips_sha1_exe_path = ""; |  | 
| 22 | 22 | 
| 23 local $fipscanisterbuild = 0; | 23 my %mf_import = ( | 
| 24 local $fipsdso = 0; | 24 »       VERSION»       => \$ssl_version, | 
|  | 25 »       OPTIONS        => \$OPTIONS, | 
|  | 26 »       INSTALLTOP     => \$INSTALLTOP, | 
|  | 27 »       OPENSSLDIR     => \$OPENSSLDIR, | 
|  | 28 »       PLATFORM       => \$mf_platform, | 
|  | 29 »       CFLAG»         => \$mf_cflag, | 
|  | 30 »       DEPFLAG»       => \$mf_depflag, | 
|  | 31 »       CPUID_OBJ      => \$mf_cpuid_asm, | 
|  | 32 »       BN_ASM»        => \$mf_bn_asm, | 
|  | 33 »       DES_ENC»       => \$mf_des_asm, | 
|  | 34 »       AES_ENC        => \$mf_aes_asm, | 
|  | 35 »       BF_ENC»        => \$mf_bf_asm, | 
|  | 36 »       CAST_ENC       => \$mf_cast_asm, | 
|  | 37 »       RC4_ENC»       => \$mf_rc4_asm, | 
|  | 38 »       RC5_ENC        => \$mf_rc5_asm, | 
|  | 39 »       MD5_ASM_OBJ    => \$mf_md5_asm, | 
|  | 40 »       SHA1_ASM_OBJ   => \$mf_sha_asm, | 
|  | 41 »       RMD160_ASM_OBJ => \$mf_rmd_asm, | 
|  | 42 »       WP_ASM_OBJ     => \$mf_wp_asm, | 
|  | 43 »       CMLL_ENC       => \$mf_cm_asm | 
|  | 44 ); | 
| 25 | 45 | 
| 26 my $fipslibdir = ""; |  | 
| 27 my $baseaddr = ""; |  | 
| 28 |  | 
| 29 my $ex_l_libs = ""; |  | 
| 30 | 46 | 
| 31 open(IN,"<Makefile") || die "unable to open Makefile!\n"; | 47 open(IN,"<Makefile") || die "unable to open Makefile!\n"; | 
| 32 while(<IN>) { | 48 while(<IN>) { | 
| 33     $ssl_version=$1 if (/^VERSION=(.*)$/); | 49     my ($mf_opt, $mf_ref); | 
| 34     $OPTIONS=$1 if (/^OPTIONS=(.*)$/); | 50     while (($mf_opt, $mf_ref) = each %mf_import) { | 
| 35     $INSTALLTOP=$1 if (/^INSTALLTOP=(.*$)/); | 51     »   if (/^$mf_opt\s*=\s*(.*)$/) { | 
|  | 52 »          $$mf_ref = $1; | 
|  | 53 »       } | 
|  | 54     } | 
| 36 } | 55 } | 
| 37 close(IN); | 56 close(IN); | 
| 38 | 57 | 
|  | 58 $debug = 1 if $mf_platform =~ /^debug-/; | 
|  | 59 | 
| 39 die "Makefile is not the toplevel Makefile!\n" if $ssl_version eq ""; | 60 die "Makefile is not the toplevel Makefile!\n" if $ssl_version eq ""; | 
| 40 | 61 | 
| 41 $infile="MINFO"; | 62 $infile="MINFO"; | 
| 42 | 63 | 
| 43 %ops=( | 64 %ops=( | 
| 44         "VC-WIN32",   "Microsoft Visual C++ [4-6] - Windows NT or 9X", | 65         "VC-WIN32",   "Microsoft Visual C++ [4-6] - Windows NT or 9X", | 
| 45         "VC-WIN64I",  "Microsoft C/C++ - Win64/IA-64", | 66         "VC-WIN64I",  "Microsoft C/C++ - Win64/IA-64", | 
| 46         "VC-WIN64A",  "Microsoft C/C++ - Win64/x64", | 67         "VC-WIN64A",  "Microsoft C/C++ - Win64/x64", | 
| 47         "VC-CE",   "Microsoft eMbedded Visual C++ 3.0 - Windows CE ONLY", | 68         "VC-CE",   "Microsoft eMbedded Visual C++ 3.0 - Windows CE ONLY", | 
| 48         "VC-NT",   "Microsoft Visual C++ [4-6] - Windows NT ONLY", | 69         "VC-NT",   "Microsoft Visual C++ [4-6] - Windows NT ONLY", | 
| 49         "Mingw32", "GNU C++ - Windows NT or 9x", | 70         "Mingw32", "GNU C++ - Windows NT or 9x", | 
| 50         "Mingw32-files", "Create files with DOS copy ...", | 71         "Mingw32-files", "Create files with DOS copy ...", | 
| 51         "BC-NT",   "Borland C++ 4.5 - Windows NT", | 72         "BC-NT",   "Borland C++ 4.5 - Windows NT", | 
| 52         "linux-elf","Linux elf", | 73         "linux-elf","Linux elf", | 
| 53         "ultrix-mips","DEC mips ultrix", | 74         "ultrix-mips","DEC mips ultrix", | 
| 54         "FreeBSD","FreeBSD distribution", | 75         "FreeBSD","FreeBSD distribution", | 
| 55         "OS2-EMX", "EMX GCC OS/2", | 76         "OS2-EMX", "EMX GCC OS/2", | 
| 56         "netware-clib", "CodeWarrior for NetWare - CLib - with WinSock Sockets", | 77         "netware-clib", "CodeWarrior for NetWare - CLib - with WinSock Sockets", | 
| 57         "netware-clib-bsdsock", "CodeWarrior for NetWare - CLib - with BSD Socke
      ts", | 78         "netware-clib-bsdsock", "CodeWarrior for NetWare - CLib - with BSD Socke
      ts", | 
| 58         "netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets", | 79         "netware-libc", "CodeWarrior for NetWare - LibC - with WinSock Sockets", | 
| 59         "netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Socke
      ts", | 80         "netware-libc-bsdsock", "CodeWarrior for NetWare - LibC - with BSD Socke
      ts", | 
| 60         "default","cc under unix", | 81         "default","cc under unix", | 
|  | 82         "auto", "auto detect from top level Makefile" | 
| 61         ); | 83         ); | 
| 62 | 84 | 
| 63 $platform=""; | 85 $platform=""; | 
| 64 my $xcflags=""; | 86 my $xcflags=""; | 
| 65 foreach (@ARGV) | 87 foreach (@ARGV) | 
| 66         { | 88         { | 
| 67         if (!&read_options && !defined($ops{$_})) | 89         if (!&read_options && !defined($ops{$_})) | 
| 68                 { | 90                 { | 
| 69                 print STDERR "unknown option - $_\n"; | 91                 print STDERR "unknown option - $_\n"; | 
| 70                 print STDERR "usage: perl mk1mf.pl [options] [system]\n"; | 92                 print STDERR "usage: perl mk1mf.pl [options] [system]\n"; | 
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 137 $cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; | 159 $cc=(defined($VARS{'CC'}))?$VARS{'CC'}:'cc'; | 
| 138 $src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.'; | 160 $src_dir=(defined($VARS{'SRC'}))?$VARS{'SRC'}:'.'; | 
| 139 $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; | 161 $bin_dir=(defined($VARS{'BIN'}))?$VARS{'BIN'}:''; | 
| 140 | 162 | 
| 141 # $bin_dir.=$o causes a core dump on my sparc :-( | 163 # $bin_dir.=$o causes a core dump on my sparc :-( | 
| 142 | 164 | 
| 143 | 165 | 
| 144 $NT=0; | 166 $NT=0; | 
| 145 | 167 | 
| 146 push(@INC,"util/pl","pl"); | 168 push(@INC,"util/pl","pl"); | 
|  | 169 | 
|  | 170 if ($platform eq "auto") { | 
|  | 171         $platform = $mf_platform; | 
|  | 172         print STDERR "Imported platform $mf_platform\n"; | 
|  | 173 } | 
|  | 174 | 
| 147 if (($platform =~ /VC-(.+)/)) | 175 if (($platform =~ /VC-(.+)/)) | 
| 148         { | 176         { | 
| 149         $FLAVOR=$1; | 177         $FLAVOR=$1; | 
| 150         $NT = 1 if $1 eq "NT"; | 178         $NT = 1 if $1 eq "NT"; | 
| 151         require 'VC-32.pl'; | 179         require 'VC-32.pl'; | 
| 152         } | 180         } | 
| 153 elsif ($platform eq "Mingw32") | 181 elsif ($platform eq "Mingw32") | 
| 154         { | 182         { | 
| 155         require 'Mingw32.pl'; | 183         require 'Mingw32.pl'; | 
| 156         } | 184         } | 
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 221 $cflags.=" -DOPENSSL_NO_SHA"  if $no_sha; | 249 $cflags.=" -DOPENSSL_NO_SHA"  if $no_sha; | 
| 222 $cflags.=" -DOPENSSL_NO_SHA1" if $no_sha1; | 250 $cflags.=" -DOPENSSL_NO_SHA1" if $no_sha1; | 
| 223 $cflags.=" -DOPENSSL_NO_RIPEMD" if $no_ripemd; | 251 $cflags.=" -DOPENSSL_NO_RIPEMD" if $no_ripemd; | 
| 224 $cflags.=" -DOPENSSL_NO_MDC2" if $no_mdc2; | 252 $cflags.=" -DOPENSSL_NO_MDC2" if $no_mdc2; | 
| 225 $cflags.=" -DOPENSSL_NO_BF"  if $no_bf; | 253 $cflags.=" -DOPENSSL_NO_BF"  if $no_bf; | 
| 226 $cflags.=" -DOPENSSL_NO_CAST" if $no_cast; | 254 $cflags.=" -DOPENSSL_NO_CAST" if $no_cast; | 
| 227 $cflags.=" -DOPENSSL_NO_DES"  if $no_des; | 255 $cflags.=" -DOPENSSL_NO_DES"  if $no_des; | 
| 228 $cflags.=" -DOPENSSL_NO_RSA"  if $no_rsa; | 256 $cflags.=" -DOPENSSL_NO_RSA"  if $no_rsa; | 
| 229 $cflags.=" -DOPENSSL_NO_DSA"  if $no_dsa; | 257 $cflags.=" -DOPENSSL_NO_DSA"  if $no_dsa; | 
| 230 $cflags.=" -DOPENSSL_NO_DH"   if $no_dh; | 258 $cflags.=" -DOPENSSL_NO_DH"   if $no_dh; | 
|  | 259 $cflags.=" -DOPENSSL_NO_WHIRLPOOL"   if $no_whirlpool; | 
| 231 $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock; | 260 $cflags.=" -DOPENSSL_NO_SOCK" if $no_sock; | 
| 232 $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; | 261 $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; | 
| 233 $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; | 262 $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; | 
| 234 $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; | 263 $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; | 
| 235 $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; | 264 $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; | 
| 236 $cflags.=" -DOPENSSL_NO_JPAKE" if $no_jpake; |  | 
| 237 $cflags.=" -DOPENSSL_NO_CAPIENG" if $no_capieng; |  | 
| 238 $cflags.=" -DOPENSSL_NO_ERR"  if $no_err; | 265 $cflags.=" -DOPENSSL_NO_ERR"  if $no_err; | 
| 239 $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; | 266 $cflags.=" -DOPENSSL_NO_KRB5" if $no_krb5; | 
| 240 $cflags.=" -DOPENSSL_NO_EC"   if $no_ec; | 267 $cflags.=" -DOPENSSL_NO_EC"   if $no_ec; | 
| 241 $cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa; | 268 $cflags.=" -DOPENSSL_NO_ECDSA" if $no_ecdsa; | 
| 242 $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; | 269 $cflags.=" -DOPENSSL_NO_ECDH" if $no_ecdh; | 
|  | 270 $cflags.=" -DOPENSSL_NO_GOST" if $no_gost; | 
| 243 $cflags.=" -DOPENSSL_NO_ENGINE"   if $no_engine; | 271 $cflags.=" -DOPENSSL_NO_ENGINE"   if $no_engine; | 
| 244 $cflags.=" -DOPENSSL_NO_HW"   if $no_hw; | 272 $cflags.=" -DOPENSSL_NO_HW"   if $no_hw; | 
| 245 $cflags.=" -DOPENSSL_FIPS"    if $fips; | 273 $cflags.=" -DOPENSSL_NO_JPAKE"    if $no_jpake; | 
| 246 $cflags.= " -DZLIB" if $zlib_opt; | 274 $cflags.= " -DZLIB" if $zlib_opt; | 
| 247 $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; | 275 $cflags.= " -DZLIB_SHARED" if $zlib_opt == 2; | 
| 248 | 276 | 
| 249 if ($no_static_engine) | 277 if ($no_static_engine) | 
| 250         { | 278         { | 
| 251         $cflags .= " -DOPENSSL_NO_STATIC_ENGINE"; | 279         $cflags .= " -DOPENSSL_NO_STATIC_ENGINE"; | 
| 252         } | 280         } | 
| 253 else | 281 else | 
| 254         { | 282         { | 
| 255         $cflags .= " -DOPENSSL_NO_DYNAMIC_ENGINE"; | 283         $cflags .= " -DOPENSSL_NO_DYNAMIC_ENGINE"; | 
| 256         } | 284         } | 
| 257 | 285 | 
| 258 #$cflags.=" -DRSAref"  if $rsaref ne ""; | 286 #$cflags.=" -DRSAref"  if $rsaref ne ""; | 
| 259 | 287 | 
| 260 ## if ($unix) | 288 ## if ($unix) | 
| 261 ##      { $cflags="$c_flags" if ($c_flags ne ""); } | 289 ##      { $cflags="$c_flags" if ($c_flags ne ""); } | 
| 262 ##else | 290 ##else | 
| 263         { $cflags="$c_flags$cflags" if ($c_flags ne ""); } | 291         { $cflags="$c_flags$cflags" if ($c_flags ne ""); } | 
| 264 | 292 | 
| 265 $ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); | 293 $ex_libs="$l_flags$ex_libs" if ($l_flags ne ""); | 
| 266 | 294 | 
|  | 295 | 
| 267 %shlib_ex_cflags=("SSL" => " -DOPENSSL_BUILD_SHLIBSSL", | 296 %shlib_ex_cflags=("SSL" => " -DOPENSSL_BUILD_SHLIBSSL", | 
| 268 »       »         "CRYPTO" => " -DOPENSSL_BUILD_SHLIBCRYPTO", | 297 »       »         "CRYPTO" => " -DOPENSSL_BUILD_SHLIBCRYPTO"); | 
| 269 »       »         "FIPS" => " -DOPENSSL_BUILD_SHLIBCRYPTO"); |  | 
| 270 | 298 | 
| 271 if ($msdos) | 299 if ($msdos) | 
| 272         { | 300         { | 
| 273         $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in 
      the\n"; | 301         $banner ="\t\@echo Make sure you have run 'perl Configure $platform' in 
      the\n"; | 
| 274         $banner.="\t\@echo top level directory, if you don't have perl, you will
      \n"; | 302         $banner.="\t\@echo top level directory, if you don't have perl, you will
      \n"; | 
| 275         $banner.="\t\@echo need to probably edit crypto/bn/bn.h, check the\n"; | 303         $banner.="\t\@echo need to probably edit crypto/bn/bn.h, check the\n"; | 
| 276         $banner.="\t\@echo documentation for details.\n"; | 304         $banner.="\t\@echo documentation for details.\n"; | 
| 277         } | 305         } | 
| 278 | 306 | 
| 279 # have to do this to allow $(CC) under unix | 307 # have to do this to allow $(CC) under unix | 
| 280 $link="$bin_dir$link" if ($link !~ /^\$/); | 308 $link="$bin_dir$link" if ($link !~ /^\$/); | 
| 281 | 309 | 
| 282 $INSTALLTOP =~ s|/|$o|g; | 310 $INSTALLTOP =~ s|/|$o|g; | 
|  | 311 $OPENSSLDIR =~ s|/|$o|g; | 
| 283 | 312 | 
| 284 ############################################# | 313 ############################################# | 
| 285 # We parse in input file and 'store' info for later printing. | 314 # We parse in input file and 'store' info for later printing. | 
| 286 open(IN,"<$infile") || die "unable to open $infile:$!\n"; | 315 open(IN,"<$infile") || die "unable to open $infile:$!\n"; | 
| 287 $_=<IN>; | 316 $_=<IN>; | 
| 288 for (;;) | 317 for (;;) | 
| 289         { | 318         { | 
| 290         chop; | 319         chop; | 
| 291 | 320 | 
| 292         ($key,$val)=/^([^=]+)=(.*)/; | 321         ($key,$val)=/^([^=]+)=(.*)/; | 
| 293         if ($key eq "RELATIVE_DIRECTORY") | 322         if ($key eq "RELATIVE_DIRECTORY") | 
| 294                 { | 323                 { | 
| 295                 if ($lib ne "") | 324                 if ($lib ne "") | 
| 296                         { | 325                         { | 
| 297  »      »       »       if ($fips && $dir =~ /^fips/) | 326 »       »       »       $uc=$lib; | 
| 298  »      »       »       »       { | 327 »       »       »       $uc =~ s/^lib(.*)\.a/$1/; | 
| 299  »      »       »       »       $uc = "FIPS"; | 328 »       »       »       $uc =~ tr/a-z/A-Z/; | 
| 300  »      »       »       »       } | 329 »       »       »       $lib_nam{$uc}=$uc; | 
| 301  »      »       »       else | 330 »       »       »       $lib_obj{$uc}.=$libobj." "; | 
| 302  »      »       »       »       { |  | 
| 303  »      »       »       »       $uc=$lib; |  | 
| 304  »      »       »       »       $uc =~ s/^lib(.*)\.a/$1/; |  | 
| 305  »      »       »       »       $uc =~ tr/a-z/A-Z/; |  | 
| 306 »       »       »       »       } |  | 
| 307 »       »       »       if (($uc ne "FIPS") || $fipscanisterbuild) |  | 
| 308 »       »       »       »       { |  | 
| 309 »       »       »       »       $lib_nam{$uc}=$uc; |  | 
| 310 »       »       »       »       $lib_obj{$uc}.=$libobj." "; |  | 
| 311 »       »       »       »       } |  | 
| 312                         } | 331                         } | 
| 313                 last if ($val eq "FINISHED"); | 332                 last if ($val eq "FINISHED"); | 
| 314                 $lib=""; | 333                 $lib=""; | 
| 315                 $libobj=""; | 334                 $libobj=""; | 
| 316                 $dir=$val; | 335                 $dir=$val; | 
| 317                 } | 336                 } | 
| 318 | 337 | 
| 319         if ($key eq "KRB5_INCLUDES") | 338         if ($key eq "KRB5_INCLUDES") | 
| 320                 { $cflags .= " $val";} | 339                 { $cflags .= " $val";} | 
| 321 | 340 | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 332                 { $test.=&var_add($dir,$val, 0); } | 351                 { $test.=&var_add($dir,$val, 0); } | 
| 333 | 352 | 
| 334         if (($key eq "PROGS") || ($key eq "E_OBJ")) | 353         if (($key eq "PROGS") || ($key eq "E_OBJ")) | 
| 335                 { $e_exe.=&var_add($dir,$val, 0); } | 354                 { $e_exe.=&var_add($dir,$val, 0); } | 
| 336 | 355 | 
| 337         if ($key eq "LIB") | 356         if ($key eq "LIB") | 
| 338                 { | 357                 { | 
| 339                 $lib=$val; | 358                 $lib=$val; | 
| 340                 $lib =~ s/^.*\/([^\/]+)$/$1/; | 359                 $lib =~ s/^.*\/([^\/]+)$/$1/; | 
| 341                 } | 360                 } | 
|  | 361         if ($key eq "LIBNAME" && $no_static_engine) | 
|  | 362                 { | 
|  | 363                 $lib=$val; | 
|  | 364                 $lib =~ s/^.*\/([^\/]+)$/$1/; | 
|  | 365                 $otherlibs .= " $lib"; | 
|  | 366                 } | 
| 342 | 367 | 
| 343         if ($key eq "EXHEADER") | 368         if ($key eq "EXHEADER") | 
| 344                 { $exheader.=&var_add($dir,$val, 1); } | 369                 { $exheader.=&var_add($dir,$val, 1); } | 
| 345 | 370 | 
| 346         if ($key eq "HEADER") | 371         if ($key eq "HEADER") | 
| 347                 { $header.=&var_add($dir,$val, 1); } | 372                 { $header.=&var_add($dir,$val, 1); } | 
| 348 | 373 | 
| 349         if ($key eq "LIBOBJ" && ($dir ne "engines" || !$no_static_engine)) | 374         if ($key eq "LIBOBJ" && ($dir ne "engines" || !$no_static_engine)) | 
| 350                 { $libobj=&var_add($dir,$val, 0); } | 375                 { $libobj=&var_add($dir,$val, 0); } | 
| 351         if ($key eq "LIBNAMES" && $dir eq "engines" && $no_static_engine) | 376         if ($key eq "LIBNAMES" && $dir eq "engines" && $no_static_engine) | 
| 352                 { $engines.=$val } | 377                 { $engines.=$val } | 
| 353 | 378 | 
| 354         if ($key eq "FIPS_EX_OBJ") |  | 
| 355                 { |  | 
| 356                 $fips_ex_obj=&var_add("crypto",$val,0); |  | 
| 357                 } |  | 
| 358 |  | 
| 359         if ($key eq "FIPSLIBDIR") |  | 
| 360                 { |  | 
| 361                 $fipslibdir=$val; |  | 
| 362                 $fipslibdir =~ s/\/$//; |  | 
| 363                 $fipslibdir =~ s/\//$o/g; |  | 
| 364                 } |  | 
| 365 |  | 
| 366         if ($key eq "BASEADDR") |  | 
| 367                 { $baseaddr=$val;} |  | 
| 368 |  | 
| 369         if (!($_=<IN>)) | 379         if (!($_=<IN>)) | 
| 370                 { $_="RELATIVE_DIRECTORY=FINISHED\n"; } | 380                 { $_="RELATIVE_DIRECTORY=FINISHED\n"; } | 
| 371         } | 381         } | 
| 372 close(IN); | 382 close(IN); | 
| 373 | 383 | 
| 374 if ($fips) |  | 
| 375         { |  | 
| 376 |  | 
| 377         foreach (split " ", $fips_ex_obj) |  | 
| 378                 { |  | 
| 379                 $fips_exclude_obj{$1} = 1 if (/\/([^\/]*)$/); |  | 
| 380                 } |  | 
| 381 |  | 
| 382         $fips_exclude_obj{"cpu_win32"} = 1; |  | 
| 383         $fips_exclude_obj{"bn_asm"} = 1; |  | 
| 384         $fips_exclude_obj{"des_enc"} = 1; |  | 
| 385         $fips_exclude_obj{"fcrypt_b"} = 1; |  | 
| 386         $fips_exclude_obj{"aes_core"} = 1; |  | 
| 387         $fips_exclude_obj{"aes_cbc"} = 1; |  | 
| 388 |  | 
| 389         my @ltmp = split " ", $lib_obj{"CRYPTO"}; |  | 
| 390 |  | 
| 391 |  | 
| 392         $lib_obj{"CRYPTO"} = ""; |  | 
| 393 |  | 
| 394         foreach(@ltmp) |  | 
| 395                 { |  | 
| 396                 if (/\/([^\/]*)$/ && exists $fips_exclude_obj{$1}) |  | 
| 397                         { |  | 
| 398                         if ($fipscanisterbuild) |  | 
| 399                                 { |  | 
| 400                                 $lib_obj{"FIPS"} .= "$_ "; |  | 
| 401                                 } |  | 
| 402                         } |  | 
| 403                 else |  | 
| 404                         { |  | 
| 405                         $lib_obj{"CRYPTO"} .= "$_ "; |  | 
| 406                         } |  | 
| 407                 } |  | 
| 408 |  | 
| 409         } |  | 
| 410 |  | 
| 411 if ($fipscanisterbuild) |  | 
| 412         { |  | 
| 413         $fips_canister_path = "\$(LIB_D)${o}fipscanister.lib" if $fips_canister_
      path eq ""; |  | 
| 414         $fips_premain_c_path = "\$(LIB_D)${o}fips_premain.c"; |  | 
| 415         } |  | 
| 416 else |  | 
| 417         { |  | 
| 418         if ($fips_canister_path eq "") |  | 
| 419                 { |  | 
| 420                 $fips_canister_path = "\$(FIPSLIB_D)${o}fipscanister.lib"; |  | 
| 421                 } |  | 
| 422 |  | 
| 423         if ($fips_premain_c_path eq "") |  | 
| 424                 { |  | 
| 425                 $fips_premain_c_path = "\$(FIPSLIB_D)${o}fips_premain.c"; |  | 
| 426                 } |  | 
| 427         } |  | 
| 428 |  | 
| 429 if ($fips) |  | 
| 430         { |  | 
| 431         if ($fips_sha1_exe_path eq "") |  | 
| 432                 { |  | 
| 433                 $fips_sha1_exe_path = |  | 
| 434                         "\$(BIN_D)${o}fips_standalone_sha1$exep"; |  | 
| 435                 } |  | 
| 436         } |  | 
| 437         else |  | 
| 438         { |  | 
| 439         $fips_sha1_exe_path = ""; |  | 
| 440         } |  | 
| 441 |  | 
| 442 if ($fips_premain_dso_exe_path eq "") |  | 
| 443         { |  | 
| 444         $fips_premain_dso_exe_path = "\$(BIN_D)${o}fips_premain_dso$exep"; |  | 
| 445         } |  | 
| 446 |  | 
| 447 #       $ex_build_targets .= "\$(BIN_D)${o}\$(E_PREMAIN_DSO)$exep" if ($fips); |  | 
| 448 |  | 
| 449 #$ex_l_libs .= " \$(L_FIPS)" if $fipsdso; |  | 
| 450 |  | 
| 451 if ($fips) |  | 
| 452         { |  | 
| 453         if (!$shlib) |  | 
| 454                 { |  | 
| 455                 $ex_build_targets .= " \$(LIB_D)$o$crypto_compat \$(PREMAIN_DSO_
      EXE)"; |  | 
| 456                 $ex_l_libs .= " \$(O_FIPSCANISTER)"; |  | 
| 457                 $ex_libs_dep .= " \$(O_FIPSCANISTER)" if $fipscanisterbuild; |  | 
| 458                 } |  | 
| 459         if ($fipscanisterbuild) |  | 
| 460                 { |  | 
| 461                 $fipslibdir = "\$(LIB_D)"; |  | 
| 462                 } |  | 
| 463         else |  | 
| 464                 { |  | 
| 465                 if ($fipslibdir eq "") |  | 
| 466                         { |  | 
| 467                         open (IN, "util/fipslib_path.txt") || fipslib_error(); |  | 
| 468                         $fipslibdir = <IN>; |  | 
| 469                         chomp $fipslibdir; |  | 
| 470                         close IN; |  | 
| 471                         } |  | 
| 472                 fips_check_files($fipslibdir, |  | 
| 473                                 "fipscanister.lib", "fipscanister.lib.sha1", |  | 
| 474                                 "fips_premain.c", "fips_premain.c.sha1"); |  | 
| 475                 } |  | 
| 476         } |  | 
| 477 |  | 
| 478 if ($shlib) | 384 if ($shlib) | 
| 479         { | 385         { | 
| 480         $extra_install= <<"EOF"; | 386         $extra_install= <<"EOF"; | 
| 481         \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}bin\" | 387         \$(CP) \"\$(O_SSL)\" \"\$(INSTALLTOP)${o}bin\" | 
| 482         \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}bin\" | 388         \$(CP) \"\$(O_CRYPTO)\" \"\$(INSTALLTOP)${o}bin\" | 
| 483         \$(CP) \"\$(L_SSL)\" \"\$(INSTALLTOP)${o}lib\" | 389         \$(CP) \"\$(L_SSL)\" \"\$(INSTALLTOP)${o}lib\" | 
| 484         \$(CP) \"\$(L_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" | 390         \$(CP) \"\$(L_CRYPTO)\" \"\$(INSTALLTOP)${o}lib\" | 
| 485 EOF | 391 EOF | 
| 486         if ($no_static_engine) | 392         if ($no_static_engine) | 
| 487                 { | 393                 { | 
| (...skipping 25 matching lines...) Expand all  Loading... | 
| 513 # library and also so I can 'distribute' indervidual library sections. | 419 # library and also so I can 'distribute' indervidual library sections. | 
| 514 # The one monster makefile better suits building in non-unix | 420 # The one monster makefile better suits building in non-unix | 
| 515 # environments. | 421 # environments. | 
| 516 | 422 | 
| 517 EOF | 423 EOF | 
| 518 | 424 | 
| 519 $defs .= $preamble if defined $preamble; | 425 $defs .= $preamble if defined $preamble; | 
| 520 | 426 | 
| 521 $defs.= <<"EOF"; | 427 $defs.= <<"EOF"; | 
| 522 INSTALLTOP=$INSTALLTOP | 428 INSTALLTOP=$INSTALLTOP | 
|  | 429 OPENSSLDIR=$OPENSSLDIR | 
| 523 | 430 | 
| 524 # Set your compiler options | 431 # Set your compiler options | 
| 525 PLATFORM=$platform | 432 PLATFORM=$platform | 
| 526 CC=$bin_dir${cc} | 433 CC=$bin_dir${cc} | 
| 527 CFLAG=$cflags | 434 CFLAG=$cflags | 
| 528 APP_CFLAG=$app_cflag | 435 APP_CFLAG=$app_cflag | 
| 529 LIB_CFLAG=$lib_cflag | 436 LIB_CFLAG=$lib_cflag | 
| 530 SHLIB_CFLAG=$shl_cflag | 437 SHLIB_CFLAG=$shl_cflag | 
| 531 APP_EX_OBJ=$app_ex_obj | 438 APP_EX_OBJ=$app_ex_obj | 
| 532 SHLIB_EX_OBJ=$shlib_ex_obj | 439 SHLIB_EX_OBJ=$shlib_ex_obj | 
| 533 # add extra libraries to this define, for solaris -lsocket -lnsl would | 440 # add extra libraries to this define, for solaris -lsocket -lnsl would | 
| 534 # be added | 441 # be added | 
| 535 EX_LIBS=$ex_libs | 442 EX_LIBS=$ex_libs | 
| 536 | 443 | 
| 537 # The OpenSSL directory | 444 # The OpenSSL directory | 
| 538 SRC_D=$src_dir | 445 SRC_D=$src_dir | 
| 539 | 446 | 
| 540 LINK=$link | 447 LINK=$link | 
| 541 LFLAGS=$lflags | 448 LFLAGS=$lflags | 
| 542 RSC=$rsc | 449 RSC=$rsc | 
| 543 FIPSLINK=\$(PERL) util${o}fipslink.pl |  | 
| 544 |  | 
| 545 AES_ASM_OBJ=$aes_asm_obj |  | 
| 546 AES_ASM_SRC=$aes_asm_src |  | 
| 547 BN_ASM_OBJ=$bn_asm_obj |  | 
| 548 BN_ASM_SRC=$bn_asm_src |  | 
| 549 BNCO_ASM_OBJ=$bnco_asm_obj |  | 
| 550 BNCO_ASM_SRC=$bnco_asm_src |  | 
| 551 DES_ENC_OBJ=$des_enc_obj |  | 
| 552 DES_ENC_SRC=$des_enc_src |  | 
| 553 BF_ENC_OBJ=$bf_enc_obj |  | 
| 554 BF_ENC_SRC=$bf_enc_src |  | 
| 555 CAST_ENC_OBJ=$cast_enc_obj |  | 
| 556 CAST_ENC_SRC=$cast_enc_src |  | 
| 557 RC4_ENC_OBJ=$rc4_enc_obj |  | 
| 558 RC4_ENC_SRC=$rc4_enc_src |  | 
| 559 RC5_ENC_OBJ=$rc5_enc_obj |  | 
| 560 RC5_ENC_SRC=$rc5_enc_src |  | 
| 561 MD5_ASM_OBJ=$md5_asm_obj |  | 
| 562 MD5_ASM_SRC=$md5_asm_src |  | 
| 563 SHA1_ASM_OBJ=$sha1_asm_obj |  | 
| 564 SHA1_ASM_SRC=$sha1_asm_src |  | 
| 565 RMD160_ASM_OBJ=$rmd160_asm_obj |  | 
| 566 RMD160_ASM_SRC=$rmd160_asm_src |  | 
| 567 CPUID_ASM_OBJ=$cpuid_asm_obj |  | 
| 568 CPUID_ASM_SRC=$cpuid_asm_src |  | 
| 569 | 450 | 
| 570 # The output directory for everything intersting | 451 # The output directory for everything intersting | 
| 571 OUT_D=$out_dir | 452 OUT_D=$out_dir | 
| 572 # The output directory for all the temporary muck | 453 # The output directory for all the temporary muck | 
| 573 TMP_D=$tmp_dir | 454 TMP_D=$tmp_dir | 
| 574 # The output directory for the header files | 455 # The output directory for the header files | 
| 575 INC_D=$inc_dir | 456 INC_D=$inc_dir | 
| 576 INCO_D=$inc_dir${o}openssl | 457 INCO_D=$inc_dir${o}openssl | 
| 577 | 458 | 
| 578 PERL=$perl | 459 PERL=$perl | 
| 579 CP=$cp | 460 CP=$cp | 
| 580 RM=$rm | 461 RM=$rm | 
| 581 RANLIB=$ranlib | 462 RANLIB=$ranlib | 
| 582 MKDIR=$mkdir | 463 MKDIR=$mkdir | 
| 583 MKLIB=$bin_dir$mklib | 464 MKLIB=$bin_dir$mklib | 
| 584 MLFLAGS=$mlflags | 465 MLFLAGS=$mlflags | 
| 585 ASM=$bin_dir$asm | 466 ASM=$bin_dir$asm | 
| 586 | 467 | 
| 587 # FIPS validated module and support file locations |  | 
| 588 |  | 
| 589 E_PREMAIN_DSO=fips_premain_dso |  | 
| 590 |  | 
| 591 FIPSLIB_D=$fipslibdir |  | 
| 592 BASEADDR=$baseaddr |  | 
| 593 FIPS_PREMAIN_SRC=$fips_premain_c_path |  | 
| 594 O_FIPSCANISTER=$fips_canister_path |  | 
| 595 FIPS_SHA1_EXE=$fips_sha1_exe_path |  | 
| 596 PREMAIN_DSO_EXE=$fips_premain_dso_exe_path |  | 
| 597 |  | 
| 598 ###################################################### | 468 ###################################################### | 
| 599 # You should not need to touch anything below this point | 469 # You should not need to touch anything below this point | 
| 600 ###################################################### | 470 ###################################################### | 
| 601 | 471 | 
| 602 E_EXE=openssl | 472 E_EXE=openssl | 
| 603 SSL=$ssl | 473 SSL=$ssl | 
| 604 CRYPTO=$crypto | 474 CRYPTO=$crypto | 
| 605 LIBFIPS=libosslfips |  | 
| 606 | 475 | 
| 607 # BIN_D  - Binary output directory | 476 # BIN_D  - Binary output directory | 
| 608 # TEST_D - Binary test file output directory | 477 # TEST_D - Binary test file output directory | 
| 609 # LIB_D  - library output directory | 478 # LIB_D  - library output directory | 
| 610 # ENG_D  - dynamic engine output directory | 479 # ENG_D  - dynamic engine output directory | 
| 611 # Note: if you change these point to different directories then uncomment out | 480 # Note: if you change these point to different directories then uncomment out | 
| 612 # the lines around the 'NB' comment below. | 481 # the lines around the 'NB' comment below. | 
| 613 # | 482 # | 
| 614 BIN_D=\$(OUT_D) | 483 BIN_D=\$(OUT_D) | 
| 615 TEST_D=\$(OUT_D) | 484 TEST_D=\$(OUT_D) | 
| 616 LIB_D=\$(OUT_D) | 485 LIB_D=\$(OUT_D) | 
| 617 ENG_D=\$(OUT_D) | 486 ENG_D=\$(OUT_D) | 
| 618 | 487 | 
| 619 # INCL_D - local library directory | 488 # INCL_D - local library directory | 
| 620 # OBJ_D  - temp object file directory | 489 # OBJ_D  - temp object file directory | 
| 621 OBJ_D=\$(TMP_D) | 490 OBJ_D=\$(TMP_D) | 
| 622 INCL_D=\$(TMP_D) | 491 INCL_D=\$(TMP_D) | 
| 623 | 492 | 
| 624 O_SSL=     \$(LIB_D)$o$plib\$(SSL)$shlibp | 493 O_SSL=     \$(LIB_D)$o$plib\$(SSL)$shlibp | 
| 625 O_CRYPTO=  \$(LIB_D)$o$plib\$(CRYPTO)$shlibp | 494 O_CRYPTO=  \$(LIB_D)$o$plib\$(CRYPTO)$shlibp | 
| 626 O_FIPS=    \$(LIB_D)$o$plib\$(LIBFIPS)$shlibp |  | 
| 627 SO_SSL=    $plib\$(SSL)$so_shlibp | 495 SO_SSL=    $plib\$(SSL)$so_shlibp | 
| 628 SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp | 496 SO_CRYPTO= $plib\$(CRYPTO)$so_shlibp | 
| 629 L_SSL=     \$(LIB_D)$o$plib\$(SSL)$libp | 497 L_SSL=     \$(LIB_D)$o$plib\$(SSL)$libp | 
| 630 L_CRYPTO=  \$(LIB_D)$o$plib\$(CRYPTO)$libp | 498 L_CRYPTO=  \$(LIB_D)$o$plib\$(CRYPTO)$libp | 
| 631 L_FIPS=    \$(LIB_D)$o$plib\$(LIBFIPS)$libp |  | 
| 632 | 499 | 
| 633 L_LIBS= \$(L_SSL) \$(L_CRYPTO) $ex_l_libs | 500 L_LIBS= \$(L_SSL) \$(L_CRYPTO) | 
| 634 | 501 | 
| 635 ###################################################### | 502 ###################################################### | 
| 636 # Don't touch anything below this point | 503 # Don't touch anything below this point | 
| 637 ###################################################### | 504 ###################################################### | 
| 638 | 505 | 
| 639 INC=-I\$(INC_D) -I\$(INCL_D) | 506 INC=-I\$(INC_D) -I\$(INCL_D) | 
| 640 APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG) | 507 APP_CFLAGS=\$(INC) \$(CFLAG) \$(APP_CFLAG) | 
| 641 LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) | 508 LIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) | 
| 642 SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG) | 509 SHLIB_CFLAGS=\$(INC) \$(CFLAG) \$(LIB_CFLAG) \$(SHLIB_CFLAG) | 
| 643 LIBS_DEP=\$(O_CRYPTO) \$(O_SSL) $ex_libs_dep | 510 LIBS_DEP=\$(O_CRYPTO) \$(O_SSL) | 
| 644 | 511 | 
| 645 ############################################# | 512 ############################################# | 
| 646 EOF | 513 EOF | 
| 647 | 514 | 
| 648 $rules=<<"EOF"; | 515 $rules=<<"EOF"; | 
| 649 all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers \$(FIPS_
      SHA1_EXE) lib exe $ex_build_targets | 516 all: banner \$(TMP_D) \$(BIN_D) \$(TEST_D) \$(LIB_D) \$(INCO_D) headers lib exe | 
| 650 | 517 | 
| 651 banner: | 518 banner: | 
| 652 $banner | 519 $banner | 
| 653 | 520 | 
| 654 \$(TMP_D): | 521 \$(TMP_D): | 
| 655         \$(MKDIR) \"\$(TMP_D)\" | 522         \$(MKDIR) \"\$(TMP_D)\" | 
| 656 # NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different | 523 # NB: uncomment out these lines if BIN_D, TEST_D and LIB_D are different | 
| 657 #\$(BIN_D): | 524 #\$(BIN_D): | 
| 658 #       \$(MKDIR) \$(BIN_D) | 525 #       \$(MKDIR) \$(BIN_D) | 
| 659 # | 526 # | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 676 | 543 | 
| 677 exe: \$(T_EXE) \$(BIN_D)$o\$(E_EXE)$exep | 544 exe: \$(T_EXE) \$(BIN_D)$o\$(E_EXE)$exep | 
| 678 | 545 | 
| 679 install: all | 546 install: all | 
| 680         \$(MKDIR) \"\$(INSTALLTOP)\" | 547         \$(MKDIR) \"\$(INSTALLTOP)\" | 
| 681         \$(MKDIR) \"\$(INSTALLTOP)${o}bin\" | 548         \$(MKDIR) \"\$(INSTALLTOP)${o}bin\" | 
| 682         \$(MKDIR) \"\$(INSTALLTOP)${o}include\" | 549         \$(MKDIR) \"\$(INSTALLTOP)${o}include\" | 
| 683         \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\" | 550         \$(MKDIR) \"\$(INSTALLTOP)${o}include${o}openssl\" | 
| 684         \$(MKDIR) \"\$(INSTALLTOP)${o}lib\" | 551         \$(MKDIR) \"\$(INSTALLTOP)${o}lib\" | 
| 685         \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl
      \" | 552         \$(CP) \"\$(INCO_D)${o}*.\[ch\]\" \"\$(INSTALLTOP)${o}include${o}openssl
      \" | 
| 686 »       \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep\" \"\$(INSTALLTOP)${o}bin\" | 553 »       \$(CP) \"\$(BIN_D)$o\$(E_EXE)$exep \$(INSTALLTOP)${o}bin\" | 
| 687 »       \$(CP) \"apps${o}openssl.cnf\" \"\$(INSTALLTOP)\" | 554 »       \$(MKDIR) \"\$(OPENSSLDIR)\" | 
|  | 555 »       \$(CP) apps${o}openssl.cnf \"\$(OPENSSLDIR)\" | 
| 688 $extra_install | 556 $extra_install | 
| 689 | 557 | 
| 690 | 558 | 
| 691 test: \$(T_EXE) | 559 test: \$(T_EXE) | 
| 692         cd \$(BIN_D) | 560         cd \$(BIN_D) | 
| 693         ..${o}ms${o}test | 561         ..${o}ms${o}test | 
| 694 | 562 | 
| 695 clean: | 563 clean: | 
| 696         \$(RM) \$(TMP_D)$o*.* | 564         \$(RM) \$(TMP_D)$o*.* | 
| 697 | 565 | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 754 | 622 | 
| 755 $defs.=&do_defs("EXHEADER",$exheader,"\$(INCO_D)",""); | 623 $defs.=&do_defs("EXHEADER",$exheader,"\$(INCO_D)",""); | 
| 756 $rules.=&do_copy_rule("\$(INCO_D)",$exheader,""); | 624 $rules.=&do_copy_rule("\$(INCO_D)",$exheader,""); | 
| 757 | 625 | 
| 758 $defs.=&do_defs("T_OBJ",$test,"\$(OBJ_D)",$obj); | 626 $defs.=&do_defs("T_OBJ",$test,"\$(OBJ_D)",$obj); | 
| 759 $rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)"); | 627 $rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)"); | 
| 760 | 628 | 
| 761 $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); | 629 $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); | 
| 762 $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); | 630 $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); | 
| 763 | 631 | 
| 764 # Special case rules for fips_start and fips_end fips_premain_dso |  | 
| 765 |  | 
| 766 if ($fips) |  | 
| 767         { |  | 
| 768         if ($fipscanisterbuild) |  | 
| 769                 { |  | 
| 770                 $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_start$obj", |  | 
| 771                         "fips${o}fips_canister.c", |  | 
| 772                         "-DFIPS_START \$(SHLIB_CFLAGS)"); |  | 
| 773                 $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_end$obj", |  | 
| 774                         "fips${o}fips_canister.c", "\$(SHLIB_CFLAGS)"); |  | 
| 775                 } |  | 
| 776         $rules.=&cc_compile_target("\$(OBJ_D)${o}fips_standalone_sha1$obj", |  | 
| 777                 "fips${o}sha${o}fips_standalone_sha1.c", |  | 
| 778                 "\$(SHLIB_CFLAGS)"); |  | 
| 779         $rules.=&cc_compile_target("\$(OBJ_D)${o}\$(E_PREMAIN_DSO)$obj", |  | 
| 780                 "fips${o}fips_premain.c", |  | 
| 781                 "-DFINGERPRINT_PREMAIN_DSO_LOAD \$(SHLIB_CFLAGS)"); |  | 
| 782         } |  | 
| 783 |  | 
| 784 foreach (values %lib_nam) | 632 foreach (values %lib_nam) | 
| 785         { | 633         { | 
| 786         $lib_obj=$lib_obj{$_}; | 634         $lib_obj=$lib_obj{$_}; | 
| 787         local($slib)=$shlib; | 635         local($slib)=$shlib; | 
| 788 | 636 | 
| 789         if (($_ eq "SSL") && $no_ssl2 && $no_ssl3) | 637         if (($_ eq "SSL") && $no_ssl2 && $no_ssl3) | 
| 790                 { | 638                 { | 
| 791                 $rules.="\$(O_SSL):\n\n"; | 639                 $rules.="\$(O_SSL):\n\n"; | 
| 792                 next; | 640                 next; | 
| 793                 } | 641                 } | 
| 794 | 642 | 
| 795         if ((!$fips && ($_ eq "CRYPTO")) || ($fips && ($_ eq "FIPS"))) |  | 
| 796                 { |  | 
| 797                 if ($cpuid_asm_obj ne "") |  | 
| 798                         { |  | 
| 799                         $lib_obj =~ s/(\S*\/cryptlib\S*)/$1 \$(CPUID_ASM_OBJ)/; |  | 
| 800                         $rules.=&do_asm_rule($cpuid_asm_obj,$cpuid_asm_src); |  | 
| 801                         } |  | 
| 802                 if ($aes_asm_obj ne "") |  | 
| 803                         { |  | 
| 804                         $lib_obj =~ s/\s(\S*\/aes_core\S*)/ \$(AES_ASM_OBJ)/; |  | 
| 805                         $lib_obj =~ s/\s\S*\/aes_cbc\S*//; |  | 
| 806                         $rules.=&do_asm_rule($aes_asm_obj,$aes_asm_src); |  | 
| 807                         } |  | 
| 808                 if ($sha1_asm_obj ne "") |  | 
| 809                         { |  | 
| 810                         $lib_obj =~ s/\s(\S*\/sha1dgst\S*)/ $1 \$(SHA1_ASM_OBJ)/
      ; |  | 
| 811                         $rules.=&do_asm_rule($sha1_asm_obj,$sha1_asm_src); |  | 
| 812                         } |  | 
| 813                 if ($bn_asm_obj ne "") |  | 
| 814                         { |  | 
| 815                         $lib_obj =~ s/\s\S*\/bn_asm\S*/ \$(BN_ASM_OBJ)/; |  | 
| 816                         $rules.=&do_asm_rule($bn_asm_obj,$bn_asm_src); |  | 
| 817                         } |  | 
| 818                 if ($bnco_asm_obj ne "") |  | 
| 819                         { |  | 
| 820                         $lib_obj .= "\$(BNCO_ASM_OBJ)"; |  | 
| 821                         $rules.=&do_asm_rule($bnco_asm_obj,$bnco_asm_src); |  | 
| 822                         } |  | 
| 823                 if ($des_enc_obj ne "") |  | 
| 824                         { |  | 
| 825                         $lib_obj =~ s/\s\S*des_enc\S*/ \$(DES_ENC_OBJ)/; |  | 
| 826                         $lib_obj =~ s/\s\S*\/fcrypt_b\S*\s*/ /; |  | 
| 827                         $rules.=&do_asm_rule($des_enc_obj,$des_enc_src); |  | 
| 828                         } |  | 
| 829                 } |  | 
| 830         if (($bf_enc_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 831                 { |  | 
| 832                 $lib_obj =~ s/\s\S*\/bf_enc\S*/ \$(BF_ENC_OBJ)/; |  | 
| 833                 $rules.=&do_asm_rule($bf_enc_obj,$bf_enc_src); |  | 
| 834                 } |  | 
| 835         if (($cast_enc_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 836                 { |  | 
| 837                 $lib_obj =~ s/(\s\S*\/c_enc\S*)/ \$(CAST_ENC_OBJ)/; |  | 
| 838                 $rules.=&do_asm_rule($cast_enc_obj,$cast_enc_src); |  | 
| 839                 } |  | 
| 840         if (($rc4_enc_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 841                 { |  | 
| 842                 $lib_obj =~ s/\s\S*\/rc4_enc\S*/ \$(RC4_ENC_OBJ)/; |  | 
| 843                 $rules.=&do_asm_rule($rc4_enc_obj,$rc4_enc_src); |  | 
| 844                 } |  | 
| 845         if (($rc5_enc_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 846                 { |  | 
| 847                 $lib_obj =~ s/\s\S*\/rc5_enc\S*/ \$(RC5_ENC_OBJ)/; |  | 
| 848                 $rules.=&do_asm_rule($rc5_enc_obj,$rc5_enc_src); |  | 
| 849                 } |  | 
| 850         if (($md5_asm_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 851                 { |  | 
| 852                 $lib_obj =~ s/\s(\S*\/md5_dgst\S*)/ $1 \$(MD5_ASM_OBJ)/; |  | 
| 853                 $rules.=&do_asm_rule($md5_asm_obj,$md5_asm_src); |  | 
| 854                 } |  | 
| 855         if (($rmd160_asm_obj ne "") && ($_ eq "CRYPTO")) |  | 
| 856                 { |  | 
| 857                 $lib_obj =~ s/\s(\S*\/rmd_dgst\S*)/ $1 \$(RMD160_ASM_OBJ)/; |  | 
| 858                 $rules.=&do_asm_rule($rmd160_asm_obj,$rmd160_asm_src); |  | 
| 859                 } |  | 
| 860         $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); | 643         $defs.=&do_defs(${_}."OBJ",$lib_obj,"\$(OBJ_D)",$obj); | 
| 861         $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)"; | 644         $lib=($slib)?" \$(SHLIB_CFLAGS)".$shlib_ex_cflags{$_}:" \$(LIB_CFLAGS)"; | 
| 862         $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); | 645         $rules.=&do_compile_rule("\$(OBJ_D)",$lib_obj{$_},$lib); | 
| 863         } | 646         } | 
| 864 | 647 | 
| 865 # hack to add version info on MSVC | 648 # hack to add version info on MSVC | 
| 866 if (($platform eq "VC-WIN32") || ($platform eq "VC-WIN64A") | 649 if (($platform eq "VC-WIN32") || ($platform eq "VC-WIN64A") | 
| 867         || ($platform eq "VC-WIN64I") || ($platform eq "VC-NT")) { | 650         || ($platform eq "VC-WIN64I") || ($platform eq "VC-NT")) { | 
| 868     $rules.= <<"EOF"; | 651     $rules.= <<"EOF"; | 
| 869 \$(OBJ_D)\\\$(CRYPTO).res: ms\\version32.rc | 652 \$(OBJ_D)\\\$(CRYPTO).res: ms\\version32.rc | 
| 870         \$(RSC) /fo"\$(OBJ_D)\\\$(CRYPTO).res" /d CRYPTO ms\\version32.rc | 653         \$(RSC) /fo"\$(OBJ_D)\\\$(CRYPTO).res" /d CRYPTO ms\\version32.rc | 
| 871 | 654 | 
| 872 \$(OBJ_D)\\\$(SSL).res: ms\\version32.rc | 655 \$(OBJ_D)\\\$(SSL).res: ms\\version32.rc | 
| 873         \$(RSC) /fo"\$(OBJ_D)\\\$(SSL).res" /d SSL ms\\version32.rc | 656         \$(RSC) /fo"\$(OBJ_D)\\\$(SSL).res" /d SSL ms\\version32.rc | 
| 874 | 657 | 
| 875 \$(OBJ_D)\\\$(LIBFIPS).res: ms\\version32.rc |  | 
| 876         \$(RSC) /fo"\$(OBJ_D)\\\$(LIBFIPS).res" /d FIPS ms\\version32.rc |  | 
| 877 |  | 
| 878 EOF | 658 EOF | 
| 879 } | 659 } | 
| 880 | 660 | 
| 881 $defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep); | 661 $defs.=&do_defs("T_EXE",$test,"\$(TEST_D)",$exep); | 
| 882 foreach (split(/\s+/,$test)) | 662 foreach (split(/\s+/,$test)) | 
| 883         { | 663         { | 
| 884         my $t_libs; |  | 
| 885         $t=&bname($_); | 664         $t=&bname($_); | 
| 886         my $ltype; |  | 
| 887         # Check to see if test program is FIPS |  | 
| 888         if ($fips && /fips/) |  | 
| 889                 { |  | 
| 890                 # If fipsdso link to libosslfips.dll |  | 
| 891                 # otherwise perform static link to |  | 
| 892                 # $(O_FIPSCANISTER) |  | 
| 893                 if ($fipsdso) |  | 
| 894                         { |  | 
| 895                         $t_libs = "\$(L_FIPS)"; |  | 
| 896                         $ltype = 0; |  | 
| 897                         } |  | 
| 898                 else |  | 
| 899                         { |  | 
| 900                         $t_libs = "\$(O_FIPSCANISTER)"; |  | 
| 901                         $ltype = 2; |  | 
| 902                         } |  | 
| 903                 } |  | 
| 904         else |  | 
| 905                 { |  | 
| 906                 $t_libs = "\$(L_LIBS)"; |  | 
| 907                 $ltype = 0; |  | 
| 908                 } |  | 
| 909 |  | 
| 910         $tt="\$(OBJ_D)${o}$t${obj}"; | 665         $tt="\$(OBJ_D)${o}$t${obj}"; | 
| 911 »       $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","$t_libs 
      \$(EX_LIBS)", $ltype); | 666 »       $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIB
      S) \$(EX_LIBS)"); | 
| 912         } | 667         } | 
| 913 | 668 | 
| 914 $defs.=&do_defs("E_SHLIB",$engines,"\$(ENG_D)",$shlibp); | 669 $defs.=&do_defs("E_SHLIB",$engines . $otherlibs,"\$(ENG_D)",$shlibp); | 
| 915 | 670 | 
| 916 foreach (split(/\s+/,$engines)) | 671 foreach (split(/\s+/,$engines)) | 
| 917         { | 672         { | 
| 918         $rules.=&do_compile_rule("\$(OBJ_D)","engines${o}e_$_",$lib); | 673         $rules.=&do_compile_rule("\$(OBJ_D)","engines${o}e_$_",$lib); | 
| 919         $rules.= &do_lib_rule("\$(OBJ_D)${o}e_${_}.obj","\$(ENG_D)$o$_$shlibp","
      ",$shlib,""); | 674         $rules.= &do_lib_rule("\$(OBJ_D)${o}e_${_}.obj","\$(ENG_D)$o$_$shlibp","
      ",$shlib,""); | 
| 920         } | 675         } | 
| 921 | 676 | 
| 922 | 677 | 
| 923 | 678 | 
| 924 $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); | 679 $rules.= &do_lib_rule("\$(SSLOBJ)","\$(O_SSL)",$ssl,$shlib,"\$(SO_SSL)"); | 
|  | 680 $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPT
      O)"); | 
| 925 | 681 | 
| 926 if ($fips) | 682 foreach (split(" ",$otherlibs)) | 
| 927         { | 683         { | 
| 928 »       if ($shlib) | 684 »       my $uc = $_; | 
| 929 »       »       { | 685 »       $uc =~ tr /a-z/A-Z/;» | 
| 930 »       »       if ($fipsdso) | 686 »       $rules.= &do_lib_rule("\$(${uc}OBJ)","\$(ENG_D)$o$_$shlibp", "", $shlib,
       ""); | 
| 931 »       »       »       { | 687 | 
| 932 »       »       »       $rules.= &do_lib_rule("\$(CRYPTOOBJ)", |  | 
| 933 »       »       »       »       »       "\$(O_CRYPTO)", "$crypto", |  | 
| 934 »       »       »       »       »       $shlib, "", ""); |  | 
| 935 »       »       »       $rules.= &do_lib_rule( |  | 
| 936 »       »       »       »       "\$(O_FIPSCANISTER)", |  | 
| 937 »       »       »       »       "\$(O_FIPS)", "\$(LIBFIPS)", |  | 
| 938 »       »       »       »       $shlib, "\$(SO_CRYPTO)", "\$(BASEADDR)"); |  | 
| 939 »       »       »       $rules.= &do_sdef_rule(); |  | 
| 940 »       »       »       } |  | 
| 941 »       »       else |  | 
| 942 »       »       »       { |  | 
| 943 »       »       »       $rules.= &do_lib_rule( |  | 
| 944 »       »       »       »       "\$(CRYPTOOBJ) \$(O_FIPSCANISTER)", |  | 
| 945 »       »       »       »       "\$(O_CRYPTO)", "$crypto", |  | 
| 946 »       »       »       »       $shlib, "\$(SO_CRYPTO)", "\$(BASEADDR)"); |  | 
| 947 »       »       »       } |  | 
| 948 »       »       } |  | 
| 949 »       else |  | 
| 950 »       »       { |  | 
| 951 »       »       $rules.= &do_lib_rule("\$(CRYPTOOBJ)", |  | 
| 952 »       »       »       "\$(O_CRYPTO)",$crypto,$shlib,"\$(SO_CRYPTO)", ""); |  | 
| 953 »       »       $rules.= &do_lib_rule("\$(CRYPTOOBJ) \$(FIPSOBJ)", |  | 
| 954 »       »       »       "\$(LIB_D)$o$crypto_compat",$crypto,$shlib,"\$(SO_CRYPTO
      )", ""); |  | 
| 955 »       »       } |  | 
| 956 »       } |  | 
| 957 »       else |  | 
| 958 »       { |  | 
| 959 »       $rules.= &do_lib_rule("\$(CRYPTOOBJ)","\$(O_CRYPTO)",$crypto,$shlib, |  | 
| 960 »       »       »       »       »       »       »       "\$(SO_CRYPTO)"); |  | 
| 961         } | 688         } | 
| 962 | 689 | 
| 963 if ($fips) | 690 $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$
      (L_LIBS) \$(EX_LIBS)"); | 
| 964 »       { |  | 
| 965 »       if ($fipscanisterbuild) |  | 
| 966 »       »       { |  | 
| 967 »       »       $rules.= &do_rlink_rule("\$(O_FIPSCANISTER)", |  | 
| 968 »       »       »       »       »       "\$(OBJ_D)${o}fips_start$obj", |  | 
| 969 »       »       »       »       »       "\$(FIPSOBJ)", |  | 
| 970 »       »       »       »       »       "\$(OBJ_D)${o}fips_end$obj", |  | 
| 971 »       »       »       »       »       "\$(FIPS_SHA1_EXE)", ""); |  | 
| 972 »       »       $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)", |  | 
| 973 »       »       »       »       »       "\$(OBJ_D)${o}fips_standalone_sha1$obj \
      $(OBJ_D)${o}sha1dgst$obj \$(SHA1_ASM_OBJ)", |  | 
| 974 »       »       »       »       »       "","\$(EX_LIBS)", 1); |  | 
| 975 »       »       } |  | 
| 976 »       else |  | 
| 977 »       »       { |  | 
| 978 »       »       $rules.=&do_link_rule("\$(FIPS_SHA1_EXE)", |  | 
| 979 »       »       »       »       »       "\$(OBJ_D)${o}fips_standalone_sha1$obj \
      $(O_FIPSCANISTER)", |  | 
| 980 »       »       »       »       »       "","", 1); |  | 
| 981 |  | 
| 982 »       »       } |  | 
| 983 »       $rules.=&do_link_rule("\$(PREMAIN_DSO_EXE)","\$(OBJ_D)${o}\$(E_PREMAIN_D
      SO)$obj \$(CRYPTOOBJ) \$(O_FIPSCANISTER)","","\$(EX_LIBS)", 1); |  | 
| 984 » |  | 
| 985 »       } |  | 
| 986 |  | 
| 987 $rules.=&do_link_rule("\$(BIN_D)$o\$(E_EXE)$exep","\$(E_OBJ)","\$(LIBS_DEP)","\$
      (L_LIBS) \$(EX_LIBS)", ($fips && !$shlib) ? 2 : 0); |  | 
| 988 | 691 | 
| 989 print $defs; | 692 print $defs; | 
| 990 | 693 | 
| 991 if ($platform eq "linux-elf") { | 694 if ($platform eq "linux-elf") { | 
| 992     print <<"EOF"; | 695     print <<"EOF"; | 
| 993 # Generate perlasm output files | 696 # Generate perlasm output files | 
| 994 %.cpp: | 697 %.cpp: | 
| 995         (cd \$(\@D)/..; PERL=perl make -f Makefile asm/\$(\@F)) | 698         (cd \$(\@D)/..; PERL=perl make -f Makefile asm/\$(\@F)) | 
| 996 EOF | 699 EOF | 
| 997 } | 700 } | 
| (...skipping 16 matching lines...) Expand all  Loading... | 
| 1014         return("") if $no_camellia  && $dir =~ /\/camellia/; | 717         return("") if $no_camellia  && $dir =~ /\/camellia/; | 
| 1015         return("") if $no_seed && $dir =~ /\/seed/; | 718         return("") if $no_seed && $dir =~ /\/seed/; | 
| 1016         return("") if $no_rc2  && $dir =~ /\/rc2/; | 719         return("") if $no_rc2  && $dir =~ /\/rc2/; | 
| 1017         return("") if $no_rc4  && $dir =~ /\/rc4/; | 720         return("") if $no_rc4  && $dir =~ /\/rc4/; | 
| 1018         return("") if $no_rc5  && $dir =~ /\/rc5/; | 721         return("") if $no_rc5  && $dir =~ /\/rc5/; | 
| 1019         return("") if $no_rsa  && $dir =~ /\/rsa/; | 722         return("") if $no_rsa  && $dir =~ /\/rsa/; | 
| 1020         return("") if $no_rsa  && $dir =~ /^rsaref/; | 723         return("") if $no_rsa  && $dir =~ /^rsaref/; | 
| 1021         return("") if $no_dsa  && $dir =~ /\/dsa/; | 724         return("") if $no_dsa  && $dir =~ /\/dsa/; | 
| 1022         return("") if $no_dh   && $dir =~ /\/dh/; | 725         return("") if $no_dh   && $dir =~ /\/dh/; | 
| 1023         return("") if $no_ec   && $dir =~ /\/ec/; | 726         return("") if $no_ec   && $dir =~ /\/ec/; | 
|  | 727         return("") if $no_gost   && $dir =~ /\/ccgost/; | 
| 1024         return("") if $no_cms  && $dir =~ /\/cms/; | 728         return("") if $no_cms  && $dir =~ /\/cms/; | 
| 1025         return("") if $no_jpake  && $dir =~ /\/jpake/; | 729         return("") if $no_jpake  && $dir =~ /\/jpake/; | 
| 1026         return("") if !$fips   && $dir =~ /^fips/; |  | 
| 1027         if ($no_des && $dir =~ /\/des/) | 730         if ($no_des && $dir =~ /\/des/) | 
| 1028                 { | 731                 { | 
| 1029                 if ($val =~ /read_pwd/) | 732                 if ($val =~ /read_pwd/) | 
| 1030                         { return("$dir/read_pwd "); } | 733                         { return("$dir/read_pwd "); } | 
| 1031                 else | 734                 else | 
| 1032                         { return(""); } | 735                         { return(""); } | 
| 1033                 } | 736                 } | 
| 1034         return("") if $no_mdc2 && $dir =~ /\/mdc2/; | 737         return("") if $no_mdc2 && $dir =~ /\/mdc2/; | 
| 1035         return("") if $no_sock && $dir =~ /\/proxy/; | 738         return("") if $no_sock && $dir =~ /\/proxy/; | 
| 1036         return("") if $no_bf   && $dir =~ /\/bf/; | 739         return("") if $no_bf   && $dir =~ /\/bf/; | 
| 1037         return("") if $no_cast && $dir =~ /\/cast/; | 740         return("") if $no_cast && $dir =~ /\/cast/; | 
|  | 741         return("") if $no_whirlpool && $dir =~ /\/whrlpool/; | 
| 1038 | 742 | 
| 1039         $val =~ s/^\s*(.*)\s*$/$1/; | 743         $val =~ s/^\s*(.*)\s*$/$1/; | 
| 1040         @a=split(/\s+/,$val); | 744         @a=split(/\s+/,$val); | 
| 1041         grep(s/\.[och]$//,@a) unless $keepext; | 745         grep(s/\.[och]$//,@a) unless $keepext; | 
| 1042 | 746 | 
| 1043         @a=grep(!/^e_.*_3d$/,@a) if $no_des; | 747         @a=grep(!/^e_.*_3d$/,@a) if $no_des; | 
| 1044         @a=grep(!/^e_.*_d$/,@a) if $no_des; | 748         @a=grep(!/^e_.*_d$/,@a) if $no_des; | 
| 1045         @a=grep(!/^e_.*_ae$/,@a) if $no_idea; | 749         @a=grep(!/^e_.*_ae$/,@a) if $no_idea; | 
| 1046         @a=grep(!/^e_.*_i$/,@a) if $no_aes; | 750         @a=grep(!/^e_.*_i$/,@a) if $no_aes; | 
| 1047         @a=grep(!/^e_.*_r2$/,@a) if $no_rc2; | 751         @a=grep(!/^e_.*_r2$/,@a) if $no_rc2; | 
| 1048         @a=grep(!/^e_.*_r5$/,@a) if $no_rc5; | 752         @a=grep(!/^e_.*_r5$/,@a) if $no_rc5; | 
| 1049         @a=grep(!/^e_.*_bf$/,@a) if $no_bf; | 753         @a=grep(!/^e_.*_bf$/,@a) if $no_bf; | 
| 1050         @a=grep(!/^e_.*_c$/,@a) if $no_cast; | 754         @a=grep(!/^e_.*_c$/,@a) if $no_cast; | 
| 1051         @a=grep(!/^e_rc4$/,@a) if $no_rc4; | 755         @a=grep(!/^e_rc4$/,@a) if $no_rc4; | 
| 1052         @a=grep(!/^e_camellia$/,@a) if $no_camellia; | 756         @a=grep(!/^e_camellia$/,@a) if $no_camellia; | 
| 1053         @a=grep(!/^e_seed$/,@a) if $no_seed; | 757         @a=grep(!/^e_seed$/,@a) if $no_seed; | 
| 1054 | 758 | 
| 1055 »       @a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2; | 759 »       #@a=grep(!/(^s2_)|(^s23_)/,@a) if $no_ssl2; | 
| 1056 »       @a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3; | 760 »       #@a=grep(!/(^s3_)|(^s23_)/,@a) if $no_ssl3; | 
| 1057 | 761 | 
| 1058         @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; | 762         @a=grep(!/(_sock$)|(_acpt$)|(_conn$)|(^pxy_)/,@a) if $no_sock; | 
| 1059 | 763 | 
| 1060         @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; | 764         @a=grep(!/(^md2)|(_md2$)/,@a) if $no_md2; | 
| 1061         @a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4; | 765         @a=grep(!/(^md4)|(_md4$)/,@a) if $no_md4; | 
| 1062         @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; | 766         @a=grep(!/(^md5)|(_md5$)/,@a) if $no_md5; | 
| 1063         @a=grep(!/(rmd)|(ripemd)/,@a) if $no_ripemd; | 767         @a=grep(!/(rmd)|(ripemd)/,@a) if $no_ripemd; | 
| 1064 | 768 | 
| 1065         @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa; | 769         @a=grep(!/(^d2i_r_)|(^i2d_r_)/,@a) if $no_rsa; | 
| 1066         @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa; | 770         @a=grep(!/(^p_open$)|(^p_seal$)/,@a) if $no_rsa; | 
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1120                 if ($n++ == 2) | 824                 if ($n++ == 2) | 
| 1121                         { | 825                         { | 
| 1122                         $n=0; | 826                         $n=0; | 
| 1123                         $ret.="\\\n\t"; | 827                         $ret.="\\\n\t"; | 
| 1124                         } | 828                         } | 
| 1125                 if (($_ =~ /bss_file/) && ($postfix eq ".h")) | 829                 if (($_ =~ /bss_file/) && ($postfix eq ".h")) | 
| 1126                         { $pf=".c"; } | 830                         { $pf=".c"; } | 
| 1127                 else    { $pf=$postfix; } | 831                 else    { $pf=$postfix; } | 
| 1128                 if ($_ =~ /BN_ASM/)     { $t="$_ "; } | 832                 if ($_ =~ /BN_ASM/)     { $t="$_ "; } | 
| 1129                 elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; } | 833                 elsif ($_ =~ /BNCO_ASM/){ $t="$_ "; } | 
|  | 834                 elsif ($_ =~ /AES_ASM/){ $t="$_ "; } | 
| 1130                 elsif ($_ =~ /DES_ENC/) { $t="$_ "; } | 835                 elsif ($_ =~ /DES_ENC/) { $t="$_ "; } | 
| 1131                 elsif ($_ =~ /BF_ENC/)  { $t="$_ "; } | 836                 elsif ($_ =~ /BF_ENC/)  { $t="$_ "; } | 
| 1132                 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; } | 837                 elsif ($_ =~ /CAST_ENC/){ $t="$_ "; } | 
| 1133                 elsif ($_ =~ /RC4_ENC/) { $t="$_ "; } | 838                 elsif ($_ =~ /RC4_ENC/) { $t="$_ "; } | 
| 1134                 elsif ($_ =~ /RC5_ENC/) { $t="$_ "; } | 839                 elsif ($_ =~ /RC5_ENC/) { $t="$_ "; } | 
| 1135                 elsif ($_ =~ /MD5_ASM/) { $t="$_ "; } | 840                 elsif ($_ =~ /MD5_ASM/) { $t="$_ "; } | 
| 1136                 elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; } | 841                 elsif ($_ =~ /SHA1_ASM/){ $t="$_ "; } | 
| 1137                 elsif ($_ =~ /AES_ASM/){ $t="$_ "; } |  | 
| 1138                 elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; } | 842                 elsif ($_ =~ /RMD160_ASM/){ $t="$_ "; } | 
|  | 843                 elsif ($_ =~ /WHIRLPOOL_ASM/){ $t="$_ "; } | 
| 1139                 elsif ($_ =~ /CPUID_ASM/){ $t="$_ "; } | 844                 elsif ($_ =~ /CPUID_ASM/){ $t="$_ "; } | 
| 1140                 else    { $t="$location${o}$_$pf "; } | 845                 else    { $t="$location${o}$_$pf "; } | 
| 1141 | 846 | 
| 1142                 $Vars{$var}.="$t "; | 847                 $Vars{$var}.="$t "; | 
| 1143                 $ret.=$t; | 848                 $ret.=$t; | 
| 1144                 } | 849                 } | 
| 1145         # hack to add version info on MSVC | 850         # hack to add version info on MSVC | 
| 1146         if ($shlib && (($platform eq "VC-WIN32") || ($platfrom eq "VC-WIN64I") |
      | ($platform eq "VC-WIN64A") || ($platform eq "VC-NT"))) | 851         if ($shlib && (($platform eq "VC-WIN32") || ($platfrom eq "VC-WIN64I") |
      | ($platform eq "VC-WIN64A") || ($platform eq "VC-NT"))) | 
| 1147                 { | 852                 { | 
| 1148                 if ($var eq "CRYPTOOBJ") | 853                 if ($var eq "CRYPTOOBJ") | 
| 1149                         { $ret.="\$(OBJ_D)\\\$(CRYPTO).res "; } | 854                         { $ret.="\$(OBJ_D)\\\$(CRYPTO).res "; } | 
| 1150                 elsif ($var eq "SSLOBJ") | 855                 elsif ($var eq "SSLOBJ") | 
| 1151                         { $ret.="\$(OBJ_D)\\\$(SSL).res "; } | 856                         { $ret.="\$(OBJ_D)\\\$(SSL).res "; } | 
| 1152                 } | 857                 } | 
| 1153         chomp($ret); | 858         chomp($ret); | 
| 1154         $ret.="\n\n"; | 859         $ret.="\n\n"; | 
| 1155         return($ret); | 860         return($ret); | 
| 1156         } | 861         } | 
| 1157 | 862 | 
| 1158 # return the name with the leading path removed | 863 # return the name with the leading path removed | 
| 1159 sub bname | 864 sub bname | 
| 1160         { | 865         { | 
| 1161         local($ret)=@_; | 866         local($ret)=@_; | 
| 1162         $ret =~ s/^.*[\\\/]([^\\\/]+)$/$1/; | 867         $ret =~ s/^.*[\\\/]([^\\\/]+)$/$1/; | 
| 1163         return($ret); | 868         return($ret); | 
| 1164         } | 869         } | 
| 1165 | 870 | 
|  | 871 # return the leading path | 
|  | 872 sub dname | 
|  | 873         { | 
|  | 874         my $ret=shift; | 
|  | 875         $ret =~ s/(^.*)[\\\/][^\\\/]+$/$1/; | 
|  | 876         return($ret); | 
|  | 877         } | 
| 1166 | 878 | 
| 1167 ############################################################## | 879 ############################################################## | 
| 1168 # do a rule for each file that says 'compile' to new direcory | 880 # do a rule for each file that says 'compile' to new direcory | 
| 1169 # compile the files in '$files' into $to | 881 # compile the files in '$files' into $to | 
| 1170 sub do_compile_rule | 882 sub do_compile_rule | 
| 1171         { | 883         { | 
| 1172         local($to,$files,$ex)=@_; | 884         local($to,$files,$ex)=@_; | 
| 1173 »       local($ret,$_,$n); | 885 »       local($ret,$_,$n,$d,$s); | 
| 1174 » | 886 | 
| 1175         $files =~ s/\//$o/g if $o ne '/'; | 887         $files =~ s/\//$o/g if $o ne '/'; | 
| 1176         foreach (split(/\s+/,$files)) | 888         foreach (split(/\s+/,$files)) | 
| 1177                 { | 889                 { | 
| 1178                 $n=&bname($_); | 890                 $n=&bname($_); | 
| 1179 »       »       $ret.=&cc_compile_target("$to${o}$n$obj","${_}.c",$ex) | 891 »       »       $d=&dname($_); | 
|  | 892 »       »       if (-f "${_}.c") | 
|  | 893 »       »       »       { | 
|  | 894 »       »       »       $ret.=&cc_compile_target("$to${o}$n$obj","${_}.c",$ex) | 
|  | 895 »       »       »       } | 
|  | 896 »       »       elsif (-f ($s="${d}${o}asm${o}${n}.pl") or | 
|  | 897 »       »              ($s=~s/sha256/sha512/ and -f $s) or | 
|  | 898 »       »              -f ($s="${d}${o}${n}.pl")) | 
|  | 899 »       »       »       { | 
|  | 900 »       »       »       $ret.=&perlasm_compile_target("$to${o}$n$obj",$s,$n); | 
|  | 901 »       »       »       } | 
|  | 902 »       »       elsif (-f ($s="${d}${o}asm${o}${n}.S") or | 
|  | 903 »       »              -f ($s="${d}${o}${n}.S")) | 
|  | 904 »       »       »       { | 
|  | 905 »       »       »       $ret.=&Sasm_compile_target("$to${o}$n$obj",$s,$n); | 
|  | 906 »       »       »       } | 
|  | 907 »       »       else»   { die "no rule for $_"; } | 
| 1180                 } | 908                 } | 
| 1181         return($ret); | 909         return($ret); | 
| 1182         } | 910         } | 
| 1183 | 911 | 
| 1184 ############################################################## | 912 ############################################################## | 
| 1185 # do a rule for each file that says 'compile' to new direcory | 913 # do a rule for each file that says 'compile' to new direcory | 
|  | 914 sub perlasm_compile_target | 
|  | 915         { | 
|  | 916         my($target,$source,$bname)=@_; | 
|  | 917         my($ret); | 
|  | 918 | 
|  | 919         $bname =~ s/(.*)\.[^\.]$/$1/; | 
|  | 920         $ret ="\$(TMP_D)$o$bname.asm: $source\n"; | 
|  | 921         $ret.="\t\$(PERL) $source $asmtype \$(CFLAG) >\$\@\n\n"; | 
|  | 922         $ret.="$target: \$(TMP_D)$o$bname.asm\n"; | 
|  | 923         $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm\n\n"; | 
|  | 924         return($ret); | 
|  | 925         } | 
|  | 926 | 
|  | 927 sub Sasm_compile_target | 
|  | 928         { | 
|  | 929         my($target,$source,$bname)=@_; | 
|  | 930         my($ret); | 
|  | 931 | 
|  | 932         $bname =~ s/(.*)\.[^\.]$/$1/; | 
|  | 933         $ret ="\$(TMP_D)$o$bname.asm: $source\n"; | 
|  | 934         $ret.="\t\$(CC) -E \$(CFLAG) $source >\$\@\n\n"; | 
|  | 935         $ret.="$target: \$(TMP_D)$o$bname.asm\n"; | 
|  | 936         $ret.="\t\$(ASM) $afile\$\@ \$(TMP_D)$o$bname.asm\n\n"; | 
|  | 937         return($ret); | 
|  | 938         } | 
|  | 939 | 
| 1186 sub cc_compile_target | 940 sub cc_compile_target | 
| 1187         { | 941         { | 
| 1188         local($target,$source,$ex_flags)=@_; | 942         local($target,$source,$ex_flags)=@_; | 
| 1189         local($ret); | 943         local($ret); | 
| 1190 | 944 | 
| 1191         $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cvers
      ion/); | 945         $ex_flags.=" -DMK1MF_BUILD -D$platform_cpp_symbol" if ($source =~ /cvers
      ion/); | 
| 1192         $target =~ s/\//$o/g if $o ne "/"; | 946         $target =~ s/\//$o/g if $o ne "/"; | 
| 1193         $source =~ s/\//$o/g if $o ne "/"; | 947         $source =~ s/\//$o/g if $o ne "/"; | 
| 1194         $ret ="$target: \$(SRC_D)$o$source\n\t"; | 948         $ret ="$target: \$(SRC_D)$o$source\n\t"; | 
| 1195         $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n"; | 949         $ret.="\$(CC) ${ofile}$target $ex_flags -c \$(SRC_D)$o$source\n\n"; | 
| 1196         return($ret); | 950         return($ret); | 
| 1197         } | 951         } | 
| 1198 | 952 | 
| 1199 ############################################################## | 953 ############################################################## | 
| 1200 sub do_asm_rule | 954 sub do_asm_rule | 
| 1201         { | 955         { | 
| 1202         local($target,$src)=@_; | 956         local($target,$src)=@_; | 
| 1203         local($ret,@s,@t,$i); | 957         local($ret,@s,@t,$i); | 
| 1204 | 958 | 
| 1205         $target =~ s/\//$o/g if $o ne "/"; | 959         $target =~ s/\//$o/g if $o ne "/"; | 
| 1206         $src =~ s/\//$o/g if $o ne "/"; | 960         $src =~ s/\//$o/g if $o ne "/"; | 
| 1207 | 961 | 
|  | 962         @t=split(/\s+/,$target); | 
| 1208         @s=split(/\s+/,$src); | 963         @s=split(/\s+/,$src); | 
| 1209 »       @t=split(/\s+/,$target); | 964 | 
| 1210 | 965 | 
| 1211         for ($i=0; $i<=$#s; $i++) | 966         for ($i=0; $i<=$#s; $i++) | 
| 1212                 { | 967                 { | 
| 1213 »       »       $ret.="$t[$i]: $s[$i]\n"; | 968 »       »       my $objfile = $t[$i]; | 
| 1214 »       »       $ret.="\t\$(ASM) $afile$t[$i] \$(SRC_D)$o$s[$i]\n\n"; | 969 »       »       my $srcfile = $s[$i]; | 
|  | 970 | 
|  | 971 »       »       if ($perl_asm == 1) | 
|  | 972 »       »       »       { | 
|  | 973 »       »       »       my $plasm = $objfile; | 
|  | 974 »       »       »       $plasm =~ s/${obj}/.pl/; | 
|  | 975 »       »       »       $ret.="$srcfile: $plasm\n"; | 
|  | 976 »       »       »       $ret.="\t\$(PERL) $plasm $asmtype \$(CFLAG) >$srcfile\n\
      n"; | 
|  | 977 »       »       »       } | 
|  | 978 | 
|  | 979 »       »       $ret.="$objfile: $srcfile\n"; | 
|  | 980 »       »       $ret.="\t\$(ASM) $afile$objfile \$(SRC_D)$o$srcfile\n\n"; | 
| 1215                 } | 981                 } | 
| 1216         return($ret); | 982         return($ret); | 
| 1217         } | 983         } | 
| 1218 | 984 | 
| 1219 sub do_shlib_rule | 985 sub do_shlib_rule | 
| 1220         { | 986         { | 
| 1221         local($n,$def)=@_; | 987         local($n,$def)=@_; | 
| 1222         local($ret,$nn); | 988         local($ret,$nn); | 
| 1223         local($t); | 989         local($t); | 
| 1224 | 990 | 
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1268                 "no-des" => \$no_des, | 1034                 "no-des" => \$no_des, | 
| 1269                 "no-bf" => \$no_bf, | 1035                 "no-bf" => \$no_bf, | 
| 1270                 "no-cast" => \$no_cast, | 1036                 "no-cast" => \$no_cast, | 
| 1271                 "no-md2" => \$no_md2, | 1037                 "no-md2" => \$no_md2, | 
| 1272                 "no-md4" => \$no_md4, | 1038                 "no-md4" => \$no_md4, | 
| 1273                 "no-md5" => \$no_md5, | 1039                 "no-md5" => \$no_md5, | 
| 1274                 "no-sha" => \$no_sha, | 1040                 "no-sha" => \$no_sha, | 
| 1275                 "no-sha1" => \$no_sha1, | 1041                 "no-sha1" => \$no_sha1, | 
| 1276                 "no-ripemd" => \$no_ripemd, | 1042                 "no-ripemd" => \$no_ripemd, | 
| 1277                 "no-mdc2" => \$no_mdc2, | 1043                 "no-mdc2" => \$no_mdc2, | 
|  | 1044                 "no-whirlpool" => \$no_whirlpool, | 
| 1278                 "no-patents" => | 1045                 "no-patents" => | 
| 1279                         [\$no_rc2, \$no_rc4, \$no_rc5, \$no_idea, \$no_rsa], | 1046                         [\$no_rc2, \$no_rc4, \$no_rc5, \$no_idea, \$no_rsa], | 
| 1280                 "no-rsa" => \$no_rsa, | 1047                 "no-rsa" => \$no_rsa, | 
| 1281                 "no-dsa" => \$no_dsa, | 1048                 "no-dsa" => \$no_dsa, | 
| 1282                 "no-dh" => \$no_dh, | 1049                 "no-dh" => \$no_dh, | 
| 1283                 "no-hmac" => \$no_hmac, | 1050                 "no-hmac" => \$no_hmac, | 
| 1284                 "no-asm" => \$no_asm, | 1051                 "no-asm" => \$no_asm, | 
| 1285                 "nasm" => \$nasm, | 1052                 "nasm" => \$nasm, | 
| 1286                 "ml64" => \$ml64, |  | 
| 1287                 "nw-nasm" => \$nw_nasm, | 1053                 "nw-nasm" => \$nw_nasm, | 
| 1288                 "nw-mwasm" => \$nw_mwasm, | 1054                 "nw-mwasm" => \$nw_mwasm, | 
| 1289                 "gaswin" => \$gaswin, | 1055                 "gaswin" => \$gaswin, | 
| 1290                 "no-ssl2" => \$no_ssl2, | 1056                 "no-ssl2" => \$no_ssl2, | 
| 1291                 "no-ssl3" => \$no_ssl3, | 1057                 "no-ssl3" => \$no_ssl3, | 
| 1292                 "no-tlsext" => \$no_tlsext, | 1058                 "no-tlsext" => \$no_tlsext, | 
| 1293                 "no-cms" => \$no_cms, | 1059                 "no-cms" => \$no_cms, | 
| 1294                 "no-jpake" => \$no_jpake, | 1060                 "no-jpake" => \$no_jpake, | 
| 1295                 "no-capieng" => \$no_capieng, |  | 
| 1296                 "no-err" => \$no_err, | 1061                 "no-err" => \$no_err, | 
| 1297                 "no-sock" => \$no_sock, | 1062                 "no-sock" => \$no_sock, | 
| 1298                 "no-krb5" => \$no_krb5, | 1063                 "no-krb5" => \$no_krb5, | 
| 1299                 "no-ec" => \$no_ec, | 1064                 "no-ec" => \$no_ec, | 
| 1300                 "no-ecdsa" => \$no_ecdsa, | 1065                 "no-ecdsa" => \$no_ecdsa, | 
| 1301                 "no-ecdh" => \$no_ecdh, | 1066                 "no-ecdh" => \$no_ecdh, | 
|  | 1067                 "no-gost" => \$no_gost, | 
| 1302                 "no-engine" => \$no_engine, | 1068                 "no-engine" => \$no_engine, | 
| 1303                 "no-hw" => \$no_hw, | 1069                 "no-hw" => \$no_hw, | 
| 1304                 "just-ssl" => | 1070                 "just-ssl" => | 
| 1305                         [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, | 1071                         [\$no_rc2, \$no_idea, \$no_des, \$no_bf, \$no_cast, | 
| 1306                           \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, | 1072                           \$no_md2, \$no_sha, \$no_mdc2, \$no_dsa, \$no_dh, | 
| 1307                           \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, | 1073                           \$no_ssl2, \$no_err, \$no_ripemd, \$no_rc5, | 
| 1308                           \$no_aes, \$no_camellia, \$no_seed], | 1074                           \$no_aes, \$no_camellia, \$no_seed], | 
| 1309                 "rsaref" => 0, | 1075                 "rsaref" => 0, | 
| 1310                 "gcc" => \$gcc, | 1076                 "gcc" => \$gcc, | 
| 1311                 "debug" => \$debug, | 1077                 "debug" => \$debug, | 
| 1312                 "profile" => \$profile, | 1078                 "profile" => \$profile, | 
| 1313                 "shlib" => \$shlib, | 1079                 "shlib" => \$shlib, | 
| 1314                 "dll" => \$shlib, | 1080                 "dll" => \$shlib, | 
| 1315                 "shared" => 0, | 1081                 "shared" => 0, | 
| 1316                 "no-gmp" => 0, | 1082                 "no-gmp" => 0, | 
| 1317                 "no-rfc3779" => 0, | 1083                 "no-rfc3779" => 0, | 
| 1318                 "no-montasm" => 0, | 1084                 "no-montasm" => 0, | 
| 1319                 "no-shared" => 0, | 1085                 "no-shared" => 0, | 
|  | 1086                 "no-store" => 0, | 
| 1320                 "no-zlib" => 0, | 1087                 "no-zlib" => 0, | 
| 1321                 "no-zlib-dynamic" => 0, | 1088                 "no-zlib-dynamic" => 0, | 
| 1322                 "fips" => \$fips, |  | 
| 1323                 "fipscanisterbuild" => [\$fips, \$fipscanisterbuild], |  | 
| 1324                 "fipsdso" => [\$fips, \$fipscanisterbuild, \$fipsdso], |  | 
| 1325                 ); | 1089                 ); | 
| 1326 | 1090 | 
| 1327         if (exists $valid_options{$_}) | 1091         if (exists $valid_options{$_}) | 
| 1328                 { | 1092                 { | 
| 1329                 my $r = $valid_options{$_}; | 1093                 my $r = $valid_options{$_}; | 
| 1330                 if ( ref $r eq "SCALAR") | 1094                 if ( ref $r eq "SCALAR") | 
| 1331                         { $$r = 1;} | 1095                         { $$r = 1;} | 
| 1332                 elsif ( ref $r eq "ARRAY") | 1096                 elsif ( ref $r eq "ARRAY") | 
| 1333                         { | 1097                         { | 
| 1334                         my $r2; | 1098                         my $r2; | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1391                                 } | 1155                                 } | 
| 1392                         } | 1156                         } | 
| 1393                 } | 1157                 } | 
| 1394         elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } | 1158         elsif (/^([^=]*)=(.*)$/){ $VARS{$1}=$2; } | 
| 1395         elsif (/^-[lL].*$/)     { $l_flags.="$_ "; } | 1159         elsif (/^-[lL].*$/)     { $l_flags.="$_ "; } | 
| 1396         elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) | 1160         elsif ((!/^-help/) && (!/^-h/) && (!/^-\?/) && /^-.*$/) | 
| 1397                 { $c_flags.="$_ "; } | 1161                 { $c_flags.="$_ "; } | 
| 1398         else { return(0); } | 1162         else { return(0); } | 
| 1399         return(1); | 1163         return(1); | 
| 1400         } | 1164         } | 
| 1401 |  | 
| 1402 sub fipslib_error |  | 
| 1403         { |  | 
| 1404         print STDERR "***FIPS module directory sanity check failed***\n"; |  | 
| 1405         print STDERR "FIPS module build failed, or was deleted\n"; |  | 
| 1406         print STDERR "Please rebuild FIPS module.\n"; |  | 
| 1407         exit 1; |  | 
| 1408         } |  | 
| 1409 |  | 
| 1410 sub fips_check_files |  | 
| 1411         { |  | 
| 1412         my $dir = shift @_; |  | 
| 1413         my $ret = 1; |  | 
| 1414         if (!-d $dir) |  | 
| 1415                 { |  | 
| 1416                 print STDERR "FIPS module directory $dir does not exist\n"; |  | 
| 1417                 fipslib_error(); |  | 
| 1418                 } |  | 
| 1419         foreach (@_) |  | 
| 1420                 { |  | 
| 1421                 if (!-f "$dir${o}$_") |  | 
| 1422                         { |  | 
| 1423                         print STDERR "FIPS module file $_ does not exist!\n"; |  | 
| 1424                         $ret = 0; |  | 
| 1425                         } |  | 
| 1426                 } |  | 
| 1427         fipslib_error() if ($ret == 0); |  | 
| 1428         } |  | 
| OLD | NEW | 
|---|