mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
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:
parent
5a6455e04c
commit
f335d91a3b
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user