Skip to content

Commit 1f48ad3

Browse files
committed
crypto: authencesn - Fix src offset when decrypting in-place
The src SG list offset wasn't set properly when decrypting in-place, fix it. Reported-by: Wolfgang Walter <[email protected]> Fixes: e024941 ("crypto: authencesn - Do not place hiseq at end of dst for out-of-place decryption") Signed-off-by: Herbert Xu <[email protected]>
1 parent 3ba3b02 commit 1f48ad3

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
@@ -228,9 +228,11 @@ static int crypto_authenc_esn_decrypt_tail(struct aead_request *req,
228228

229229
decrypt:
230230

231-
if (src != dst)
232-
src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
233231
dst = scatterwalk_ffwd(areq_ctx->dst, dst, assoclen);
232+
if (req->src == req->dst)
233+
src = dst;
234+
else
235+
src = scatterwalk_ffwd(areq_ctx->src, src, assoclen);
234236

235237
skcipher_request_set_tfm(skreq, ctx->enc);
236238
skcipher_request_set_callback(skreq, flags,

0 commit comments

Comments
 (0)