summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2020-02-12 10:10:44 +1000
committerPauli <paul.dale@oracle.com>2020-02-18 19:53:52 +1000
commitd1eec097b99c3d16ada855505b406daa9ceb7d4f (patch)
tree73e8325caa8589668807baa77f3d80274406e6d2 /apps
parenteeacf7d065e817b2c0c29ce7d6a9d8047450a293 (diff)
Deprecate EC command line apps.
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11106)
Diffstat (limited to 'apps')
-rw-r--r--apps/pkeyparam.c15
-rw-r--r--apps/progs.c8
-rw-r--r--apps/progs.pl3
3 files changed, 13 insertions, 13 deletions
diff --git a/apps/pkeyparam.c b/apps/pkeyparam.c
index 552ba56d99..5521909d99 100644
--- a/apps/pkeyparam.c
+++ b/apps/pkeyparam.c
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <string.h>
+#include <stdlib.h>
#include "apps.h"
#include "progs.h"
#include <openssl/pem.h>
@@ -44,9 +45,11 @@ int pkeyparam_main(int argc, char **argv)
ENGINE *e = NULL;
BIO *in = NULL, *out = NULL;
EVP_PKEY *pkey = NULL;
- int text = 0, noout = 0, ret = 1, check = 0;
+ EVP_PKEY_CTX *ctx = NULL;
+ int text = 0, noout = 0, ret = EXIT_FAILURE, check = 0, r;
OPTION_CHOICE o;
char *infile = NULL, *outfile = NULL, *prog;
+ unsigned long err;
prog = opt_init(argc, argv, pkeyparam_options);
while ((o = opt_next()) != OPT_EOF) {
@@ -98,9 +101,6 @@ int pkeyparam_main(int argc, char **argv)
}
if (check) {
- int r;
- EVP_PKEY_CTX *ctx;
-
ctx = EVP_PKEY_CTX_new(pkey, e);
if (ctx == NULL) {
ERR_print_errors(bio_err);
@@ -116,8 +116,6 @@ int pkeyparam_main(int argc, char **argv)
* Note: at least for RSA keys if this function returns
* -1, there will be no error reasons.
*/
- unsigned long err;
-
BIO_printf(out, "Parameters are invalid\n");
while ((err = ERR_peek_error()) != 0) {
@@ -125,8 +123,8 @@ int pkeyparam_main(int argc, char **argv)
ERR_reason_error_string(err));
ERR_get_error(); /* remove err from error stack */
}
+ goto end;
}
- EVP_PKEY_CTX_free(ctx);
}
if (!noout)
@@ -135,9 +133,10 @@ int pkeyparam_main(int argc, char **argv)
if (text)
EVP_PKEY_print_params(out, pkey, 0, NULL);
- ret = 0;
+ ret = EXIT_SUCCESS;
end:
+ EVP_PKEY_CTX_free(ctx);
EVP_PKEY_free(pkey);
release_engine(e);
BIO_free_all(out);
diff --git a/apps/progs.c b/apps/progs.c
index eba50e8daf..c4fb1790e6 100644
--- a/apps/progs.c
+++ b/apps/progs.c
@@ -33,11 +33,11 @@ FUNCTION functions[] = {
#if !defined(OPENSSL_NO_DSA) && !defined(OPENSSL_NO_DEPRECATED_3_0)
{FT_general, "dsaparam", dsaparam_main, dsaparam_options, "pkeyparam"},
#endif
-#ifndef OPENSSL_NO_EC
- {FT_general, "ec", ec_main, ec_options, NULL},
+#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+ {FT_general, "ec", ec_main, ec_options, "pkey"},
#endif
-#ifndef OPENSSL_NO_EC
- {FT_general, "ecparam", ecparam_main, ecparam_options, NULL},
+#if !defined(OPENSSL_NO_EC) && !defined(OPENSSL_NO_DEPRECATED_3_0)
+ {FT_general, "ecparam", ecparam_main, ecparam_options, "pkeyparam"},
#endif
{FT_general, "enc", enc_main, enc_options, NULL},
#ifndef OPENSSL_NO_ENGINE
diff --git a/apps/progs.pl b/apps/progs.pl
index 4f1d1c29af..b4ff4b7d55 100644
--- a/apps/progs.pl
+++ b/apps/progs.pl
@@ -95,7 +95,6 @@ EOF
genrsa => "rsa",
rsautl => "rsa",
gendh => "dh",
- ecparam => "ec",
pkcs12 => "des",
);
my %cmd_deprecated = (
@@ -103,6 +102,8 @@ EOF
dsaparam => [ "3_0", "pkeyparam", "dsa" ],
dsa => [ "3_0", "pkey", "dsa" ],
gendsa => [ "3_0", "genpkey", "dsa" ],
+ ec => [ "3_0", "pkey", "ec" ],
+ ecparam => [ "3_0", "pkeyparam", "ec" ],
);
print "FUNCTION functions[] = {\n";