Skip to content

Fix multiple Fenrir issues - #11181

Open
kareem-wolfssl wants to merge 12 commits into
wolfSSL:masterfrom
kareem-wolfssl:fbatch2
Open

Fix multiple Fenrir issues#11181
kareem-wolfssl wants to merge 12 commits into
wolfSSL:masterfrom
kareem-wolfssl:fbatch2

Conversation

@kareem-wolfssl

Copy link
Copy Markdown
Contributor

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

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@kareem-wolfssl kareem-wolfssl self-assigned this Aug 15, 2026
Copilot AI lite review requested due to automatic review settings August 15, 2026 01:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 thread wolfcrypt/src/evp.c
Comment on lines +11872 to +11873
if (ctx == NULL)
return WOLFSSL_FAILURE;
@github-actions

Copy link
Copy Markdown

MemBrowse Memory Report

gcc-arm-cortex-m0plus

  • FLASH: .text +12 B (+0.0%, 64,987 B / 262,144 B, total: 25% used)

gcc-arm-cortex-m3

  • FLASH: .text +8 B (+0.0%, 123,811 B / 262,144 B, total: 47% used)

gcc-arm-cortex-m4-baremetal

  • FLASH: .text +64 B (+0.1%, 67,619 B / 262,144 B, total: 26% used)

linuxkm-pie

  • Data: __patchable_function_entries +8 B (+0.0%, 26,592 B)

linuxkm-standard

  • Data: __patchable_function_entries +8 B (+0.0%, 49,424 B)

stm32-sim-stm32h753

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants