summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2022-07-26 08:53:48 +0300
committerHugo Landau <hlandau@openssl.org>2022-07-28 10:07:30 +0100
commit6ec0318130a31372c7f7da272afee2441a5b8b94 (patch)
tree1db4bebe4b6e6b88b0d4f87fd2f7effb9f6ad801 /crypto
parent68061255db06623e7332ac4dd1b2765a7d173a31 (diff)
REGRESSION: CMS_final: do not ignore CMS_dataFinal result
The CMS_dataFinal result is important as signature may fail, however, it is ignored while returning success from CMS_final. The SMIME_crlf_copy result is returned while it is ignored in the rest of the openssl code. Prefer the CMS_dataFinal result. This is regression from openssl-1. Blame finds c1669f41ei as root cause of regression. Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Hugo Landau <hlandau@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18876) (cherry picked from commit b03756130dadb3732b460a6efd930f1b226acdad)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/cms/cms_smime.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c
index 57c74f24a2..79589089c3 100644
--- a/crypto/cms/cms_smime.c
+++ b/crypto/cms/cms_smime.c
@@ -882,7 +882,7 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
return 0;
}
- ret = SMIME_crlf_copy(data, cmsbio, flags);
+ SMIME_crlf_copy(data, cmsbio, flags);
(void)BIO_flush(cmsbio);
@@ -890,6 +890,9 @@ int CMS_final(CMS_ContentInfo *cms, BIO *data, BIO *dcont, unsigned int flags)
ERR_raise(ERR_LIB_CMS, CMS_R_CMS_DATAFINAL_ERROR);
goto err;
}
+
+ ret = 1;
+
err:
do_free_upto(cmsbio, dcont);