Skip to content

Commit bf7883e

Browse files
Ard Biesheuvelherbertx
authored andcommitted
crypto: arm64/sha1-ce - prevent asm code finalization in final() path
Ensure that the asm code finalization path is not triggered when invoked via final(), since it already takes care of that itself. Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
1 parent ac02c6e commit bf7883e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/crypto/sha1-ce-glue.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ static int sha1_ce_finup(struct shash_desc *desc, const u8 *data,
7474

7575
static int sha1_ce_final(struct shash_desc *desc, u8 *out)
7676
{
77+
struct sha1_ce_state *sctx = shash_desc_ctx(desc);
78+
79+
sctx->finalize = 0;
7780
kernel_neon_begin_partial(16);
7881
sha1_base_do_finalize(desc, (sha1_block_fn *)sha1_ce_transform);
7982
kernel_neon_end();

0 commit comments

Comments
 (0)