Skip to content

Commit

Permalink
[CRYPTO] eseqiv: Fix off-by-one encryption
Browse files Browse the repository at this point in the history
After attaching the IV to the head during encryption, eseqiv does not
increase the encryption length by that amount.  As such the last block
of the actual plain text will be left unencrypted.

Fortunately the only user of this code hifn currently crashes so this
shouldn't affect anyone :)

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
herbertx committed May 1, 2008
1 parent 8ec970d commit 46f8153
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/eseqiv.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ static int eseqiv_givencrypt(struct skcipher_givcrypt_request *req)
}

ablkcipher_request_set_crypt(subreq, reqctx->src, dst,
req->creq.nbytes, req->creq.info);
req->creq.nbytes + ivsize,
req->creq.info);

memcpy(req->creq.info, ctx->salt, ivsize);

Expand Down

0 comments on commit 46f8153

Please sign in to comment.