openssl: prefer modern API flavors for EVP_MD_CTX new/free#22219
Closed
vszakats wants to merge 2 commits into
Closed
openssl: prefer modern API flavors for EVP_MD_CTX new/free#22219vszakats wants to merge 2 commits into
EVP_MD_CTX new/free#22219vszakats wants to merge 2 commits into
Conversation
EVP_MD_CTX new/freeEVP_MD_CTX new/free
There was a problem hiding this comment.
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()withEVP_MD_CTX_new()in OpenSSL-backed SHA code paths. - Replace
EVP_MD_CTX_destroy()withEVP_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Available in all supported OpenSSL flavors and versions. They are
functionally identical to the legacy API calls.