summaryrefslogtreecommitdiffstats
path: root/CryptoPkg/Library
diff options
context:
space:
mode:
Diffstat (limited to 'CryptoPkg/Library')
-rw-r--r--CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
index f105e6e577..4d7d92812c 100644
--- a/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
+++ b/CryptoPkg/Library/BaseCryptLib/Hash/CryptSha256.c
@@ -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;
}