]> git.ipfire.org Git - thirdparty/openssl.git/commit
cms: Enable signing with hashless signing for no-attributes case
authorStefan Berger <stefanb@linux.ibm.com>
Mon, 13 Oct 2025 16:00:38 +0000 (11:00 -0500)
committerTomas Mraz <tomas@openssl.org>
Tue, 18 Nov 2025 17:03:24 +0000 (18:03 +0100)
commit3ee16555ee768f722a86b492b4cec7e013e667e5
tree3129ab3c7ff2ab5c6e2a17d070e37fdea9f58332
parente24de9f31736fbf60a8a2a9364f91ab0bf9f100b
cms: Enable signing with hashless signing for no-attributes case

Enable the ability to sign with a hashless signing schemes, such as ML-DSA
in pure mode, in case no attributes are used in CMS. To support this, pass
the BIO with the plain data through to the signing function so that key's
pure mode signing scheme can hash the data itself.

The current implementation relies on a seek'able BIO so that the data
stream can be read multiple times for support of multiple keys.

Some signing schemes, such as ML-DSA, support the message_update function
when signing data, others, such as EdDSA keys do not support it. The former
allows for reading data in smaller chunks and calling
EVP_PKEY_sign_message_update with the data, while the latter requires that
all data are all read into memory and then passed for signing. This latter
method could run into out-of-memory issue when signing very large files.

Fixes: #28279
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28923)
crypto/cms/cms_lib.c
crypto/cms/cms_local.h
crypto/cms/cms_sd.c
crypto/cms/cms_smime.c
doc/man3/CMS_final.pod
include/openssl/cms.h.in
util/libcrypto.num
util/missingcrypto.txt