mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-30 00:54:06 +02:00
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
|
OUT UINT8 *HashValue
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
SHA_CTX Context;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Check input parameters.
|
// Check input parameters.
|
||||||
//
|
//
|
||||||
@ -218,11 +220,19 @@ Sha1HashAll (
|
|||||||
//
|
//
|
||||||
// OpenSSL SHA-1 Hash Computation.
|
// OpenSSL SHA-1 Hash Computation.
|
||||||
//
|
//
|
||||||
if (SHA1 (Data, DataSize, HashValue) == NULL) {
|
if (!SHA1_Init (&Context)) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
} else {
|
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!SHA1_Update (&Context, Data, DataSize)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!SHA1_Final (HashValue, &Context)) {
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user