diff options
Diffstat (limited to 'src/lib/libcrypto/util/mkdef.pl')
-rw-r--r-- | src/lib/libcrypto/util/mkdef.pl | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/lib/libcrypto/util/mkdef.pl b/src/lib/libcrypto/util/mkdef.pl index adfd447dd3..cdd2164c4e 100644 --- a/src/lib/libcrypto/util/mkdef.pl +++ b/src/lib/libcrypto/util/mkdef.pl | |||
@@ -91,7 +91,7 @@ my @known_algorithms = ( "RC2", "RC4", "RC5", "IDEA", "DES", "BF", | |||
91 | "BIO", "COMP", "BUFFER", "LHASH", "STACK", "ERR", | 91 | "BIO", "COMP", "BUFFER", "LHASH", "STACK", "ERR", |
92 | "LOCKING", | 92 | "LOCKING", |
93 | # External "algorithms" | 93 | # External "algorithms" |
94 | "FP_API", "STDIO", "SOCK", "KRB5" ); | 94 | "FP_API", "STDIO", "SOCK", "KRB5", "ENGINE", "HW" ); |
95 | 95 | ||
96 | my $options=""; | 96 | my $options=""; |
97 | open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; | 97 | open(IN,"<Makefile.ssl") || die "unable to open Makefile.ssl!\n"; |
@@ -107,7 +107,7 @@ my $no_rc2; my $no_rc4; my $no_rc5; my $no_idea; my $no_des; my $no_bf; | |||
107 | my $no_cast; | 107 | my $no_cast; |
108 | my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2; | 108 | my $no_md2; my $no_md4; my $no_md5; my $no_sha; my $no_ripemd; my $no_mdc2; |
109 | my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; | 109 | my $no_rsa; my $no_dsa; my $no_dh; my $no_hmac=0; my $no_aes; my $no_krb5; |
110 | my $no_ec; | 110 | my $no_ec; my $no_engine; my $no_hw; |
111 | my $no_fp_api; | 111 | my $no_fp_api; |
112 | 112 | ||
113 | foreach (@ARGV, split(/ /, $options)) | 113 | foreach (@ARGV, split(/ /, $options)) |
@@ -176,6 +176,8 @@ foreach (@ARGV, split(/ /, $options)) | |||
176 | elsif (/^no-comp$/) { $no_comp=1; } | 176 | elsif (/^no-comp$/) { $no_comp=1; } |
177 | elsif (/^no-dso$/) { $no_dso=1; } | 177 | elsif (/^no-dso$/) { $no_dso=1; } |
178 | elsif (/^no-krb5$/) { $no_krb5=1; } | 178 | elsif (/^no-krb5$/) { $no_krb5=1; } |
179 | elsif (/^no-engine$/) { $no_engine=1; } | ||
180 | elsif (/^no-hw$/) { $no_hw=1; } | ||
179 | } | 181 | } |
180 | 182 | ||
181 | 183 | ||
@@ -235,7 +237,7 @@ $crypto.=" crypto/dh/dh.h" ; # unless $no_dh; | |||
235 | $crypto.=" crypto/ec/ec.h" ; # unless $no_ec; | 237 | $crypto.=" crypto/ec/ec.h" ; # unless $no_ec; |
236 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; | 238 | $crypto.=" crypto/hmac/hmac.h" ; # unless $no_hmac; |
237 | 239 | ||
238 | $crypto.=" crypto/engine/engine.h"; | 240 | $crypto.=" crypto/engine/engine.h"; # unless $no_engine; |
239 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; | 241 | $crypto.=" crypto/stack/stack.h" ; # unless $no_stack; |
240 | $crypto.=" crypto/buffer/buffer.h" ; # unless $no_buffer; | 242 | $crypto.=" crypto/buffer/buffer.h" ; # unless $no_buffer; |
241 | $crypto.=" crypto/bio/bio.h" ; # unless $no_bio; | 243 | $crypto.=" crypto/bio/bio.h" ; # unless $no_bio; |
@@ -438,7 +440,12 @@ sub do_defs | |||
438 | } | 440 | } |
439 | 441 | ||
440 | s/\/\*.*?\*\///gs; # ignore comments | 442 | s/\/\*.*?\*\///gs; # ignore comments |
443 | if (/\/\*/) { # if we have part | ||
444 | $line = $_; # of a comment, | ||
445 | next; # continue reading | ||
446 | } | ||
441 | s/{[^{}]*}//gs; # ignore {} blocks | 447 | s/{[^{}]*}//gs; # ignore {} blocks |
448 | print STDERR "DEBUG: \$def=\"$def\"\n" if $debug && $def ne ""; | ||
442 | print STDERR "DEBUG: \$_=\"$_\"\n" if $debug; | 449 | print STDERR "DEBUG: \$_=\"$_\"\n" if $debug; |
443 | if (/^\#\s*ifndef\s+(.*)/) { | 450 | if (/^\#\s*ifndef\s+(.*)/) { |
444 | push(@tag,"-"); | 451 | push(@tag,"-"); |
@@ -812,14 +819,14 @@ sub do_defs | |||
812 | } elsif (/\(\*(\w*(\{[0-9]+\})?)\([^\)]+/) { | 819 | } elsif (/\(\*(\w*(\{[0-9]+\})?)\([^\)]+/) { |
813 | $s = $1; | 820 | $s = $1; |
814 | print STDERR "DEBUG: found ANSI C function $s\n" if $debug; | 821 | print STDERR "DEBUG: found ANSI C function $s\n" if $debug; |
815 | } elsif (/\w+\W+(\w+)\W*\(\s*\)$/s) { | 822 | } elsif (/\w+\W+(\w+)\W*\(\s*\)(\s*__attribute__\(.*\)\s*)?$/s) { |
816 | # K&R C | 823 | # K&R C |
817 | print STDERR "DEBUG: found K&R C function $s\n" if $debug; | 824 | print STDERR "DEBUG: found K&R C function $s\n" if $debug; |
818 | next; | 825 | next; |
819 | } elsif (/\w+\W+\w+(\{[0-9]+\})?\W*\(.*\)$/s) { | 826 | } elsif (/\w+\W+\w+(\{[0-9]+\})?\W*\(.*\)(\s*__attribute__\(.*\)\s*)?$/s) { |
820 | while (not /\(\)$/s) { | 827 | while (not /\(\)(\s*__attribute__\(.*\)\s*)?$/s) { |
821 | s/[^\(\)]*\)$/\)/s; | 828 | s/[^\(\)]*\)(\s*__attribute__\(.*\)\s*)?$/\)/s; |
822 | s/\([^\(\)]*\)\)$/\)/s; | 829 | s/\([^\(\)]*\)\)(\s*__attribute__\(.*\)\s*)?$/\)/s; |
823 | } | 830 | } |
824 | s/\(void\)//; | 831 | s/\(void\)//; |
825 | /(\w+(\{[0-9]+\})?)\W*\(\)/s; | 832 | /(\w+(\{[0-9]+\})?)\W*\(\)/s; |
@@ -1052,6 +1059,8 @@ sub is_valid | |||
1052 | if ($keyword eq "COMP" && $no_comp) { return 0; } | 1059 | if ($keyword eq "COMP" && $no_comp) { return 0; } |
1053 | if ($keyword eq "DSO" && $no_dso) { return 0; } | 1060 | if ($keyword eq "DSO" && $no_dso) { return 0; } |
1054 | if ($keyword eq "KRB5" && $no_krb5) { return 0; } | 1061 | if ($keyword eq "KRB5" && $no_krb5) { return 0; } |
1062 | if ($keyword eq "ENGINE" && $no_engine) { return 0; } | ||
1063 | if ($keyword eq "HW" && $no_hw) { return 0; } | ||
1055 | if ($keyword eq "FP_API" && $no_fp_api) { return 0; } | 1064 | if ($keyword eq "FP_API" && $no_fp_api) { return 0; } |
1056 | 1065 | ||
1057 | # Nothing recognise as true | 1066 | # Nothing recognise as true |