summaryrefslogtreecommitdiff
path: root/crypto/eseqiv.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2008-05-06 10:01:24 +0400
committerGreg Kroah-Hartman <gregkh@suse.de>2008-05-10 08:40:52 +0400
commitd020055f5217be264e0bac9cd09ffc04233b9682 (patch)
tree26ac9e539badd03a893fcd44db75573abe0c41d2 /crypto/eseqiv.c
parent054640e012028f0c10d7e7ed7a601016c9251ca5 (diff)
downloadlinux-d020055f5217be264e0bac9cd09ffc04233b9682.tar.xz
CRYPTO: eseqiv: Fix off-by-one encryption
[CRYPTO] eseqiv: Fix off-by-one encryption [ Upstream commit: 46f8153cc59384eb09a426d044668d4801f818ce ] 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> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 b14f14e314b6..881d30910434 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);