All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-2.4] crypto: Fix aes_decrypt_wrapper()
@ 2015-07-17 17:48 Kevin Wolf
  2015-07-17 17:50 ` Daniel P. Berrange
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Wolf @ 2015-07-17 17:48 UTC (permalink / raw)
  To: qemu-block; +Cc: kwolf, peter.maydell, rkrcmar, qemu-devel, pbonzini

Commit d3462e3 broke qcow2's encryption functionality by using encrypt
instead of decrypt in the wrapper function it introduces. This was found
by qemu-iotests case 134.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 crypto/cipher-nettle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/crypto/cipher-nettle.c b/crypto/cipher-nettle.c
index a55a8e8..b01cb1c 100644
--- a/crypto/cipher-nettle.c
+++ b/crypto/cipher-nettle.c
@@ -47,7 +47,7 @@ static void aes_encrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,
 static void aes_decrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,
                                 uint8_t *dst, const uint8_t *src)
 {
-    aes_encrypt(ctx, length, dst, src);
+    aes_decrypt(ctx, length, dst, src);
 }
 
 static void des_encrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH for-2.4] crypto: Fix aes_decrypt_wrapper()
  2015-07-17 17:48 [Qemu-devel] [PATCH for-2.4] crypto: Fix aes_decrypt_wrapper() Kevin Wolf
@ 2015-07-17 17:50 ` Daniel P. Berrange
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel P. Berrange @ 2015-07-17 17:50 UTC (permalink / raw)
  To: Kevin Wolf; +Cc: peter.maydell, pbonzini, qemu-devel, qemu-block, rkrcmar

On Fri, Jul 17, 2015 at 07:48:20PM +0200, Kevin Wolf wrote:
> Commit d3462e3 broke qcow2's encryption functionality by using encrypt
> instead of decrypt in the wrapper function it introduces. This was found
> by qemu-iotests case 134.
> 
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  crypto/cipher-nettle.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/crypto/cipher-nettle.c b/crypto/cipher-nettle.c
> index a55a8e8..b01cb1c 100644
> --- a/crypto/cipher-nettle.c
> +++ b/crypto/cipher-nettle.c
> @@ -47,7 +47,7 @@ static void aes_encrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,
>  static void aes_decrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,
>                                  uint8_t *dst, const uint8_t *src)
>  {
> -    aes_encrypt(ctx, length, dst, src);
> +    aes_decrypt(ctx, length, dst, src);
>  }
>  
>  static void des_encrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length,

  Reviewed-by: Daniel P. Berrange <berrange@redhat.com>

Glad I added the iotest 134 for encrypted qcow :-)

Regards,
Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

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

end of thread, other threads:[~2015-07-17 17:50 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-17 17:48 [Qemu-devel] [PATCH for-2.4] crypto: Fix aes_decrypt_wrapper() Kevin Wolf
2015-07-17 17:50 ` Daniel P. Berrange

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.