openssl / openssl/openssl

`openssl cms -decrypt -stream` support

Open
#26,372 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triaged: feature
Dominant language
C
Stars
30.8k
Forks
11.5k
Avg merge
10m
Merged PRs (30d)
1

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the openssl cms -decrypt -stream entry point and compare it with the supported -encrypt -stream behavior, using issue #26274 for context. Check how fadvice() could apply to plain-file input. Done means decryption and the mentioned signature-verification use case stream without loading the whole file into memory, and -stream is no longer silently ignored.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
cryptography
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.