]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
CMP app: make -ignore_keyusage apply also for mock server
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Mon, 19 Dec 2022 10:09:33 +0000 (11:09 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Wed, 17 Jan 2024 14:03:40 +0000 (15:03 +0100)
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com>
(Merged from https://github.com/openssl/openssl/pull/19948)

apps/cmp.c
doc/man1/openssl-cmp.pod.in

index e0b03c3cb594b4a99ee6155f0b5983663ad27829..8a0d182fbe61cc376e2fc963221ae109f3ccb5a2 100644 (file)
@@ -1238,9 +1238,6 @@ static int setup_verification_ctx(OSSL_CMP_CTX *ctx)
         }
     }
 
-    if (opt_ignore_keyusage)
-        (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_IGNORE_KEYUSAGE, 1);
-
     if (opt_unprotected_errors)
         (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_UNPROTECTED_ERRORS, 1);
 
@@ -3244,6 +3241,9 @@ int cmp_main(int argc, char **argv)
     }
 #endif
 
+    if (opt_ignore_keyusage)
+        (void)OSSL_CMP_CTX_set_option(cmp_ctx, OSSL_CMP_OPT_IGNORE_KEYUSAGE, 1);
+
     if (opt_use_mock_srv
 #if !defined(OPENSSL_NO_SOCK) && !defined(OPENSSL_NO_HTTP)
         || opt_port != NULL
index 21e4bd95b72db3b43b408e68c93d871caf9c363b..b42c4227669069dd2cbee2764fb8a131d3ddfca6 100644 (file)
@@ -632,6 +632,7 @@ For details see the description of the B<-subject> option.
 Ignore key usage restrictions in CMP signer certificates when validating
 signature-based protection of incoming CMP messages.
 By default, C<digitalSignature> must be allowed by CMP signer certificates.
+This option applies to both CMP clients and the mock server.
 
 =item B<-unprotected_errors>