Skip to content

zero-initialize SHA-224/384/512 response structs#308

Merged
bigbrett merged 1 commit intomainfrom
SHA-init-0
Mar 18, 2026
Merged

zero-initialize SHA-224/384/512 response structs#308
bigbrett merged 1 commit intomainfrom
SHA-init-0

Conversation

@jackctj117
Copy link
Copy Markdown
Contributor

This pull request makes a small but important change to the initialization of the whMessageCrypto_Sha2Response structure in several SHA handler functions. The structure is now zero-initialized at declaration to prevent potential issues with uninitialized memory.

  • Crypto handler improvements:
    • Zero-initialize the whMessageCrypto_Sha2Response variable in the _HandleSha224, _HandleSha384, and _HandleSha512 functions in src/wh_server_crypto.c to ensure all fields are set to known values before use. [1] [2] [3]

Copilot AI review requested due to automatic review settings March 18, 2026 15:46
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 improves safety/consistency of SHA2 server-side handlers by zero-initializing whMessageCrypto_Sha2Response before it’s translated and sent back to the client, reducing the risk of returning uninitialized stack data.

Changes:

  • Zero-initialize whMessageCrypto_Sha2Response res in _HandleSha224
  • Zero-initialize whMessageCrypto_Sha2Response res in _HandleSha384
  • Zero-initialize whMessageCrypto_Sha2Response res in _HandleSha512

💡 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.

@bigbrett bigbrett merged commit bff6637 into main Mar 18, 2026
55 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