summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/util/mkdef.pl
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/util/mkdef.pl')
-rw-r--r--src/lib/libcrypto/util/mkdef.pl17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl
index 01a1bfda19..9918c3d549 100644
--- a/src/lib/libcrypto/util/mkdef.pl
+++ b/src/lib/libcrypto/util/mkdef.pl
@@ -79,7 +79,7 @@ my $OS2=0;
79my $safe_stack_def = 0; 79my $safe_stack_def = 0;
80 80
81my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", 81my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT",
82 "EXPORT_VAR_AS_FUNCTION" ); 82 "EXPORT_VAR_AS_FUNCTION", "OPENSSL_FIPS" );
83my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); 83my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" );
84my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", 84my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
85 "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", 85 "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1",
@@ -94,7 +94,7 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF",
94 "FP_API", "STDIO", "SOCK", "KRB5", "ENGINE", "HW" ); 94 "FP_API", "STDIO", "SOCK", "KRB5", "ENGINE", "HW" );
95 95
96my $options=""; 96my $options="";
97open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; 97open(IN,"<Makefile") || die "unable to open Makefile!\n";
98while(<IN>) { 98while(<IN>) {
99 $options=$1 if (/^OPTIONS=(.*)$/); 99 $options=$1 if (/^OPTIONS=(.*)$/);
100} 100}
@@ -109,6 +109,7 @@ my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2;
109my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; 109my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5;
110my $no_ec; my $no_engine; my $no_hw; 110my $no_ec; my $no_engine; my $no_hw;
111my $no_fp_api; 111my $no_fp_api;
112my $fips;
112 113
113foreach (@ARGV, split(/ /, $options)) 114foreach (@ARGV, split(/ /, $options))
114 { 115 {
@@ -129,6 +130,7 @@ foreach (@ARGV, split(/ /, $options))
129 } 130 }
130 $VMS=1 if $_ eq "VMS"; 131 $VMS=1 if $_ eq "VMS";
131 $OS2=1 if $_ eq "OS2"; 132 $OS2=1 if $_ eq "OS2";
133 $fips=1 if $_ eq "fips";
132 134
133 $do_ssl=1 if $_ eq "ssleay"; 135 $do_ssl=1 if $_ eq "ssleay";
134 if ($_ eq "ssl") { 136 if ($_ eq "ssl") {
@@ -265,6 +267,7 @@ $crypto.=" crypto/ocsp/ocsp.h";
265$crypto.=" crypto/ui/ui.h crypto/ui/ui_compat.h"; 267$crypto.=" crypto/ui/ui.h crypto/ui/ui_compat.h";
266$crypto.=" crypto/krb5/krb5_asn.h"; 268$crypto.=" crypto/krb5/krb5_asn.h";
267$crypto.=" crypto/tmdiff.h"; 269$crypto.=" crypto/tmdiff.h";
270$crypto.=" fips/fips.h fips/rand/fips_rand.h";
268 271
269my $symhacks="crypto/symhacks.h"; 272my $symhacks="crypto/symhacks.h";
270 273
@@ -469,7 +472,7 @@ sub do_defs
469 push(@tag,$1); 472 push(@tag,$1);
470 $tag{$1}=-1; 473 $tag{$1}=-1;
471 } 474 }
472 } elsif (/^\#\s*ifdef\s+(.*)/) { 475 } elsif (/^\#\s*ifdef\s+(\S*)/) {
473 push(@tag,"-"); 476 push(@tag,"-");
474 push(@tag,$1); 477 push(@tag,$1);
475 $tag{$1}=1; 478 $tag{$1}=1;
@@ -794,7 +797,7 @@ sub do_defs
794 } 797 }
795 close(IN); 798 close(IN);
796 799
797 my $algs; 800 my $algs = '';
798 my $plays; 801 my $plays;
799 802
800 print STDERR "DEBUG: postprocessing ----------\n" if $debug; 803 print STDERR "DEBUG: postprocessing ----------\n" if $debug;
@@ -864,6 +867,7 @@ sub do_defs
864 867
865 $platform{$s} = 868 $platform{$s} =
866 &reduce_platforms((defined($platform{$s})?$platform{$s}.',':"").$p); 869 &reduce_platforms((defined($platform{$s})?$platform{$s}.',':"").$p);
870 $algorithm{$s} = '' if !defined $algorithm{$s};
867 $algorithm{$s} .= ','.$a; 871 $algorithm{$s} .= ','.$a;
868 872
869 if (defined($variant{$s})) { 873 if (defined($variant{$s})) {
@@ -1028,6 +1032,9 @@ sub is_valid
1028 if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { 1032 if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) {
1029 return 1; 1033 return 1;
1030 } 1034 }
1035 if ($keyword eq "OPENSSL_FIPS" && $fips) {
1036 return 1;
1037 }
1031 return 0; 1038 return 0;
1032 } else { 1039 } else {
1033 # algorithms 1040 # algorithms
@@ -1119,7 +1126,7 @@ sub print_test_file
1119sub get_version { 1126sub get_version {
1120 local *MF; 1127 local *MF;
1121 my $v = '?'; 1128 my $v = '?';
1122 open MF, 'Makefile.ssl' or return $v; 1129 open MF, 'Makefile' or return $v;
1123 while (<MF>) { 1130 while (<MF>) {
1124 $v = $1, last if /^VERSION=(.*?)\s*$/; 1131 $v = $1, last if /^VERSION=(.*?)\s*$/;
1125 } 1132 }