Skip to content

Commit

Permalink
CMP app: make -ignore_keyusage apply also for mock server
Browse files Browse the repository at this point in the history
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 #19948)
  • Loading branch information
DDvO committed Jan 17, 2024
1 parent 9710285 commit fd51437
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions doc/man1/openssl-cmp.pod.in
Original file line number Diff line number Diff line change
Expand Up @@ -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>

Expand Down

0 comments on commit fd51437

Please sign in to comment.