Skip to content

Fix PEM input validation and zeroize sensitive key buffers#10231

Merged
SparkiDev merged 3 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-issues-3
Apr 17, 2026
Merged

Fix PEM input validation and zeroize sensitive key buffers#10231
SparkiDev merged 3 commits intowolfSSL:masterfrom
JeremiahM37:fenrir-issues-3

Conversation

@JeremiahM37
Copy link
Copy Markdown
Contributor

Fixes F-2682, F-2209, F-2210, F-2211

  • Reject negative pemSz in wc_CertPemToDer / wc_PubKeyPemToDer (prevents word32 wrap →
    out-of-bounds XSTRNSTR).
  • Zero HMAC-DRBG K and V in wc_ecc_gen_deterministic_k before free (RFC 6979 state could leak nonce/private key).
  • Zero PKCS#12 key-bag tmp and keyBuf buffers at all free sites in wc_PKCS12_create_key_bag / wc_PKCS12_create (held raw private-key material).

Added negative/zero pemSz assertions to test_wc_CertPemToDer and test_wc_PubKeyPemToDer

@JeremiahM37 JeremiahM37 self-assigned this Apr 15, 2026
@JeremiahM37 JeremiahM37 changed the title Fenrir fixes Fix PEM input validation and zeroize sensitive key buffers Apr 15, 2026
@JeremiahM37
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please

@github-actions
Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

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 #10231

Scan targets checked: wolfcrypt-api_misuse, wolfcrypt-bugs, wolfcrypt-compliance, wolfcrypt-concurrency, wolfcrypt-consttime, wolfcrypt-defaults, wolfcrypt-mutation, wolfcrypt-portability, wolfcrypt-proptest, wolfcrypt-src, wolfcrypt-zeroize

Findings: 1
1 finding(s) posted as inline comments (see file-level comments below)

This review was generated automatically by Fenrir. Findings are non-blocking.

Comment thread wolfcrypt/src/ecc.c
@SparkiDev SparkiDev merged commit 318cd62 into wolfSSL:master Apr 17, 2026
416 checks passed
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.

4 participants