openssl/openssl

`openssl cms -decrypt -stream` support

Open

#26,372 opened on Jan 10, 2025

View on GitHub
 (6 comments) (0 reactions) (0 assignees)C (11,262 forks)batch import
help wantedtriaged: feature

Repository metrics

Stars
 (30,157 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

openssl cms -encrypt -stream is supported and may produce very large files. That's very good.

Unfortunately, current code that decrypts the result of such encryption loads the whole file into memory. It's inefficient, slow, and sometimes is a blocker for large encrypted files.

I think, streaming decryption (and signature verification in another use case) should be supported.

As a suggestion, if source is a plain file, fadvice() should be used if possible, in order not to pollute pagecache.

Here #26274 I figured out, that -stream is silently ignored on decryption and streaming decryption seems is not implemented at all.

Contributor guide