Skip to content

Commit

Permalink
cmp.c: add protection context with srvcert for kem.
Browse files Browse the repository at this point in the history
  • Loading branch information
rajeev-0 committed Aug 8, 2023
1 parent 63fdfa7 commit ef46ddb
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,8 @@ static SSL_CTX *setup_ssl_ctx(OSSL_CMP_CTX *ctx, const char *host,
*/
static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
{
if (!opt_unprotected_requests && opt_secret == NULL && opt_key == NULL) {
if (!opt_unprotected_requests && opt_secret == NULL && opt_key == NULL
&& opt_srvcert == NULL) {
CMP_err("must give -key or -secret unless -unprotected_requests is used");
return 0;
}
Expand All @@ -1408,7 +1409,8 @@ static int setup_protection_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine)
CMP_err("must give -ref if no -cert and no -subject given");
return 0;
}
if (!opt_secret && ((opt_cert == NULL) != (opt_key == NULL))) {
if (!opt_secret && ((opt_cert == NULL) != (opt_key == NULL))
&& opt_srvcert == NULL) {
CMP_err("must give both -cert and -key options or neither");
return 0;
}
Expand Down

0 comments on commit ef46ddb

Please sign in to comment.