X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fmkdef.pl;h=b60c57c927a63499127848b06fcaf3d130d897a1;hp=b67d14be57c24ae70efa750baec54b5a573b0558;hb=2ab9687479c10c4c4ebfdfcf6d068fe581bd44e4;hpb=dc0e9a35fa89c262833d6b498108acc58a70bdcb diff --git a/util/mkdef.pl b/util/mkdef.pl index b67d14be57..b60c57c927 100755 --- a/util/mkdef.pl +++ b/util/mkdef.pl @@ -5,25 +5,8 @@ # It does this by parsing the header files and looking for the # prototyped functions: it then prunes the output. # -# Intermediary files are created, call libeay.num and ssleay.num,... -# Previously, they had the following format: -# -# routine-name nnnn -# -# But that isn't enough for a number of reasons, the first on being that -# this format is (needlessly) very Win32-centric, and even then... -# One of the biggest problems is that there's no information about what -# routines should actually be used, which varies with what crypto algorithms -# are disabled. Also, some operating systems (for example VMS with VAX C) -# need to keep track of the global variables as well as the functions. -# -# So, a remake of this script is done so as to include information on the -# kind of symbol it is (function or variable) and what algorithms they're -# part of. This will allow easy translating to .def files or the corresponding -# file in other operating systems (a .opt file for VMS, possibly with a .mar -# file). -# -# The format now becomes: +# Intermediary files are created, call libeay.num and ssleay.num, +# The format of these files is: # # routine-name nnnn info # @@ -83,9 +66,10 @@ my @known_platforms = ( "__FreeBSD__", "PERL5", 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", "EC2M", + "SHA256", "SHA512", "RMD160", + "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "EC2M", "HMAC", "AES", "CAMELLIA", "SEED", "GOST", + "SCRYPT", "CHACHA", "POLY1305", # EC_NISTP_64_GCC_128 "EC_NISTP_64_GCC_128", # Envelope "algorithms" @@ -94,11 +78,15 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "BIO", "COMP", "BUFFER", "LHASH", "STACK", "ERR", "LOCKING", # External "algorithms" - "FP_API", "STDIO", "SOCK", "KRB5", "DGRAM", + "FP_API", "STDIO", "SOCK", "DGRAM", # Engines - "STATIC_ENGINE", "ENGINE", "HW", "GMP", + "STATIC_ENGINE", "ENGINE", "HW", "GMP", + # X.509v3 Signed Certificate Timestamps + "SCT", + # RFC3779 + "RFC3779", # TLS - "TLSEXT", "PSK", "SRP", "HEARTBEATS", + "PSK", "SRP", "HEARTBEATS", # CMS "CMS", # CryptoAPI Engine @@ -111,8 +99,6 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "NEXTPROTONEG", # Deprecated functions "DEPRECATED", - # Hide SSL internals - "SSL_INTERN", # SCTP "SCTP", # SRTP @@ -122,7 +108,10 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", # Unit testing "UNIT_TEST", # OCB mode - "OCB"); + "OCB", + # APPLINK (win build feature?) + "APPLINK" + ); my $options=""; open(IN,") { if($parens > 0) { #Inside a DECLARE_DEPRECATED - $parens += count_parens($_); + $stored_multiline .= $_; + chomp $stored_multiline; + print STDERR "DEBUG: Continuing multiline DEPRECATED: $stored_multiline\n" if $debug; + $parens = count_parens($stored_multiline); + if ($parens == 0) { + $stored_multiline =~ /^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/; + $def .= "$1(void);"; + } next; } if (/\/\* Error codes for the \w+ functions\. \*\//) @@ -898,9 +892,15 @@ sub do_defs "EXPORT_VAR_AS_FUNCTION", "FUNCTION"); } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) { - $def .= "$1(void);"; $parens = count_parens($_); - next; + if ($parens == 0) { + $def .= "$1(void);"; + } else { + $stored_multiline = $_; + chomp $stored_multiline; + print STDERR "DEBUG: Found multiline DEPRECATED starting with: $stored_multiline\n" if $debug; + next; + } } elsif ($tag{'CONST_STRICT'} != 1) { if (/\{|\/\*|\([^\)]*$/) { $line = $_; @@ -974,7 +974,7 @@ sub do_defs $a .= ",RC2" if($s =~ /EVP_rc2/); $a .= ",RC4" if($s =~ /EVP_rc4/); $a .= ",RC5" if($s =~ /EVP_rc5/); - $a .= ",RIPEMD" if($s =~ /EVP_ripemd/); + $a .= ",RMD160" if($s =~ /EVP_ripemd/); $a .= ",RSA" if($s =~ /EVP_(Open|Seal)(Final|Init)/); $a .= ",RSA" if($s =~ /PEM_Seal(Final|Init|Update)/); $a .= ",RSA" if($s =~ /RSAPrivateKey/); @@ -1181,19 +1181,19 @@ sub is_valid if ($keyword eq "MD4" && $no_md4) { return 0; } if ($keyword eq "MD5" && $no_md5) { return 0; } if ($keyword eq "SHA" && $no_sha) { return 0; } - if ($keyword eq "RIPEMD" && $no_ripemd) { return 0; } + if ($keyword eq "RMD160" && $no_ripemd) { return 0; } if ($keyword eq "MDC2" && $no_mdc2) { return 0; } if ($keyword eq "WHIRLPOOL" && $no_whirlpool) { return 0; } if ($keyword eq "RSA" && $no_rsa) { return 0; } if ($keyword eq "DSA" && $no_dsa) { return 0; } if ($keyword eq "DH" && $no_dh) { return 0; } if ($keyword eq "EC" && $no_ec) { return 0; } - if ($keyword eq "ECDSA" && $no_ecdsa) { return 0; } - if ($keyword eq "ECDH" && $no_ecdh) { return 0; } - if ($keyword eq "HMAC" && $no_hmac) { return 0; } if ($keyword eq "AES" && $no_aes) { return 0; } if ($keyword eq "CAMELLIA" && $no_camellia) { return 0; } if ($keyword eq "SEED" && $no_seed) { return 0; } + if ($keyword eq "SCRYPT" && $no_scrypt) { return 0; } + if ($keyword eq "CHACHA" && $no_chacha) { return 0; } + if ($keyword eq "POLY1305" && $no_poly1305) { return 0; } if ($keyword eq "EVP" && $no_evp) { return 0; } if ($keyword eq "LHASH" && $no_lhash) { return 0; } if ($keyword eq "STACK" && $no_stack) { return 0; } @@ -1202,13 +1202,12 @@ sub is_valid if ($keyword eq "BIO" && $no_bio) { return 0; } if ($keyword eq "COMP" && $no_comp) { return 0; } if ($keyword eq "DSO" && $no_dso) { return 0; } - if ($keyword eq "KRB5" && $no_krb5) { return 0; } if ($keyword eq "ENGINE" && $no_engine) { return 0; } if ($keyword eq "HW" && $no_hw) { return 0; } 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 "TLSEXT" && $no_tlsext) { return 0; } + if ($keyword eq "SCT" && $no_sct) { return 0; } + if ($keyword eq "RFC3779" && $no_rfc3779) { 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)