mirror of https://github.com/acidanthera/audk.git
CryptoPkg/BaseCryptLib: avoid using SHA256()
In openssl 3.0 SHA256() 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
437ed29f27
commit
7fc183df71
|
@ -202,6 +202,8 @@ Sha256HashAll (
|
|||
OUT UINT8 *HashValue
|
||||
)
|
||||
{
|
||||
SHA256_CTX Context;
|
||||
|
||||
//
|
||||
// Check input parameters.
|
||||
//
|
||||
|
@ -216,9 +218,17 @@ Sha256HashAll (
|
|||
//
|
||||
// OpenSSL SHA-256 Hash Computation.
|
||||
//
|
||||
if (SHA256 (Data, DataSize, HashValue) == NULL) {
|
||||
if (!SHA256_Init (&Context)) {
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!SHA256_Update (&Context, Data, DataSize)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SHA256_Final (HashValue, &Context)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue