From: Sebastian Siewior Date: Mon, 10 Dec 2007 07:49:41 +0000 (+0800) Subject: [CRYPTO] s390-aes: Use correct encrypt/decrypt function in fallback X-Git-Tag: MMI-PSA29.97-13-9~37728^2~56 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d74d405fc5ea78b20a4a2efd24201db424e07b1;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git [CRYPTO] s390-aes: Use correct encrypt/decrypt function in fallback crypto_blkcipher_decrypt is wrong because it does not care about the IV. Signed-off-by: Sebastian Siewior Signed-off-by: Herbert Xu --- diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index 85246112ab5e..46c97058ebe1 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -234,13 +234,10 @@ static int fallback_blk_dec(struct blkcipher_desc *desc, struct crypto_blkcipher *tfm; struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); - memcpy(crypto_blkcipher_crt(sctx->fallback.blk)->iv, desc->info, - AES_BLOCK_SIZE); - tfm = desc->tfm; desc->tfm = sctx->fallback.blk; - ret = crypto_blkcipher_decrypt(desc, dst, src, nbytes); + ret = crypto_blkcipher_decrypt_iv(desc, dst, src, nbytes); desc->tfm = tfm; return ret; @@ -254,13 +251,10 @@ static int fallback_blk_enc(struct blkcipher_desc *desc, struct crypto_blkcipher *tfm; struct s390_aes_ctx *sctx = crypto_blkcipher_ctx(desc->tfm); - memcpy(crypto_blkcipher_crt(sctx->fallback.blk)->iv, desc->info, - AES_BLOCK_SIZE); - tfm = desc->tfm; desc->tfm = sctx->fallback.blk; - ret = crypto_blkcipher_encrypt(desc, dst, src, nbytes); + ret = crypto_blkcipher_encrypt_iv(desc, dst, src, nbytes); desc->tfm = tfm; return ret;