Skip to content

openssl: prefer modern API flavors for EVP_MD_CTX new/free#22219

Closed
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:openssl-modern
Closed

openssl: prefer modern API flavors for EVP_MD_CTX new/free#22219
vszakats wants to merge 2 commits into
curl:masterfrom
vszakats:openssl-modern

Conversation

@vszakats

@vszakats vszakats commented Jun 29, 2026

Copy link
Copy Markdown
Member

Available in all supported OpenSSL flavors and versions. They are
functionally identical to the legacy API calls.

@vszakats vszakats changed the title openssl: prefer modern API alernatives for EVP_MD_CTX new/free openssl: prefer modern API flavors for EVP_MD_CTX new/free Jun 29, 2026
@vszakats vszakats requested a review from Copilot June 29, 2026 16:53

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 modernizes curl’s OpenSSL digest context lifecycle calls by switching from the legacy EVP_MD_CTX_create/destroy API to EVP_MD_CTX_new/free, aligning with current OpenSSL-family APIs without changing behavior.

Changes:

  • Replace EVP_MD_CTX_create() with EVP_MD_CTX_new() in OpenSSL-backed SHA code paths.
  • Replace EVP_MD_CTX_destroy() with EVP_MD_CTX_free() in the corresponding cleanup/error paths.

Reviewed changes

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

File Description
lib/vtls/openssl.c Updates the SHA-256 helper to allocate/free digest contexts with EVP_MD_CTX_new/free.
lib/sha256.c Updates the OpenSSL-backed SHA-256 implementation to use EVP_MD_CTX_new/free for init/finalization.
lib/curl_sha512_256.c Updates the OpenSSL-backed SHA-512/256 implementation to use EVP_MD_CTX_new/free in init/finish paths.

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

@vszakats vszakats closed this in 2b59118 Jun 29, 2026
@vszakats vszakats deleted the openssl-modern branch June 29, 2026 18:05
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