mirror of https://github.com/acidanthera/audk.git
CryptoPkg/BaseCryptLib: avoid using SHA1()
In openssl 3.0 SHA1() 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
c7c2599759
commit
437ed29f27
|
@ -204,6 +204,8 @@ Sha1HashAll (
|
|||
OUT UINT8 *HashValue
|
||||
)
|
||||
{
|
||||
SHA_CTX Context;
|
||||
|
||||
//
|
||||
// Check input parameters.
|
||||
//
|
||||
|
@ -218,11 +220,19 @@ Sha1HashAll (
|
|||
//
|
||||
// OpenSSL SHA-1 Hash Computation.
|
||||
//
|
||||
if (SHA1 (Data, DataSize, HashValue) == NULL) {
|
||||
if (!SHA1_Init (&Context)) {
|
||||
return FALSE;
|
||||
} else {
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (!SHA1_Update (&Context, Data, DataSize)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (!SHA1_Final (HashValue, &Context)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue