From: Wolf Date: Tue, 20 Apr 2021 19:08:59 +0000 (-0500) Subject: Force public key to be included unless explicitly excluded with -no_public X-Git-Tag: openssl-3.0.0-alpha16~158 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b5644c2a09d6fd1f44321d2e16bea43729d73114;p=thirdparty%2Fopenssl.git Force public key to be included unless explicitly excluded with -no_public Send this before the CLA was accepted, amending to re-trigger check. Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/14947) --- diff --git a/apps/ec.c b/apps/ec.c index 3d5371ccdcd..5103838da03 100644 --- a/apps/ec.c +++ b/apps/ec.c @@ -211,10 +211,16 @@ int ec_main(int argc, char **argv) goto end; } - if (no_public - && !EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0)) { - BIO_printf(bio_err, "unable to disable public key encoding\n"); - goto end; + if (no_public) { + if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 0)) { + BIO_printf(bio_err, "unable to disable public key encoding\n"); + goto end; + } + } else { + if (!EVP_PKEY_set_int_param(eckey, OSSL_PKEY_PARAM_EC_INCLUDE_PUBLIC, 1)) { + BIO_printf(bio_err, "unable to enable public key encoding\n"); + goto end; + } } if (text) {