All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [crypto] s390-aes: use correct encrypt/decrypt function in fallback
@ 2007-12-08 12:42 Sebastian Siewior
  2007-12-10  7:49 ` Herbert Xu
  0 siblings, 1 reply; 2+ messages in thread
From: Sebastian Siewior @ 2007-12-08 12:42 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, Jan Glauber

crypto_blkcipher_decrypt is wrong because it does not care about
the IV.

Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>
---
 arch/s390/crypto/aes_s390.c |   10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c
index 8524611..46c9705 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;
-- 
1.5.3.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] [crypto] s390-aes: use correct encrypt/decrypt function in fallback
  2007-12-08 12:42 [PATCH] [crypto] s390-aes: use correct encrypt/decrypt function in fallback Sebastian Siewior
@ 2007-12-10  7:49 ` Herbert Xu
  0 siblings, 0 replies; 2+ messages in thread
From: Herbert Xu @ 2007-12-10  7:49 UTC (permalink / raw)
  To: linux-crypto, Jan Glauber

On Sat, Dec 08, 2007 at 01:42:30PM +0100, Sebastian Siewior wrote:
> crypto_blkcipher_decrypt is wrong because it does not care about
> the IV.
> 
> Signed-off-by: Sebastian Siewior <sebastian@breakpoint.cc>

Also applied.
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-12-10  7:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-08 12:42 [PATCH] [crypto] s390-aes: use correct encrypt/decrypt function in fallback Sebastian Siewior
2007-12-10  7:49 ` Herbert Xu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.