Skip to content

Hardening in wc_FreeRsaKey and wc_RsaPrivateKeyDecodeRaw#9893

Merged
douzzer merged 3 commits intowolfSSL:masterfrom
embhorn:f284-285
Mar 7, 2026
Merged

Hardening in wc_FreeRsaKey and wc_RsaPrivateKeyDecodeRaw#9893
douzzer merged 3 commits intowolfSSL:masterfrom
embhorn:f284-285

Conversation

@embhorn
Copy link
Member

@embhorn embhorn commented Mar 5, 2026

Description

Use force zero to harden RSA operations

Fixes:

  • f284
  • f285

Checklist

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

@embhorn embhorn self-assigned this Mar 5, 2026
Copilot AI review requested due to automatic review settings March 5, 2026 21:29
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

Hardens RSA key cleanup paths by always zeroizing private key material (even when key->type is not RSA_PRIVATE), reducing the risk of residual sensitive data after partial operations/failures.

Changes:

  • Update wc_FreeRsaKey to unconditionally mp_forcezero private-key fields instead of switching between mp_forcezero and mp_clear based on key->type.
  • Update wc_RsaPrivateKeyDecodeRaw failure/cleanup path to mp_forcezero private components (d, p, q, etc.) instead of mp_clear.

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

@philljj philljj added the For This Release Release version 5.9.0 label Mar 6, 2026
@embhorn
Copy link
Member Author

embhorn commented Mar 6, 2026

Jenkins retest this please

@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Mar 6, 2026
@embhorn
Copy link
Member Author

embhorn commented Mar 6, 2026

Retest this please

@douzzer douzzer added the Staged Staged for merge pending final test results and review label Mar 6, 2026
@douzzer douzzer merged commit d4ac953 into wolfSSL:master Mar 7, 2026
449 of 450 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 Staged Staged for merge pending final test results and review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants