# exclude.
#
+use lib ".";
+use configdata;
+
my $debug=0;
my $crypto_num= "util/libeay.num";
"CRYPTO_MDEBUG",
# Engines
"STATIC_ENGINE", "ENGINE", "HW", "GMP",
+ # Entropy Gathering
+ "EGD",
# X.509v3 Signed Certificate Timestamps
"SCT",
# RFC3779
# NEXTPROTONEG
"NEXTPROTONEG",
# Deprecated functions
- "DEPRECATED",
+ "DEPRECATEDIN_0_9_8",
+ "DEPRECATEDIN_1_0_0",
+ "DEPRECATEDIN_1_1_0",
# SCTP
"SCTP",
# SRTP
foreach (@known_algorithms) {
$disabled_algorithms{$_} = 0;
}
-
-my $options="";
-open(IN,"<Makefile") || die "unable to open Makefile!\n";
-while(<IN>) {
- $options=$1 if (/^OPTIONS=(.*)$/);
-}
-close(IN);
+# disabled by default
+$disabled_algorithms{"STATIC_ENGINE"} = 1;
my $zlib;
-foreach (@ARGV, split(/ /, $options))
+foreach (@ARGV, split(/ /, $config{options}))
{
$debug=1 if $_ eq "debug";
$W32=1 if $_ eq "32";
$do_ctestall=1 if $_ eq "ctestall";
$do_checkexist=1 if $_ eq "exist";
#$safe_stack_def=1 if $_ eq "-DDEBUG_SAFESTACK";
-
- if (/^(enable|disable|no)-(.*)$/) {
+ if (/^--api=(\d+)\.(\d+)\.(\d+)$/) {
+ my $apiv = sprintf "%x%02x%02x", $1, $2, $3;
+ foreach (keys %disabled_algorithms) {
+ if (/^DEPRECATEDIN_(\d+)_(\d+)_(\d+)$/) {
+ my $depv = sprintf "%x%02x%02x", $1, $2, $3;
+ $disabled_algorithms{$_} = 1 if $apiv ge $depv;
+ }
+ }
+ }
+ if (/^no-deprecated$/) {
+ foreach (keys %disabled_algorithms) {
+ if (/^DEPRECATEDIN_/) {
+ $disabled_algorithms{$_} = 1;
+ }
+ }
+ }
+ elsif (/^(enable|disable|no)-(.*)$/) {
my $alg = uc $2;
$alg =~ tr/-/_/;
if (exists $disabled_algorithms{$alg}) {
$crypto.=" include/openssl/ocsp.h";
$crypto.=" include/openssl/ui.h";
#$crypto.=" include/openssl/store.h";
-$crypto.=" include/openssl/pqueue.h";
$crypto.=" include/openssl/cms.h";
$crypto.=" include/openssl/jpake.h";
$crypto.=" include/openssl/srp.h";
print STDERR "DEBUG: parsing ----------\n" if $debug;
while(<IN>) {
if($parens > 0) {
- #Inside a DECLARE_DEPRECATED
+ #Inside a DEPRECATEDIN
$stored_multiline .= $_;
chomp $stored_multiline;
- print STDERR "DEBUG: Continuing multiline DEPRECATED: $stored_multiline\n" if $debug;
+ print STDERR "DEBUG: Continuing multiline DEPRECATEDIN: $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);";
+ $def .= do_deprecated($stored_multiline,
+ \@current_platforms,
+ \@current_algorithms);
}
next;
}
&$make_variant("_shadow_$2","_shadow_$2",
"EXPORT_VAR_AS_FUNCTION",
"FUNCTION");
- } elsif (/^\s*DECLARE_DEPRECATED\s*\(\s*(\w*(\s|\*|\w)*)/) {
+ } elsif (/^\s*DEPRECATEDIN/) {
$parens = count_parens($_);
if ($parens == 0) {
- $def .= "$1(void);";
+ $def .= do_deprecated($_,
+ \@current_platforms,
+ \@current_algorithms);
} else {
$stored_multiline = $_;
chomp $stored_multiline;
- print STDERR "DEBUG: Found multiline DEPRECATED starting with: $stored_multiline\n" if $debug;
+ print STDERR "DEBUG: Found multiline DEPRECATEDIN starting with: $stored_multiline\n" if $debug;
next;
}
} elsif ($tag{'CONST_STRICT'} != 1) {
$p = $plats;
$a = $algs;
- $a .= ",BF" if($s =~ /EVP_bf/);
- $a .= ",CAST" if($s =~ /EVP_cast/);
- $a .= ",DES" if($s =~ /EVP_des/);
- $a .= ",DSA" if($s =~ /EVP_dss/);
- $a .= ",IDEA" if($s =~ /EVP_idea/);
- $a .= ",MD2" if($s =~ /EVP_md2/);
- $a .= ",MD4" if($s =~ /EVP_md4/);
- $a .= ",MD5" if($s =~ /EVP_md5/);
- $a .= ",RC2" if($s =~ /EVP_rc2/);
- $a .= ",RC4" if($s =~ /EVP_rc4/);
- $a .= ",RC5" if($s =~ /EVP_rc5/);
- $a .= ",RMD160" if($s =~ /EVP_ripemd/);
- $a .= ",RSA" if($s =~ /EVP_(Open|Seal)(Final|Init)/);
- $a .= ",RSA" if($s =~ /RSAPrivateKey/);
- $a .= ",RSA" if($s =~ /SSLv23?_((client|server)_)?method/);
$platform{$s} =
&reduce_platforms((defined($platform{$s})?$platform{$s}.',':"").$p);
return $ret;
}
-sub info_string {
+sub info_string
+{
(my $symbol, my $exist, my $platforms, my $kind, my $algorithms) = @_;
my %a = defined($algorithms) ?
return $ret;
}
-sub maybe_add_info {
+sub maybe_add_info
+{
(my $name, *nums, my @symbols) = @_;
my $sym;
my $new_info = 0;
my %syms=();
- print STDERR "Updating $name info\n";
foreach $sym (@symbols) {
(my $s, my $i) = split /\\/, $sym;
if (defined($nums{$s})) {
}
}
if ($new_info) {
- print STDERR "$new_info old symbols got an info update\n";
+ print STDERR "$name: $new_info old symbols have updated info\n";
if (!$do_rewrite) {
print STDERR "You should do a rewrite to fix this.\n";
}
} else {
- print STDERR "No old symbols needed info update\n";
}
}
}
}
-sub get_version {
- local *MF;
- my $v = '?';
- open MF, 'Makefile' or return $v;
- while (<MF>) {
- $v = $1, last if /^VERSION=(.*?)\s*$/;
- }
- close MF;
- return $v;
+sub get_version
+{
+ return $config{version};
}
sub print_def_file
my $prevsymversion = "", $prevprevsymversion = "";
# For VMS
my $prevnum = 0;
- my $symbolcount = 0;
+ my $symvtextcount = 0;
if ($W32)
{ $libname.="32"; }
{
my $libref = $name eq "ssl" ? "LIBCRYPTO.EXE /SHARE" : "";
print OUT <<"EOF";
-IDENTIFICATION="LIB$libname V$version"
+IDENTIFICATION="V$version"
+CASE_SENSITIVE=YES
LIB$libname.OLB /LIBRARY
$libref
SYMBOL_VECTOR=(-
EOF
+ $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
}
(@r)=grep(/^\w+(\{[0-9]+\})?\\.*?:.*?:FUNCTION/,@symbols);
print OUT " $s2;\n";
} elsif ($VMS) {
while(++$prevnum < $n) {
- if ($symbolcount > 1023) {
+ my $symline="SPARE, SPARE -";
+ if ($symvtextcount + length($symline) + 1 > 1024) {
print OUT ")\nSYMBOL_VECTOR=(-\n";
- $symbolcount = 0;
+ $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
}
- print OUT $symbolcount
- ? " ," : " ";
- print OUT "dummy$prevnum=PRIVATE_PROCEDURE -\n";
- $symbolcount++;
+ if ($symvtextcount > 16) {
+ $symline = ",".$symline;
+ }
+ print OUT " $symline\n";
+ $symvtextcount += length($symline);
}
(my $s_uc = $s) =~ tr/a-z/A-Z/;
- if ($symbolcount > 1023) {
+ my $symtype=
+ $v ? "DATA" : "PROCEDURE";
+ my $symline=
+ ($s_uc ne $s
+ ? "$s_uc/$s=$symtype, $s=$symtype"
+ : "$s=$symtype, SPARE")
+ ." -";
+ if ($symvtextcount + length($symline) + 1 > 1024) {
print OUT ")\nSYMBOL_VECTOR=(-\n";
- $symbolcount = 0;
+ $symvtextcount = 16; # length of "SYMBOL_VECTOR=(-"
+ }
+ if ($symvtextcount > 16) {
+ $symline = ",".$symline;
}
- print OUT $symbolcount
- ? " ," : " ";
- print OUT "$s_uc/$s="
- , ($v ? "DATA" : "PROCEDURE"), " -\n";
- $symbolcount++;
+ print OUT " $symline\n";
+ $symvtextcount += length($symline);
} elsif($v && !$OS2) {
printf OUT " %s%-39s @%-8d DATA\n",
($W32)?"":"_",$s2,$n;
(*OUT,$name,*nums,@symbols)=@_;
my $thing;
- print STDERR "Rewriting $name\n";
-
my @r = grep(/^\w+(\{[0-9]+\})?\\.*?:.*?:\w+\(\w+\)/,@symbols);
my $r; my %r; my %rsyms;
foreach $r (@r) {
($basevers, $vers) = get_openssl_version();
- print STDERR "Updating $name numbers\n";
-
my @r = grep(/^\w+(\{[0-9]+\})?\\.*?:.*?:\w+\(\w+\)/,@symbols);
my $r; my %r; my %rsyms;
foreach $r (@r) {
}
}
if($new_syms) {
- print STDERR "$new_syms New symbols added\n";
+ print STDERR "$name: Added $new_syms new symbols\n";
} else {
- print STDERR "No New symbols Added\n";
+ print STDERR "$name: No new symbols added\n";
}
}
while(<IN>) {
if (/OPENSSL_VERSION_TEXT\s+"OpenSSL (\d\.\d\.)(\d[a-z]*)(-| )/) {
my $suffix = $2;
- my $baseversion = $1 =~ s/\./_/gr;
+ (my $baseversion = $1) =~ s/\./_/g;
close IN;
return ($baseversion."0", $baseversion.$suffix);
}
if (($cvbase ne $tvbase) && ($tvletter gt $cvletter));
}
}
+
+sub do_deprecated()
+{
+ my ($decl, $plats, $algs) = @_;
+ $decl =~ /^\s*(DEPRECATEDIN_\d+_\d+_\d+)\s*\((.*)\)\s*$/
+ or die "Bad DEPRECTEDIN: $decl\n";
+ my $info1 .= "#INFO:";
+ $info1 .= join(',', @{$plats}) . ":";
+ my $info2 = $info1;
+ $info1 .= join(',',@{$algs}, $1) . ";";
+ $info2 .= join(',',@{$algs}) . ";";
+ return $info1 . $2 . ";" . $info2;
+}