9
0
Fork 0

sha2: fix invalid length check

length is unsigned an thus can never be <0.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Lucas Stach 2014-10-20 20:15:59 +02:00 committed by Sascha Hauer
parent e0fd4cb13a
commit 03e9bcde47
1 changed files with 1 additions and 1 deletions

View File

@ -208,7 +208,7 @@ static void sha2_update(sha2_context * ctx, const uint8_t * input, size_t length
size_t fill;
uint32_t left;
if (length <= 0)
if (length == 0)
return;
left = ctx->total[0] & 0x3F;