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 <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14947)
This commit is contained in:
Wolf 2021-04-20 14:08:59 -05:00 committed by Tomas Mraz
parent 309c6fbace
commit b5644c2a09
1 changed files with 10 additions and 4 deletions

View File

@ -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) {