Skip to content

Commit

Permalink
Act on deprecation of LONG and ZLONG, step 3
Browse files Browse the repository at this point in the history
Teach util/mkdef.pl to recognise these lines:

    #if OPENSSL_API_COMPAT < 0xXXXXXXXXL

    #if OPENSSL_API_COMPAT >= 0xXXXXXXXXL

and add corresponding markers in util/*.num

A final 'make update' sets those markers right for LONG and ZLONG.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from #3126)
  • Loading branch information
levitte committed Apr 10, 2017
1 parent 6a32a3c commit 676cc3a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 5 deletions.
8 changes: 4 additions & 4 deletions util/libcrypto.num
Original file line number Diff line number Diff line change
Expand Up @@ -1768,8 +1768,8 @@ ASYNC_init_thread 1755 1_1_0 EXIST::FUNCTION:
OCSP_BASICRESP_get_ext_by_OBJ 1756 1_1_0 EXIST::FUNCTION:OCSP
X509_reject_clear 1757 1_1_0 EXIST::FUNCTION:
DH_security_bits 1758 1_1_0 EXIST::FUNCTION:DH
LONG_it 1759 1_1_0 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
LONG_it 1759 1_1_0 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
LONG_it 1759 1_1_0 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:DEPRECATEDIN_1_2_0
LONG_it 1759 1_1_0 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:DEPRECATEDIN_1_2_0
ASN1_dup 1760 1_1_0 EXIST::FUNCTION:
TS_RESP_new 1761 1_1_0 EXIST::FUNCTION:TS
i2d_PKCS8PrivateKeyInfo_fp 1762 1_1_0 EXIST::FUNCTION:STDIO
Expand Down Expand Up @@ -1834,8 +1834,8 @@ X509V3_EXT_add_list 1821 1_1_0 EXIST::FUNCTION:
CMS_compress 1822 1_1_0 EXIST::FUNCTION:CMS
X509_get_ext_by_critical 1823 1_1_0 EXIST::FUNCTION:
ASYNC_WAIT_CTX_clear_fd 1824 1_1_0 EXIST::FUNCTION:
ZLONG_it 1825 1_1_0 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:
ZLONG_it 1825 1_1_0 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:
ZLONG_it 1825 1_1_0 EXIST:!EXPORT_VAR_AS_FUNCTION:VARIABLE:DEPRECATEDIN_1_2_0
ZLONG_it 1825 1_1_0 EXIST:EXPORT_VAR_AS_FUNCTION:FUNCTION:DEPRECATEDIN_1_2_0
OPENSSL_sk_find_ex 1826 1_1_0 EXIST::FUNCTION:
ASN1_ENUMERATED_to_BN 1827 1_1_0 EXIST::FUNCTION:
X509_CRL_get_ext_d2i 1828 1_1_0 EXIST::FUNCTION:
Expand Down
22 changes: 21 additions & 1 deletion util/mkdef.pl
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
"DEPRECATEDIN_0_9_8",
"DEPRECATEDIN_1_0_0",
"DEPRECATEDIN_1_1_0",
"DEPRECATEDIN_1_2_0",
# SCTP
"SCTP",
# SRTP
Expand Down Expand Up @@ -394,6 +395,7 @@ sub do_defs
(map { "OPENSSL_SYS_".$_ => 0 } @known_ossl_platforms),
(map { "OPENSSL_NO_".$_ => 0 } @known_algorithms),
(map { "OPENSSL_USE_".$_ => 0 } @known_algorithms),
(grep /^DEPRECATED_/, @known_algorithms),
NOPROTO => 0,
PERL5 => 0,
_WINDLL => 0,
Expand Down Expand Up @@ -506,7 +508,22 @@ sub do_defs
s/{[^{}]*}//gs; # ignore {} blocks
print STDERR "DEBUG: \$def=\"$def\"\n" if $debug && $def ne "";
print STDERR "DEBUG: \$_=\"$_\"\n" if $debug;
if (/^\#\s*ifndef\s+(.*)/) {
if (/^\#\s*if\s+OPENSSL_API_COMPAT\s*(\S)\s*(0x[0-9a-fA-F]{8})L\s*$/) {
my $op = $1;
my $v = hex($2);
if ($op ne '<' && $op ne '>=') {
die "$file unacceptable operator $op: $_\n";
}
my ($one, $major, $minor) =
( ($v >> 28) & 0xf,
($v >> 20) & 0xff,
($v >> 12) & 0xff );
my $t = "DEPRECATEDIN_${one}_${major}_${minor}";
push(@tag,"-");
push(@tag,$t);
$tag{$t}=($op eq '<' ? 1 : -1);
print STDERR "DEBUG: $file: found tag $t = $tag{$t}\n" if $debug;
} elsif (/^\#\s*ifndef\s+(.*)/) {
push(@tag,"-");
push(@tag,$1);
$tag{$1}=-1;
Expand Down Expand Up @@ -637,6 +654,9 @@ sub do_defs
, grep(!/^$/,
map { $tag{"OPENSSL_USE_".$_} == 1 ? $_ : "" }
@known_algorithms);
push @current_algorithms,
grep { /^DEPRECATEDIN_/ && $tag{$_} == 1 }
@known_algorithms;
$def .=
"#INFO:"
.join(',',@current_platforms).":"
Expand Down

0 comments on commit 676cc3a

Please sign in to comment.