提交 bcb0ad2b 编写于 作者: H Herbert Xu 提交者: David S. Miller

[CRYPTO] sha1: Fixed off-by-64 bug in sha1_update

After a partial update, the done pointer is off to the right by 64 bytes.
Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
上级 afad2608
...@@ -61,8 +61,8 @@ static void sha1_update(void *ctx, const u8 *data, unsigned int len) ...@@ -61,8 +61,8 @@ static void sha1_update(void *ctx, const u8 *data, unsigned int len)
u32 temp[SHA_WORKSPACE_WORDS]; u32 temp[SHA_WORKSPACE_WORDS];
if (partial) { if (partial) {
done = 64 - partial; done = -partial;
memcpy(sctx->buffer + partial, data, done); memcpy(sctx->buffer + partial, data, done + 64);
src = sctx->buffer; src = sctx->buffer;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册