diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-17 08:12:19 +0200 |
---|---|---|
committer | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2020-06-22 16:39:26 +0200 |
commit | 11baa470a21b514ab247071e80273ddc0a80c504 (patch) | |
tree | 2cf15bc701207631d43d319f1eb2f670aa8abec6 /apps | |
parent | e197158bd5b5a5674b8ea67e838bac47395c66f9 (diff) |
Fix CMP -days option range checking and test failing with enable-ubsan
Reviewed-by: Nicola Tuveri <nic.tuv@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/12175)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/cmp.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/cmp.c b/apps/cmp.c index f80410fe9c..05fae77d38 100644 --- a/apps/cmp.c +++ b/apps/cmp.c @@ -1880,9 +1880,12 @@ static int setup_request_ctx(OSSL_CMP_CTX *ctx, ENGINE *e) } } - if (opt_days > 0) - (void)OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_VALIDITY_DAYS, - opt_days); + if (opt_days > 0 + && !OSSL_CMP_CTX_set_option(ctx, OSSL_CMP_OPT_VALIDITY_DAYS, + opt_days)) { + CMP_err("could to set requested cert validity period"); + goto err; + } if (opt_policies != NULL && opt_policy_oids != NULL) { CMP_err("cannot have policies both via -policies and via -policy_oids"); |