-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify getting an EVP_MD for all OpenSSL forks
In all versions of OpenSSL, EVP_sha{1,256}() return a pointer to static read-only data. There is no need to copy that data into a buffer that is immediately freed after use. In LibreSSL and OpenSSL 1.x, EVP_PKEY_CTX_set_signature_md() is a wrapper around EVP_PKEY_ctrl() whose void * argument isn't const (contrary to the documented signature), so we need to cast const away in some way. This preserves rs*_get_EVP_MD() to contain the pragma pollution necessary due to -Werror -Wcast-qual. The negative performance impact of calling EVP_sha*() multiple times called out in the OpenSSL 3.x application should not apply in this code. Closes: #794
- Loading branch information
Showing
2 changed files
with
8 additions
and
90 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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