diff options
author | Richard Levitte <levitte@openssl.org> | 2020-09-30 18:01:06 +0200 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-10-04 13:23:03 +0200 |
commit | 6514dee7264d30be1ab9ab07f9798071184e7b7a (patch) | |
tree | 3970a529c35aa4df0aaa1d178cea2b9954319317 /apps/req.c | |
parent | 70c06aafa691a77861bd3d3aaf93afa2a55e04ce (diff) |
APPS: Reduce deprecation warning suppression - ENGINE
Some of our apps turn off deprecation warnings solely for the sake of
ENGINE, and thereby shadowing other deprecations that we should take
better care of.
To solve this, all apps ENGINE functionality is move to one file,
where deprecation warning suppression is activate, and the same
suppression can then easily be removed in at least some of the apps.
Any remaining suppression that we still need to deal with should
happen as separate efforts.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13044)
Diffstat (limited to 'apps/req.c')
-rw-r--r-- | apps/req.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/apps/req.c b/apps/req.c index a3abc0b7b7..9fa3429baf 100644 --- a/apps/req.c +++ b/apps/req.c @@ -7,9 +7,6 @@ * https://www.openssl.org/source/license.html */ -/* We need to use some engine deprecated APIs */ -#define OPENSSL_SUPPRESS_DEPRECATED - #include <stdio.h> #include <stdlib.h> #include <time.h> @@ -288,7 +285,7 @@ int req_main(int argc, char **argv) break; case OPT_KEYGEN_ENGINE: #ifndef OPENSSL_NO_ENGINE - gen_eng = ENGINE_by_id(opt_arg()); + gen_eng = setup_engine(opt_arg(), 0); if (gen_eng == NULL) { BIO_printf(bio_err, "Can't find keygen engine %s\n", *argv); goto opthelp; @@ -991,7 +988,7 @@ int req_main(int argc, char **argv) lh_OPENSSL_STRING_doall(addexts, exts_cleanup); lh_OPENSSL_STRING_free(addexts); #ifndef OPENSSL_NO_ENGINE - ENGINE_free(gen_eng); + release_engine(gen_eng); #endif OPENSSL_free(keyalgstr); X509_REQ_free(req); @@ -1510,7 +1507,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, EVP_PKEY_asn1_get0_info(NULL, pkey_type, NULL, NULL, NULL, ameth); #ifndef OPENSSL_NO_ENGINE - ENGINE_finish(tmpeng); + finish_engine(tmpeng); #endif if (*pkey_type == EVP_PKEY_RSA) { if (p != NULL) { @@ -1571,7 +1568,7 @@ static EVP_PKEY_CTX *set_keygen_ctx(const char *gstr, EVP_PKEY_asn1_get0_info(NULL, NULL, NULL, NULL, &anam, ameth); *palgnam = OPENSSL_strdup(anam); #ifndef OPENSSL_NO_ENGINE - ENGINE_finish(tmpeng); + finish_engine(tmpeng); #endif } |