From abdf35158e4398deedcf160c28bd07c7080edf47 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Wed, 7 Dec 2022 18:50:51 -0500 Subject: [PATCH] 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) --- apps/storeutl.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/storeutl.c b/apps/storeutl.c index 6858680f82e9b..249dc75c83acb 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;