summaryrefslogtreecommitdiffstats
path: root/apps/progs.pl
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-02-05 11:27:23 +1000
committerPauli <paul.dale@oracle.com>2020-02-12 08:52:42 +1000
commitc2ec4a16f79cec06b5449bd8728f2e03fa16e22b (patch)
treedc260aaa0c35bc83dd82f4e2d00ce38f1742b5d5 /apps/progs.pl
parent343f0e4a8182ca5c07d9c527f6d681c4109c0700 (diff)
app: add a deprecation warning to all deprecated commands.
Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10977)
Diffstat (limited to 'apps/progs.pl')
-rw-r--r--apps/progs.pl27
1 files changed, 20 insertions, 7 deletions
diff --git a/apps/progs.pl b/apps/progs.pl
index 1b304a03a7..4f1d1c29af 100644
--- a/apps/progs.pl
+++ b/apps/progs.pl
@@ -94,20 +94,33 @@ EOF
ciphers => "sock",
genrsa => "rsa",
rsautl => "rsa",
- gendsa => "dsa",
- dsaparam => "dsa",
gendh => "dh",
- dhparam => "dh",
ecparam => "ec",
pkcs12 => "des",
);
+ my %cmd_deprecated = (
+ dhparam => [ "3_0", "pkeyparam", "dh" ],
+ dsaparam => [ "3_0", "pkeyparam", "dsa" ],
+ dsa => [ "3_0", "pkey", "dsa" ],
+ gendsa => [ "3_0", "genpkey", "dsa" ],
+ );
print "FUNCTION functions[] = {\n";
foreach my $cmd ( @ARGV ) {
my $str =
- " {FT_general, \"$cmd\", ${cmd}_main, ${cmd}_options},\n";
+ " {FT_general, \"$cmd\", ${cmd}_main, ${cmd}_options, NULL},\n";
if ($cmd =~ /^s_/) {
print "#ifndef OPENSSL_NO_SOCK\n${str}#endif\n";
+ } elsif (my $deprecated = $cmd_deprecated{$cmd}) {
+ my @dep = @{$deprecated};
+ print "#if ";
+ if ($dep[2]) {
+ print "!defined(OPENSSL_NO_" . uc($dep[2]) . ") && ";
+ }
+ print "!defined(OPENSSL_NO_DEPRECATED_" . $dep[0] . ")";
+ my $dalt = "\"" . $dep[1] . "\"";
+ $str =~ s/NULL/$dalt/;
+ print "\n${str}#endif\n";
} elsif (grep { $cmd eq $_ } @disablables) {
print "#ifndef OPENSSL_NO_" . uc($cmd) . "\n${str}#endif\n";
} elsif (my $disabler = $cmd_disabler{$cmd}) {
@@ -131,7 +144,7 @@ EOF
"mdc2", "rmd160", "blake2b512", "blake2s256",
"sm3"
) {
- my $str = " {FT_md, \"$cmd\", dgst_main},\n";
+ my $str = " {FT_md, \"$cmd\", dgst_main, NULL, NULL},\n";
if (grep { $cmd eq $_ } @disablables) {
print "#ifndef OPENSSL_NO_" . uc($cmd) . "\n${str}#endif\n";
} elsif (my $disabler = $md_disabler{$cmd}) {
@@ -177,7 +190,7 @@ EOF
"cast-cbc", "rc5-cbc", "rc5-ecb", "rc5-cfb", "rc5-ofb",
"sm4-cbc", "sm4-ecb", "sm4-cfb", "sm4-ofb", "sm4-ctr"
) {
- my $str = " {FT_cipher, \"$cmd\", enc_main, enc_options},\n";
+ my $str = " {FT_cipher, \"$cmd\", enc_main, enc_options, NULL},\n";
(my $algo = $cmd) =~ s/-.*//g;
if ($cmd eq "zlib") {
print "#ifdef ZLIB\n${str}#endif\n";
@@ -190,5 +203,5 @@ EOF
}
}
- print " {0, NULL, NULL}\n};\n";
+ print " {0, NULL, NULL, NULL, NULL}\n};\n";
}