Skip to content

mbedtls: replace memset() with psa_hash_operation_init()#22220

Closed
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:mbedinittidy
Closed

mbedtls: replace memset() with psa_hash_operation_init()#22220
vszakats wants to merge 1 commit into
curl:masterfrom
vszakats:mbedinittidy

Conversation

@vszakats

@vszakats vszakats commented Jun 29, 2026

Copy link
Copy Markdown
Member

Copilot AI left a comment

Copy link
Copy Markdown

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 updates the mbedTLS+PSA-backed MD5 and SHA-256 implementations to initialize psa_hash_operation_t contexts using psa_hash_operation_init() instead of zeroing memory with memset(), aligning initialization with the PSA Crypto API’s intended usage.

Changes:

  • In lib/sha256.c, replace memset() initialization with psa_hash_operation_init() before calling psa_hash_setup().
  • In lib/md5.c, replace memset() initialization with psa_hash_operation_init() before calling psa_hash_setup().

Reviewed changes

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

File Description
lib/sha256.c Switch PSA SHA-256 context initialization from memset() to psa_hash_operation_init().
lib/md5.c Switch PSA MD5 context initialization from memset() to psa_hash_operation_init().

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

@vszakats vszakats closed this in 5b10939 Jun 30, 2026
@vszakats vszakats deleted the mbedinittidy branch June 30, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants