CryptoPkg/BaseCryptLib: avoid using SHA384()

In openssl 3.0 SHA384() 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:57 +08:00 committed by mergify[bot]
parent 7fc183df71
commit 5a6455e04c

View File

@ -204,6 +204,8 @@ Sha384HashAll (
OUT UINT8 *HashValue OUT UINT8 *HashValue
) )
{ {
SHA512_CTX Context;
// //
// Check input parameters. // Check input parameters.
// //
@ -218,11 +220,19 @@ Sha384HashAll (
// //
// OpenSSL SHA-384 Hash Computation. // OpenSSL SHA-384 Hash Computation.
// //
if (SHA384 (Data, DataSize, HashValue) == NULL) { if (!SHA384_Init (&Context)) {
return FALSE; return FALSE;
} else {
return TRUE;
} }
if (!SHA384_Update (&Context, Data, DataSize)) {
return FALSE;
}
if (!SHA384_Final (HashValue, &Context)) {
return FALSE;
}
return TRUE;
} }
/** /**