From: Konstantin Shemyak Date: Thu, 28 Dec 2017 21:12:59 +0000 (+0200) Subject: Corrected 'cms' exit status when key or certificate cannot be opened X-Git-Tag: OpenSSL_1_0_2o~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2157adf66a3cb43b25a1441c5dcca0b287fa7c0d;p=openssl Corrected 'cms' exit status when key or certificate cannot be opened A backport of #4997. Fixes #4996. Reviewed-by: Matt Caswell Reviewed-by: Bernd Edlinger (Merged from https://github.com/openssl/openssl/pull/5020) --- diff --git a/apps/cms.c b/apps/cms.c index f9a63bc0d0..2626bbb6f8 100644 --- a/apps/cms.c +++ b/apps/cms.c @@ -977,12 +977,16 @@ int MAIN(int argc, char **argv) signer = load_cert(bio_err, signerfile, FORMAT_PEM, NULL, e, "signer certificate"); - if (!signer) + if (!signer) { + ret = 2; goto end; + } key = load_key(bio_err, keyfile, keyform, 0, passin, e, "signing key file"); - if (!key) + if (!key) { + ret = 2; goto end; + } for (kparam = key_first; kparam; kparam = kparam->next) { if (kparam->idx == i) { tflags |= CMS_KEY_PARAM;