Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Corrected 'cms' exit status when key or certificate cannot be opened
Fixes #4996.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from #4997)
  • Loading branch information
KonstantinShemyak authored and bernd-edlinger committed Jan 6, 2018
1 parent ae880ae commit a032ed0
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/cms.c
Expand Up @@ -921,11 +921,15 @@ int cms_main(int argc, char **argv)
keyfile = sk_OPENSSL_STRING_value(skkeys, i);

signer = load_cert(signerfile, FORMAT_PEM, "signer certificate");
if (signer == NULL)
if (signer == NULL) {
ret = 2;
goto end;
}
key = load_key(keyfile, keyform, 0, passin, e, "signing key file");
if (key == NULL)
if (key == NULL) {
ret = 2;
goto end;
}
for (kparam = key_first; kparam; kparam = kparam->next) {
if (kparam->idx == i) {
tflags |= CMS_KEY_PARAM;
Expand Down

0 comments on commit a032ed0

Please sign in to comment.