summaryrefslogtreecommitdiff
path: root/crypto/eseqiv.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-04-29 21:57:01 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2008-05-01 18:22:28 +0800
commit6e51eda7b836172dd5dcbb8200cf3e8053db1ff7 (patch)
treecc9966644fc528f4a18e6309e27fb693e0e9dc40 /crypto/eseqiv.c
parentd93cc6a0d4e8b4fb74daf27a7244ad6493430153 (diff)
downloadlinux-crypto-6e51eda7b836172dd5dcbb8200cf3e8053db1ff7.tar.gz
linux-crypto-6e51eda7b836172dd5dcbb8200cf3e8053db1ff7.zip
[CRYPTO] eseqiv: Fix off-by-one encryption
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>
Diffstat (limited to 'crypto/eseqiv.c')
-rw-r--r--crypto/eseqiv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/crypto/eseqiv.c b/crypto/eseqiv.c
index b14f14e3..881d3091 100644
--- a/crypto/eseqiv.c
+++ b/crypto/eseqiv.c
@@ -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);