From: Simo Sorce Date: Wed, 7 Dec 2022 23:50:51 +0000 (-0500) Subject: Fix openssl storeutl to allow serial + issuer X-Git-Tag: openssl-3.2.0-alpha1~1588 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=abdf35158e4398deedcf160c28bd07c7080edf47;p=thirdparty%2Fopenssl.git Fix openssl storeutl to allow serial + issuer storeutl wants to enforce the use of issuer and serial together, however the current code prevents to use them together and returns an error if only one of them is specified. Signed-off-by: Simo Sorce Reviewed-by: Dmitry Belyavskiy Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/19856) --- diff --git a/apps/storeutl.c b/apps/storeutl.c index 6858680f82e..249dc75c83a 100644 --- a/apps/storeutl.c +++ b/apps/storeutl.c @@ -165,8 +165,7 @@ int storeutl_main(int argc, char *argv[]) break; case OPT_CRITERION_ISSUER: if (criterion != 0 - || (criterion == OSSL_STORE_SEARCH_BY_ISSUER_SERIAL - && issuer != NULL)) { + && criterion != OSSL_STORE_SEARCH_BY_ISSUER_SERIAL) { BIO_printf(bio_err, "%s: criterion already given.\n", prog); goto end; @@ -183,8 +182,7 @@ int storeutl_main(int argc, char *argv[]) break; case OPT_CRITERION_SERIAL: if (criterion != 0 - || (criterion == OSSL_STORE_SEARCH_BY_ISSUER_SERIAL - && serial != NULL)) { + && criterion != OSSL_STORE_SEARCH_BY_ISSUER_SERIAL) { BIO_printf(bio_err, "%s: criterion already given.\n", prog); goto end;