Skip to content

Commit 56ab3cf

Browse files
herbertxopsiff
authored andcommitted
crypto: authencesn - Fix src offset when decrypting in-place
commit 1f48ad3b19a9dfc947868edda0bb8e48e5b5a8fa upstream. The src SG list offset wasn't set properly when decrypting in-place, fix it. Reported-by: Wolfgang Walter <linux@stwm.de> Fixes: e02494114ebf ("crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Eric Biggers <ebiggers@kernel.org> Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent b3aac24 commit 56ab3cf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

crypto/authencesn.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,9 +233,11 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
233233

234234
decrypt:
235235

236-
if (src != dst)
237-
src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
238236
dst = scatterwalk_ffwd(areq_ctx->dst, dst, assoclen);
237+
if (req->src == req->dst)
238+
src = dst;
239+
else
240+
src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
239241

240242
skcipher_request_set_tfm(skreq, ctx->enc);
241243
skcipher_request_set_callback(skreq, flags,

0 commit comments

Comments
 (0)