Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: c0f5c36f01eeebf9faeb3fd5dd6e54479fb4027f
https://github.com/WebKit/WebKit/commit/c0f5c36f01eeebf9faeb3fd5dd6e54479fb4027f
Author: Claudio Saavedra <[email protected]>
Date: 2026-10-05 (Mon, 05 Oct 2026)
Changed paths:
M Source/WebCore/PAL/pal/crypto/openssl/CryptoDigestOpenSSL.cpp
Log Message:
-----------
[OpenSSL] Port PAL::CryptoDigest to the EVP digest API
https://bugs.webkit.org/show_bug.cgi?id=326065
Reviewed by Patrick Griffis and Javier Fernandez.
The SHA*_Init(), SHA*_Update() and SHA*_Final() functions are deprecated
since OpenSSL 3.0, and this file fails to build against it when warnings are
fatal. Use EVP_DigestInit_ex(), EVP_DigestUpdate() and EVP_DigestFinal_ex()
instead, which SHA256_Init(3) names as the replacements and which OpenSSL,
BoringSSL and LibreSSL all document. One context type holding an EVP_MD_CTX
replaces the per-algorithm function tables and the template instantiated
from them.
Part of the migration tracked in https://bugs.webkit.org/show_bug.cgi?id=245146.
No new tests; the digests produced are unchanged and covered by the
CryptoDigest tests in TestWebKitAPI.
* Source/WebCore/PAL/pal/crypto/openssl/CryptoDigestOpenSSL.cpp:
(PAL::Crypto::CryptoDigestContext::create): Return null when the context
cannot be allocated or initialized, which EVP_MD_CTX_new() and
EVP_DigestInit_ex() can report and SHA*_Init() could not.
(PAL::Crypto::CryptoDigestContext::CryptoDigestContext):
(PAL::Crypto::CryptoDigestContext::~CryptoDigestContext):
(PAL::Crypto::CryptoDigestContext::addBytes): Assert that the update
succeeded; its result was already ignored.
(PAL::Crypto::CryptoDigestContext::computeHash): Assert that the digest
length matches the buffer.
(PAL::Crypto::createCryptoDigest):
(PAL::Crypto::CryptoDigest::create): Return null when the context could not
be created, matching the libgcrypt backend. CryptoAlgorithm::dispatchDigest()
checks for it; most other callers do not, as is already the case with
libgcrypt.
Canonical link: https://commits.webkit.org/322711@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications