EVP_PKEY_decapsulate and EVP_PKEY_encapsulate docs inconsistent with extant providers
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 30.8k
- Forks
- 11.5k
- Avg merge
- 10m
- Merged PRs (30d)
- 1
Description
The issue came up in the review ML-KEM refactor PR: https://github.com/openssl/openssl/pull/26054#discussion_r1890252190
It appears that the new ML-KEM provider expected that the shared secret (and output ciphertext in the case of encapsulation) length pointers are non-NULL and hold the provided buffer sizes. However, the docs seem to suggest that these length pointers are optional.
If any application actually sends NULL pointers, null-pointer-deferences will follow in at least the ec and ecx providers.
Either the docs need to be updated, or this is a broad (easily fixed) bug in the extant providers.
Cc: @mattcaswell, @levitte, @t8m
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the EVP_PKEY_decapsulate and EVP_PKEY_encapsulate documentation and the ec, ecx, and ML-KEM provider implementations. Compare the documented handling of the length pointers with the provider expectations and the review discussion in PR #26054. Done means the API contract and provider behavior are consistent, with tests covering the relevant NULL-pointer cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- cryptography
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100