mirror of
https://github.com/acidanthera/OpenCorePkg.git
synced 2026-02-01 15:59:39 +00:00
OcCryptoLib: Sha2
Add note regarding int overflow and mem limit
This commit is contained in:
parent
0b16565c18
commit
887aed4928
@ -282,7 +282,7 @@ Sha512 (
|
||||
|
||||
VOID
|
||||
Sha384Init (
|
||||
SHA384_CONTEXT *Context
|
||||
SHA384_CONTEXT *Context
|
||||
);
|
||||
|
||||
VOID
|
||||
|
||||
@ -493,7 +493,7 @@ Sha512 (
|
||||
//
|
||||
VOID
|
||||
Sha384Init (
|
||||
SHA384_CONTEXT *Context
|
||||
SHA384_CONTEXT *Context
|
||||
)
|
||||
{
|
||||
INTN Index;
|
||||
@ -556,6 +556,12 @@ Sha384Final (
|
||||
|
||||
BlockNb = ((SHA384_BLOCK_SIZE - 17) < (Context->Length % SHA384_BLOCK_SIZE)) + 1;
|
||||
|
||||
//
|
||||
// @TODO: Using 32 bit integer for data len doesn't work for a big memory blocks.
|
||||
// Also there are possible integer overflow
|
||||
// Context->TotalLength + Context->Length
|
||||
// Same thing for 512-bit implementation above
|
||||
//
|
||||
LenB = (Context->TotalLength + Context->Length) << 3;
|
||||
PmLen = BlockNb << 7;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user