CryptoPkg/BaseCryptLib: avoid using SHA512()

In openssl 3.0 SHA512() goes through the provider logic,
requiring a huge amount of openssl code.  The individual
functions do not, so use them instead.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
This commit is contained in:
Gerd Hoffmann 2023-02-14 03:19:58 +08:00 committed by mergify[bot]
parent 5a6455e04c
commit f335d91a3b

View File

@ -430,6 +430,8 @@ Sha512HashAll (
OUT UINT8 *HashValue
)
{
SHA512_CTX Context;
//
// Check input parameters.
//
@ -444,9 +446,17 @@ Sha512HashAll (
//
// OpenSSL SHA-512 Hash Computation.
//
if (SHA512 (Data, DataSize, HashValue) == NULL) {
if (!SHA512_Init (&Context)) {
return FALSE;
} else {
return TRUE;
}
if (!SHA512_Update (&Context, Data, DataSize)) {
return FALSE;
}
if (!SHA512_Final (HashValue, &Context)) {
return FALSE;
}
return TRUE;
}