Skip to content

Commit

Permalink
CryptoPkg/BaseCryptLib: avoid using SHA384()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
  • Loading branch information
kraxel authored and mergify[bot] committed Mar 7, 2023
1 parent 7fc183d commit 5a6455e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,8 @@ Sha384HashAll (
OUT UINT8 *HashValue
)
{
SHA512_CTX Context;

//
// Check input parameters.
//
Expand All @@ -218,11 +220,19 @@ Sha384HashAll (
//
// OpenSSL SHA-384 Hash Computation.
//
if (SHA384 (Data, DataSize, HashValue) == NULL) {
if (!SHA384_Init (&Context)) {
return FALSE;
}

if (!SHA384_Update (&Context, Data, DataSize)) {
return FALSE;
} else {
return TRUE;
}

if (!SHA384_Final (HashValue, &Context)) {
return FALSE;
}

return TRUE;
}

/**
Expand Down

0 comments on commit 5a6455e

Please sign in to comment.