| From stable-bounces@linux.kernel.org Mon May 5 23:53:44 2008 |
| From: Herbert Xu <herbert@gondor.apana.org.au> |
| Date: Tue, 06 May 2008 14:01:24 +0800 |
| Subject: CRYPTO: eseqiv: Fix off-by-one encryption |
| To: stable@kernel.org |
| Message-ID: <E1JtGEu-0003xx-00@gondolin.me.apana.org.au> |
| |
| From: Herbert Xu <herbert@gondor.apana.org.au> |
| |
| [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> |
| |
| --- |
| crypto/eseqiv.c | 3 ++- |
| 1 file changed, 2 insertions(+), 1 deletion(-) |
| |
| --- a/crypto/eseqiv.c |
| +++ b/crypto/eseqiv.c |
| @@ -136,7 +136,8 @@ static int eseqiv_givencrypt(struct skci |
| } |
| |
| 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); |
| |