X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fmkdef.pl;h=a6f64e3fc3a29d779f41138973b940dde468d269;hp=96aa51af2effe10669c6c52e56697460162c79aa;hb=c73ad690174171b63a53dabdb2f2d9ebfd30053a;hpb=b2cf7c6452aae1e85ade176bf54ad89bf0263eb2 diff --git a/util/mkdef.pl b/util/mkdef.pl index 96aa51af2e..a6f64e3fc3 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -69,23 +69,25 @@ my $do_ctestall = 0; my $do_checkexist = 0; my $VMSVAX=0; -my $VMSAlpha=0; +my $VMSNonVAX=0; my $VMS=0; my $W32=0; -my $W16=0; my $NT=0; my $OS2=0; # Set this to make typesafe STACK definitions appear in DEF my $safe_stack_def = 0; -my @known_platforms = ( "__FreeBSD__", "PERL5", "NeXT", - "EXPORT_VAR_AS_FUNCTION", "ZLIB" ); -my @known_ossl_platforms = ( "VMS", "WIN16", "WIN32", "WINNT", "OS2" ); +my @known_platforms = ( "__FreeBSD__", "PERL5", + "EXPORT_VAR_AS_FUNCTION", "ZLIB", + "OPENSSL_FIPS", "OPENSSL_FIPSCAPABLE" ); +my @known_ossl_platforms = ( "VMS", "WIN32", "WINNT", "OS2" ); my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "CAST", "MD2", "MD4", "MD5", "SHA", "SHA0", "SHA1", "SHA256", "SHA512", "RIPEMD", - "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", + "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", "EC2M", "HMAC", "AES", "CAMELLIA", "SEED", "GOST", + # EC_NISTP_64_GCC_128 + "EC_NISTP_64_GCC_128", # Envelope "algorithms" "EVP", "X509", "ASN1_TYPEDEFS", # Helper "algorithms" @@ -95,18 +97,30 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "FP_API", "STDIO", "SOCK", "KRB5", "DGRAM", # Engines "STATIC_ENGINE", "ENGINE", "HW", "GMP", - # RFC3779 - "RFC3779", # TLS - "TLSEXT", "PSK", + "TLSEXT", "PSK", "SRP", "HEARTBEATS", # CMS "CMS", # CryptoAPI Engine "CAPIENG", + # SSL v3 method + "SSL3_METHOD", # JPAKE "JPAKE", + # NEXTPROTONEG + "NEXTPROTONEG", # Deprecated functions - "DEPRECATED" ); + "DEPRECATED", + # Hide SSL internals + "SSL_INTERN", + # SCTP + "SCTP", + # SRTP + "SRTP", + # SSL TRACE + "SSL_TRACE", + # Unit testing + "UNIT_TEST"); my $options=""; open(IN," 0 } @known_platforms), (map { "OPENSSL_SYS_".$_ => 0 } @known_ossl_platforms), (map { "OPENSSL_NO_".$_ => 0 } @known_algorithms), + (map { "OPENSSL_USE_".$_ => 0 } @known_algorithms), NOPROTO => 0, PERL5 => 0, _WINDLL => 0, @@ -468,6 +499,11 @@ sub do_defs print STDERR "DEBUG: parsing ----------\n" if $debug; while() { + if($parens > 0) { + #Inside a DECLARE_DEPRECATED + $parens += count_parens($_); + next; + } if (/\/\* Error codes for the \w+ functions\. \*\//) { undef @tag; @@ -571,6 +607,8 @@ sub do_defs pop(@tag); if ($t =~ /^OPENSSL_NO_([A-Z0-9_]+)$/) { $t=$1; + } elsif($t =~ /^OPENSSL_USE_([A-Z0-9_]+)$/) { + $t=$1; } else { $t=""; } @@ -620,10 +658,15 @@ sub do_defs map { $tag{"OPENSSL_SYS_".$_} == 1 ? $_ : $tag{"OPENSSL_SYS_".$_} == -1 ? "!".$_ : "" } @known_ossl_platforms); + @current_algorithms = (); @current_algorithms = grep(!/^$/, map { $tag{"OPENSSL_NO_".$_} == -1 ? $_ : "" } @known_algorithms); + push @current_algorithms + , grep(!/^$/, + map { $tag{"OPENSSL_USE_".$_} == 1 ? $_ : "" } + @known_algorithms); $def .= "#INFO:" .join(',',@current_platforms).":" @@ -789,10 +832,9 @@ sub do_defs } elsif (/^DECLARE_PEM_rw\s*\(\s*(\w*)\s*,/ || /^DECLARE_PEM_rw_cb\s*\(\s*(\w*)\s*,/ || /^DECLARE_PEM_rw_const\s*\(\s*(\w*)\s*,/ ) { - # Things not in Win16 $def .= "#INFO:" - .join(',',"!WIN16",@current_platforms).":" + .join(',',@current_platforms).":" .join(',',@current_algorithms).";"; $def .= "int PEM_read_$1(void);"; $def .= "int PEM_write_$1(void);"; @@ -805,11 +847,11 @@ sub do_defs $def .= "int PEM_write_bio_$1(void);"; next; } elsif (/^DECLARE_PEM_write\s*\(\s*(\w*)\s*,/ || + /^DECLARE_PEM_write_const\s*\(\s*(\w*)\s*,/ || /^DECLARE_PEM_write_cb\s*\(\s*(\w*)\s*,/ ) { - # Things not in Win16 $def .= "#INFO:" - .join(',',"!WIN16",@current_platforms).":" + .join(',',@current_platforms).":" .join(',',@current_algorithms).";"; $def .= "int PEM_write_$1(void);"; $def .= @@ -821,10 +863,9 @@ sub do_defs next; } elsif (/^DECLARE_PEM_read\s*\(\s*(\w*)\s*,/ || /^DECLARE_PEM_read_cb\s*\(\s*(\w*)\s*,/ ) { - # Things not in Win16 $def .= "#INFO:" - .join(',',"!WIN16",@current_platforms).":" + .join(',',@current_platforms).":" .join(',',@current_algorithms).";"; $def .= "int PEM_read_$1(void);"; $def .= @@ -853,6 +894,10 @@ sub do_defs &$make_variant("_shadow_$2","_shadow_$2", "EXPORT_VAR_AS_FUNCTION", "FUNCTION"); + } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) { + $def .= "$1(void);"; + $parens = count_parens($_); + next; } elsif ($tag{'CONST_STRICT'} != 1) { if (/\{|\/\*|\([^\)]*$/) { $line = $_; @@ -957,12 +1002,25 @@ sub do_defs # Prune the returned symbols delete $syms{"bn_dump1"}; - $platform{"BIO_s_log"} .= ",!WIN32,!WIN16,!macintosh"; + $platform{"BIO_s_log"} .= ",!WIN32,!macintosh"; $platform{"PEM_read_NS_CERT_SEQ"} = "VMS"; $platform{"PEM_write_NS_CERT_SEQ"} = "VMS"; $platform{"PEM_read_P8_PRIV_KEY_INFO"} = "VMS"; $platform{"PEM_write_P8_PRIV_KEY_INFO"} = "VMS"; + $platform{"EVP_sha384"} = "!VMSVAX"; + $platform{"EVP_sha512"} = "!VMSVAX"; + $platform{"SHA384_Init"} = "!VMSVAX"; + $platform{"SHA384_Transform"} = "!VMSVAX"; + $platform{"SHA384_Update"} = "!VMSVAX"; + $platform{"SHA384_Final"} = "!VMSVAX"; + $platform{"SHA384"} = "!VMSVAX"; + $platform{"SHA512_Init"} = "!VMSVAX"; + $platform{"SHA512_Transform"} = "!VMSVAX"; + $platform{"SHA512_Update"} = "!VMSVAX"; + $platform{"SHA512_Final"} = "!VMSVAX"; + $platform{"SHA512"} = "!VMSVAX"; + # Info we know about @@ -1087,16 +1145,23 @@ sub is_valid if ($platforms) { # platforms + if ($keyword eq "VMSVAX" && $VMSVAX) { return 1; } + if ($keyword eq "VMSNonVAX" && $VMSNonVAX) { return 1; } if ($keyword eq "VMS" && $VMS) { return 1; } if ($keyword eq "WIN32" && $W32) { return 1; } - if ($keyword eq "WIN16" && $W16) { return 1; } if ($keyword eq "WINNT" && $NT) { return 1; } if ($keyword eq "OS2" && $OS2) { return 1; } # Special platforms: # EXPORT_VAR_AS_FUNCTION means that global variables # will be represented as functions. This currently # only happens on VMS-VAX. - if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32 || $W16)) { + if ($keyword eq "EXPORT_VAR_AS_FUNCTION" && ($VMSVAX || $W32)) { + return 1; + } + if ($keyword eq "OPENSSL_FIPSCAPABLE") { + return 0; + } + if ($keyword eq "OPENSSL_FIPS" && $fips) { return 1; } if ($keyword eq "ZLIB" && $zlib) { return 1; } @@ -1141,12 +1206,21 @@ sub is_valid if ($keyword eq "FP_API" && $no_fp_api) { return 0; } if ($keyword eq "STATIC_ENGINE" && $no_static_engine) { return 0; } if ($keyword eq "GMP" && $no_gmp) { return 0; } - if ($keyword eq "RFC3779" && $no_rfc3779) { return 0; } if ($keyword eq "TLSEXT" && $no_tlsext) { return 0; } if ($keyword eq "PSK" && $no_psk) { return 0; } if ($keyword eq "CMS" && $no_cms) { return 0; } + if ($keyword eq "EC_NISTP_64_GCC_128" && $no_nistp_gcc) + { return 0; } + if ($keyword eq "EC2M" && $no_ec2m) { return 0; } + if ($keyword eq "NEXTPROTONEG" && $no_nextprotoneg) { return 0; } + if ($keyword eq "SSL3_METHOD" && $no_ssl3_method) { return 0; } + if ($keyword eq "SSL_TRACE" && $no_ssl_trace) { return 0; } if ($keyword eq "CAPIENG" && $no_capieng) { return 0; } if ($keyword eq "JPAKE" && $no_jpake) { return 0; } + if ($keyword eq "SRP" && $no_srp) { return 0; } + if ($keyword eq "SCTP" && $no_sctp) { return 0; } + if ($keyword eq "SRTP" && $no_srtp) { return 0; } + if ($keyword eq "UNIT_TEST" && $no_unit_test) { return 0; } if ($keyword eq "DEPRECATED" && $no_deprecated) { return 0; } # Nothing recognise as true @@ -1226,8 +1300,6 @@ sub print_def_file if ($W32) { $libname.="32"; } - elsif ($W16) - { $libname.="16"; } elsif ($OS2) { # DLL names should not clash on the whole system. # However, they should not have any particular relationship @@ -1252,19 +1324,6 @@ LIBRARY $libname $liboptions EOF - if ($W16) { - print <<"EOF"; -CODE PRELOAD MOVEABLE -DATA PRELOAD MOVEABLE SINGLE - -EXETYPE WINDOWS - -HEAPSIZE 4096 -STACKSIZE 8192 - -EOF - } - print "EXPORTS\n"; (@e)=grep(/^SSLeay(\{[0-9]+\})?\\.*?:.*?:FUNCTION/,@symbols); @@ -1438,6 +1497,7 @@ sub update_numbers next if defined($rsyms{$sym}); die "ERROR: Symbol $sym had no info attached to it." if $i eq ""; + next if $i =~ /OPENSSL_FIPSCAPABLE/; if (!exists $nums{$s}) { $new_syms++; my $s2 = $s; @@ -1479,3 +1539,13 @@ sub check_existing } } +sub count_parens +{ + my $line = shift(@_); + + my $open = $line =~ tr/\(//; + my $close = $line =~ tr/\)//; + + return $open - $close; +} +