Skip to content

Fenrir fixes#10601

Open
kareem-wolfssl wants to merge 7 commits into
wolfSSL:masterfrom
kareem-wolfssl:f3772
Open

Fenrir fixes#10601
kareem-wolfssl wants to merge 7 commits into
wolfSSL:masterfrom
kareem-wolfssl:f3772

Conversation

@kareem-wolfssl
Copy link
Copy Markdown
Contributor

Description

Fixes F-3772, F-3979, F-4005, F-3980, F-3759, F-4002, F-4113.

Testing

Built in tests.

Checklist

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

@kareem-wolfssl kareem-wolfssl self-assigned this Jun 5, 2026
Copilot AI review requested due to automatic review settings June 5, 2026 00:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

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 applies a set of defensive fixes across wolfCrypt and the TLS handshake layer to address multiple Fenrir issues, primarily by tightening argument/state validation, improving error propagation, and preventing resource leaks in hardware-backed code paths.

Changes:

  • Hardened parameter validation in XMSS public-length retrieval and RNG allocation helpers.
  • Improved Renesas TSIP RSA key generation and usage flow by returning meaningful error codes and freeing allocated buffers on failure.
  • Aligned/strengthened AEAD tag-size validation (AES-EAX) and corrected an alert severity used when rejecting renegotiation.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
wolfcrypt/src/wc_xmss.c Adds key->params NULL validation to prevent invalid dereference when computing XMSS public key length.
wolfcrypt/src/random.c Adds early rng == NULL guard in wc_rng_new_ex before writing through the pointer.
wolfcrypt/src/port/Renesas/renesas_tsip_rsa.c Returns real status from TSIP RSA keygen, logs failures, frees allocated key-pair buffers on error, and avoids unnecessary key import attempts.
wolfcrypt/src/port/cypress/psoc6_crypto.c Ensures SHA512/224 finalization failure is returned before attempting to re-init state.
wolfcrypt/src/aes.c Enforces WOLFSSL_MIN_AUTH_TAG_SZ minimum tag size for AES-EAX encrypt finalization (matching decrypt-side constraints).
src/internal.c Changes the renegotiation-rejection alert level from fatal to warning for no_renegotiation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread wolfcrypt/src/aes.c
Comment on lines 17558 to 17560
if (eax == NULL || authTag == NULL || authTagSz == 0 ||
authTagSz > WC_AES_BLOCK_SIZE) {
authTagSz > WC_AES_BLOCK_SIZE || authTagSz < WOLFSSL_MIN_AUTH_TAG_SZ) {
return BAD_FUNC_ARG;
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 5, 2026

MemBrowse Memory Report

gcc-arm-cortex-m0plus

  • FLASH: .text +8 B (+0.0%, 63,171 B / 262,144 B, total: 24% used)

gcc-arm-cortex-m3

  • FLASH: .text +8 B (+0.0%, 120,581 B / 262,144 B, total: 46% used)

gcc-arm-cortex-m4-pq

  • FLASH: .text +64 B (+0.0%, 276,184 B / 1,048,576 B, total: 26% used)

gcc-arm-cortex-m4-tls12

  • FLASH: .text +64 B (+0.1%, 121,357 B / 262,144 B, total: 46% used)

gcc-arm-cortex-m7-pq

  • FLASH: .text +64 B (+0.0%, 276,760 B / 1,048,576 B, total: 26% used)

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