Skip to content

wolfCrypt input validation and side-channel hardening#10392

Open
JeremiahM37 wants to merge 6 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-5
Open

wolfCrypt input validation and side-channel hardening#10392
JeremiahM37 wants to merge 6 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-5

Conversation

@JeremiahM37
Copy link
Copy Markdown
Contributor

Fixes F-3066, F-3548, F-3549, F-3550, F-3551, F-3552, F-3553, F-3554, F-3558, F-3559

  • Validate NULL args at public API boundary in wc_BankRef_Release and wc_CMAC_Grow.
  • Reject export of private key when privKeySet/privSet is unset for ed25519, ed448, curve25519, curve448 (was returning success with zero bytes).
  • Fix wc_hash2sz returning 24 for SHA-224 instead of 28; affected RSA-PSS salt validation in Pkcs11RsaEncrypt.
  • Replace data-dependent branch in mp_cond_swap_ct/_ex (heap-math) with masked XOR; the branch leaked the secret scalar bit through ECC's cache-resistant ladder.
  • Acquire entropy_mutex in wc_Entropy_GetRawEntropy to match wc_Entropy_Get; prior code raced on entropyHash, entropy_state, and the timer-thread globals.
  • Parse the optional prf AlgorithmIdentifier in PKCS7 PWRI PBKDF2-params; previously hardcoded SHA-1 and would mis-parse messages carrying explicit HMAC-SHA-256/384/512.
  • Tests: cover the export-private rejections for the four ed/curve types.

@JeremiahM37 JeremiahM37 self-assigned this May 4, 2026
@JeremiahM37 JeremiahM37 force-pushed the fenrir-5 branch 2 times, most recently from a526990 to 5cfeb79 Compare May 4, 2026 17:16
@JeremiahM37 JeremiahM37 force-pushed the fenrir-5 branch 4 times, most recently from e732bb5 to ca0c39e Compare May 4, 2026 17:59
Copy link
Copy Markdown

@wolfSSL-Fenrir-bot wolfSSL-Fenrir-bot left a comment

Choose a reason for hiding this comment

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

Fenrir Automated Review — PR #10392

Scan targets checked: wolfcrypt-bugs, wolfcrypt-src

No new issues found in the changed files. ✅

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 4, 2026

MemBrowse Memory Report

No memory changes detected for:

@JeremiahM37
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

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