X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=util%2Fmkdef.pl;h=e2b1fb6d4aba10b9e4059febb3481923df78da48;hp=a6f64e3fc3a29d779f41138973b940dde468d269;hb=9f5be870e86ef57b52854be6328e1844afa95814;hpb=c73ad690174171b63a53dabdb2f2d9ebfd30053a diff --git a/util/mkdef.pl b/util/mkdef.pl index a6f64e3fc3..e2b1fb6d4a 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,7 +66,7 @@ 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", + "SHA256", "SHA512", "RMD160", "MDC2", "WHIRLPOOL", "RSA", "DSA", "DH", "EC", "ECDH", "ECDSA", "EC2M", "HMAC", "AES", "CAMELLIA", "SEED", "GOST", # EC_NISTP_64_GCC_128 @@ -94,7 +77,7 @@ 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", # TLS @@ -111,8 +94,6 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", "NEXTPROTONEG", # Deprecated functions "DEPRECATED", - # Hide SSL internals - "SSL_INTERN", # SCTP "SCTP", # SRTP @@ -120,7 +101,12 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", # SSL TRACE "SSL_TRACE", # Unit testing - "UNIT_TEST"); + "UNIT_TEST", + # OCB mode + "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\. \*\//) @@ -895,9 +884,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 = $_; @@ -971,8 +966,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 .= ",SHA" if($s =~ /EVP_sha/); + $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/); @@ -1179,7 +1173,7 @@ 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; } @@ -1188,7 +1182,6 @@ sub is_valid 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; } @@ -1200,7 +1193,6 @@ 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; } @@ -1222,6 +1214,7 @@ sub is_valid 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; } + if ($keyword eq "OCB" && $no_ocb) { return 0; } # Nothing recognise as true return 1;