diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2023-05-30 21:11:58 +0200 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2023-06-01 10:03:06 +0200 |
commit | 6ed117b32c40992d3211b65cfe1b9aec23652a7d (patch) | |
tree | b229d53115188300c02b33b2a4c9bd8d3266b042 | |
parent | 7a1857483938b6b6eec5b8760c68c71a71296cd2 (diff) |
apps/cmp.c: improve warnings on option use
Reviewed-by: Paul Dale <pauli@openssl.org>
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/21086)
-rw-r--r-- | apps/cmp.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index aec56b4425..18fd16625f 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -1560,7 +1560,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) if (!set_name(opt_subject, OSSL_CMP_CTX_set1_subjectName, ctx, "subject")) return 0; } else { - CMP_warn1("-subject %s since -ref or -cert is given", msg); + CMP_warn1("-subject %s since sender is taken from -ref or -cert", msg); } } if (opt_issuer != NULL) @@ -1575,6 +1575,16 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) CMP_warn1("-policies %s", msg); if (opt_policy_oids != NULL) CMP_warn1("-policy_oids %s", msg); + if (opt_cmd != CMP_P10CR) { + if (opt_implicit_confirm) + CMP_warn1("-implicit_confirm %s, and 'p10cr'", msg); + if (opt_disable_confirm) + CMP_warn1("-disable_confirm %s, and 'p10cr'", msg); + if (opt_certout != NULL) + CMP_warn1("-certout %s, and 'p10cr'", msg); + if (opt_chainout != NULL) + CMP_warn1("-chainout %s, and 'p10cr'", msg); + } } if (opt_cmd == CMP_KUR) { char *ref_cert = opt_oldcert != NULL ? opt_oldcert : opt_cert; @@ -1658,7 +1668,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) if (opt_csr != NULL) { if (opt_cmd == CMP_GENM) { - CMP_warn("-csr option is ignored for command 'genm'"); + CMP_warn("-csr option is ignored for 'genm' command"); } else { csr = load_csr_autofmt(opt_csr, FORMAT_UNDEF, NULL, "PKCS#10 CSR"); if (csr == NULL) @@ -1738,7 +1748,7 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *engine) if (opt_oldcert != NULL) { if (opt_cmd == CMP_GENM) { - CMP_warn("-oldcert option is ignored for command 'genm'"); + CMP_warn("-oldcert option is ignored for 'genm' command"); } else { X509 *oldcert = load_cert_pwd(opt_oldcert, opt_keypass, opt_cmd == CMP_KUR ? |