summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorLucas Stach <dev@lynxeye.de>2014-10-20 20:15:59 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2014-10-21 13:07:05 +0200
commit03e9bcde47f1ef277de161b37d5cb8bfffea98eb (patch)
tree6523e540ff0d155ce4037a760208a407fa9c6f38 /crypto
parente0fd4cb13adf623c601dec8fba10187cd42a067f (diff)
downloadbarebox-03e9bcde47f1ef277de161b37d5cb8bfffea98eb.tar.gz
barebox-03e9bcde47f1ef277de161b37d5cb8bfffea98eb.tar.xz
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>
Diffstat (limited to 'crypto')
-rw-r--r--crypto/sha2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/sha2.c b/crypto/sha2.c
index 26162e83e6..00a1af3419 100644
--- a/crypto/sha2.c
+++ b/crypto/sha2.c
@@ -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;