Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The regression test passes even without the fix in a supported hash configuration because it supplies the wrong digest length, triggering BAD_FUNC_ARG before reaching the new guard.
1 open issue
What changed in this PR
Addresses F-16254 in wolfCrypt’s PKCS#7 verification by rejecting caller-supplied hashes for pure-mode ML-DSA signatures without signed attributes, rather than silently ignoring them.
Changes:
- Return
BAD_FUNC_ARGfor unsupported hash input in the ML-DSA verification path. - Add a negative regression test for SignedData without signed attributes.
| File | Description |
|---|---|
wolfcrypt/test/test.c |
Adds a regression test expecting caller-supplied hash rejection. |
wolfcrypt/src/pkcs7.c |
Rejects hash input for ML-DSA verification without signed attributes. |
Review effort: Balanced
|
rlm2002
force-pushed
the
f16254
branch
2 times, most recently
from
November 5, 2026 17:46
2e258f8 to
4792d8f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
wc_PKCS7_SignedDataVerifySignature()'s ML-DSA case verifies the complete message (RFC 9882 pure mode), not a digest. When a bundle has no signed attributes,hashBufwas never checked against anythingwc_PKCS7_VerifySignedData_ex(), and would silently ignore. RejecthashBufoutright in that case instead.Fixes F-16254
Testing
./configure --enable-pkcs7 --enable-mldsa && ./wolfcrypt/test/testwolfcryptChecklist