Skip to content

Fenrir fixes#9981

Merged
JacobBarthelmeh merged 16 commits intowolfSSL:masterfrom
julek-wolfssl:fenrir/260316
Mar 17, 2026
Merged

Fenrir fixes#9981
JacobBarthelmeh merged 16 commits intowolfSSL:masterfrom
julek-wolfssl:fenrir/260316

Conversation

@julek-wolfssl
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 15:33
@julek-wolfssl julek-wolfssl self-assigned this Mar 16, 2026
Copy link
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 hardens several cryptographic and session-handling paths by improving constant-time behavior, tightening error handling, and ensuring sensitive intermediates are wiped, alongside small CI workflow dependency bumps.

Changes:

  • Make PKCS#7 padding validation constant-time and add operation-state validation in EVP PKEY decrypt.
  • Improve EdDSA/Dilithium/DH/RSA secret handling by avoiding early-returns in some paths and zeroing sensitive buffers.
  • Fix robustness issues (bounds checks, memory free placement) and bump GitHub Actions versions in workflows.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
wolfcrypt/src/evp.c Constant-time padding verification and stricter decrypt op-state validation
wolfcrypt/src/ed448.c Adjust error-flow and wipe sensitive arrays after signing
wolfcrypt/src/ed25519.c Restructure signing flow to gate work on ret == 0 and wipe intermediates
wolfcrypt/src/eccsi.c Simplify error cleanup by delegating to wc_FreeEccsiKey
wolfcrypt/src/dilithium.c Zero seed material after key creation
wolfcrypt/src/dh.c Force-zero DH private scalar on cleanup
wolfcrypt/src/asn.c Guard init calls and adjust frees/logging in key OID detection
tests/api.c Check fwrite result and return failure on short write
src/ssl_sess.c Add missing bounds checks when decoding session ticket timing fields
src/pk_rsa.c Force-zero bignum temporary on cleanup
src/internal.c Adjust error codes/returns; fix pbuf free placement to avoid leaking on hash-failure
.github/workflows/threadx.yml Bump actions/cache to v4
.github/workflows/msys2.yml Bump actions/checkout to v4
.github/workflows/haproxy.yml Bump actions/checkout to v4
Comments suppressed due to low confidence (1)

src/internal.c:1

  • This change discards the specific error code from wolfSSL_set_quic_method() and always returns WOLFSSL_FATAL_ERROR. That reduces diagnosability and can change caller behavior if they rely on the underlying return value. Prefer returning ret (or mapping only specific error(s) to WOLFSSL_FATAL_ERROR while preserving detail via the return code or a consistent error-reporting mechanism).

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

You can also share your feedback on Copilot code review. Take the survey.

Copilot AI review requested due to automatic review settings March 16, 2026 22:16
@dgarske dgarske assigned wolfSSL-Bot and unassigned julek-wolfssl Mar 16, 2026
Copy link
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 focuses on tightening security/memory hygiene in cryptographic operations and improving robustness in a few APIs and CI workflows.

Changes:

  • Make padding validation constant-time and add operation-state validation for EVP PKEY decrypt.
  • Reduce sensitive data exposure by force-zeroing secrets and using force-zero clears for big integers.
  • Improve error handling/cleanup paths and update GitHub Actions workflow dependencies.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
wolfcrypt/src/evp.c Constant-time padding check and added decrypt-operation state validation.
wolfcrypt/src/ed448.c Propagate hash-init failures without early returns and clear sensitive buffers on exit.
wolfcrypt/src/ed25519.c Gate subsequent operations on ret == 0 and clear sensitive buffers on exit.
wolfcrypt/src/eccsi.c Simplify error cleanup by delegating to wc_FreeEccsiKey.
wolfcrypt/src/dilithium.c Clear generated seed after keygen.
wolfcrypt/src/dh.c Force-zero clear of temporary DH scalar.
wolfcrypt/src/asn.c Check init return codes and adjust free ordering in key OID detection.
tests/api.c Ensure file is closed on fwrite failure while returning correct status.
src/ssl_sess.c Fix session parse bounds checking for 32-bit vs 64-bit ticket time storage.
src/pk_rsa.c Force-zero clear of temporary MPI in RSA generation.
src/internal.c Adjust error codes and fix buffer free placement in issuer-hash loading.
.github/workflows/threadx.yml Bump actions/cache to v4.
.github/workflows/msys2.yml Bump actions/checkout to v4.
.github/workflows/haproxy.yml Bump actions/checkout to v4.
Comments suppressed due to low confidence (2)

src/internal.c:1

  • This changes the error code returned by InitSSL from WOLFSSL_FAILURE to BAD_STATE_E. If InitSSL is part of an API surface where callers expect the usual WOLFSSL_SUCCESS/WOLFSSL_FATAL_ERROR (or similar) convention, this can be a breaking/behavioral change. Consider keeping the return codes consistent with other InitSSL failure paths (or mapping internal errors to the established public error convention) and document the rationale if a different code is required.
    src/internal.c:1
  • This collapses the underlying wolfSSL_set_quic_method failure into a generic WOLFSSL_FATAL_ERROR, losing the original ret value. If ret conveys actionable detail (or is already in the correct public error-code space), prefer returning ret or translating specific errors explicitly so callers can diagnose configuration issues more precisely.

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

You can also share your feedback on Copilot code review. Take the survey.

@dgarske dgarske requested a review from JacobBarthelmeh March 17, 2026 13:16
@dgarske dgarske added the For This Release Release version 5.9.0 label Mar 17, 2026
@JacobBarthelmeh JacobBarthelmeh merged commit 6f386fd into wolfSSL:master Mar 17, 2026
496 of 500 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For This Release Release version 5.9.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants