OSDN Git Service

crypto: Fix aes_decrypt_wrapper()
authorKevin Wolf <kwolf@redhat.com>
Fri, 17 Jul 2015 17:44:10 +0000 (19:44 +0200)
committerKevin Wolf <kwolf@redhat.com>
Mon, 20 Jul 2015 11:35:45 +0000 (13:35 +0200)
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>
Reviewed-by: Daniel P. Berrange <berrange@redhat.com>
crypto/cipher-nettle.c

index a55a8e8..b01cb1c 100644 (file)
@@ -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,