Fix multiple Fenrir issues - #11181
Open
kareem-wolfssl wants to merge 12 commits into
Open
Conversation
…ove word32 max are handled correctly. (F-7103)
…y written and does not exceed the given size. (F-7631)
…t (bits not bytes). (F-9329)
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a set of reported “Fenrir” issues across the wolfCrypt and OpenSSL-compat layers, focusing on correctness fixes (buffer bounds, memory lifecycle, and API sizing) and adding regression tests to prevent reintroductions.
Changes:
- Align EVP DigestSignUpdate/DigestUpdate handling with size_t semantics and harden digest update behavior for large inputs.
- Fix/strengthen memory and bounds handling in SRP, PKCS7 (attributes + streaming), ECC ECIES decrypt behavior, and RNG/DRBG zeroization paths.
- Add targeted regression and boundary tests for PKCS7 streaming/attribute limits, ECC decrypt pubKey preservation, and SRP overwrite cleanup.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/openssl/evp.h | Updates OpenSSL-compat EVP_DigestSignUpdate prototype to use size_t. |
| wolfcrypt/src/evp.c | Refactors EVP digest update/sign/verify update behavior (chunking, HMAC path handling, memcpy safety). |
| wolfcrypt/src/srp.c | Ensures prior username/key buffers are freed and zeroized on overwrite to avoid leaks. |
| wolfcrypt/src/rng_bank.c | Simplifies reseed error handling to return any non-zero reseed result. |
| wolfcrypt/src/random.c | Adds tracking and explicit zeroization of DRBG digest temporaries. |
| wolfcrypt/src/pkcs7.c | Enforces attribute-array bounds, fixes streaming encode buffer sizing, and hardens streamed BER decode output bounds/overflow. |
| wolfcrypt/src/ecc.c | Prevents wc_ecc_decrypt() from freeing/overwriting a caller-supplied pubKey in default ECIES message format. |
| wolfcrypt/src/aes.c | Clarifies AES CFB1 doc comments about bit-length processing and buffer sizing. |
| wolfcrypt/test/test.c | Adds SRP regression coverage and PKCS7 auth/unauth attribute boundary regression test. |
| tests/api/test_pkcs7.h | Registers new PKCS7 streaming chunk boundary test. |
| tests/api/test_pkcs7.c | Adds BER multi-segment decode bounds regression and streaming encoder boundary tests. |
| tests/api/test_ecc.h | Registers new ECC decrypt pubKey preservation test. |
| tests/api/test_ecc.c | Adds ECC decrypt pubKey preservation regression and long-OID decode boundary test. |
| doc/dox_comments/header_files/ecc.h | Updates ECC decrypt Doxygen to reflect that pubKey is ignored/unchanged in the default message format. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+11872
to
+11873
| if (ctx == NULL) | ||
| return WOLFSSL_FAILURE; |
|
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
Fixes F-7103, F-7105, F-7135, F-7400, F-7414, F-7446, F-7623, F-7624, F-7631, F-8166, F-9329
Testing
Built in tests + added tests
Checklist