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:
committed by
mergify[bot]
parent
5a6455e04c
commit
f335d91a3b
@@ -430,6 +430,8 @@ Sha512HashAll (
|
|||||||
OUT UINT8 *HashValue
|
OUT UINT8 *HashValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
SHA512_CTX Context;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check input parameters.
|
// Check input parameters.
|
||||||
//
|
//
|
||||||
@@ -444,9 +446,17 @@ Sha512HashAll (
|
|||||||
//
|
//
|
||||||
// OpenSSL SHA-512 Hash Computation.
|
// OpenSSL SHA-512 Hash Computation.
|
||||||
//
|
//
|
||||||
if (SHA512 (Data, DataSize, HashValue) == NULL) {
|
if (!SHA512_Init (&Context)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (!SHA512_Update (&Context, Data, DataSize)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!SHA512_Final (HashValue, &Context)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Reference in New Issue
Block a user