crypto: Fix aes_decrypt_wrapper()
PATCH 1/1 crypto: Fix aes_decrypt_wrapper()
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 <[email protected]>
--- crypto/cipher-nettle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/cipher-nettle.c +1 -1
@@ -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,
Signature · 1 line
1.8.3.1
Quoted 14 lines · Kevin Wolf
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 <[email protected]>--- crypto/cipher-nettle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)crypto/cipher-nettle.c +0
-0
crypto/cipher-nettle.c static void aes_encrypt_wrapper(cipher_ctx_t ctx, cipher_length_t length, · line 53
Quoted 8 lines
crypto/cipher-nettle.c +1
-1@@ -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 <[email protected]>
Glad I added the iotest 134 for encrypted qcow :-)
Regards,
Daniel
Signature · 4 lines
|: 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 :|