9
0
Fork 0

Fix SHA224 to produce 28 bytes of hash (instead of 32).

This fixes a panic in sha224sum.

Signed-off-by: Krzysztof Hałasa <khc@pm.waw.pl>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Krzysztof Halasa 2012-06-07 15:05:11 +02:00 committed by Sascha Hauer
parent edfe50ce40
commit 76c7d6b3c7
1 changed files with 2 additions and 1 deletions

View File

@ -274,7 +274,8 @@ static void sha2_finish(sha2_context * ctx, uint8_t digest[32])
PUT_UINT32_BE(ctx->state[4], digest, 16);
PUT_UINT32_BE(ctx->state[5], digest, 20);
PUT_UINT32_BE(ctx->state[6], digest, 24);
PUT_UINT32_BE(ctx->state[7], digest, 28);
if (!ctx->is224)
PUT_UINT32_BE(ctx->state[7], digest, 28);
}
struct sha2 {