diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2023-02-14 03:19:57 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2023-03-07 09:59:50 +0000 |
commit | 5a6455e04cc2d1eab8124a7b7f5465c2f475c59c (patch) | |
tree | e8002a14ccf5ecc198f07a640ad01913024314a6 | |
parent | 7fc183df71b0aa2106139677258227662ce1f004 (diff) | |
download | edk2-5a6455e04cc2d1eab8124a7b7f5465c2f475c59c.zip edk2-5a6455e04cc2d1eab8124a7b7f5465c2f475c59c.tar.gz edk2-5a6455e04cc2d1eab8124a7b7f5465c2f475c59c.tar.bz2 |
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>
-rw-r--r-- | CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c index 59e5708..2ab7188 100644 --- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c +++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha512.c @@ -204,6 +204,8 @@ Sha384HashAll ( OUT UINT8 *HashValue
)
{
+ SHA512_CTX Context;
+
//
// Check input parameters.
//
@@ -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;
}
/**
|