cms: Fix handling of -rctform option

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/16216)
This commit is contained in:
Tomas Mraz 2021-08-04 14:55:30 +02:00
parent f5c0f69619
commit 37578dc02d
1 changed files with 4 additions and 8 deletions

View File

@ -484,13 +484,9 @@ int cms_main(int argc, char **argv)
rr_allorfirst = 1;
break;
case OPT_RCTFORM:
if (rctformat == FORMAT_ASN1) {
if (!opt_format(opt_arg(),
OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat))
goto opthelp;
} else {
rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient");
}
if (!opt_format(opt_arg(),
OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat))
goto opthelp;
break;
case OPT_CERTFILE:
certfile = opt_arg();
@ -956,7 +952,7 @@ int cms_main(int argc, char **argv)
goto end;
}
rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient");
rcms = load_content_info(rctformat, rctin, 0, NULL, "receipt");
if (rcms == NULL)
goto end;
}