diff mbox series

[06/17] crypto/nettle: Fix xts_encrypt arguments

Message ID 20200813032537.2888593-7-richard.henderson@linaro.org
State Superseded
Headers show
Series crypto/cipher: Class hierarchy cleanups | expand

Commit Message

Richard Henderson Aug. 13, 2020, 3:25 a.m. UTC
The fourth argument to xts_encrypt should be the decrypt
callback; we were accidentally passing encrypt twice.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 crypto/cipher-nettle.inc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.25.1

Comments

Daniel P. Berrangé Aug. 17, 2020, 4:53 p.m. UTC | #1
On Wed, Aug 12, 2020 at 08:25:26PM -0700, Richard Henderson wrote:
> The fourth argument to xts_encrypt should be the decrypt

> callback; we were accidentally passing encrypt twice.

> 

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  crypto/cipher-nettle.inc.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)


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



Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
diff mbox series

Patch

diff --git a/crypto/cipher-nettle.inc.c b/crypto/cipher-nettle.inc.c
index 256931a823..0404cfc6da 100644
--- a/crypto/cipher-nettle.inc.c
+++ b/crypto/cipher-nettle.inc.c
@@ -632,7 +632,7 @@  qcrypto_nettle_cipher_encrypt(QCryptoCipher *cipher,
     case QCRYPTO_CIPHER_MODE_XTS:
 #ifdef CONFIG_QEMU_PRIVATE_XTS
         xts_encrypt(ctx->ctx, ctx->ctx_tweak,
-                    ctx->alg_encrypt_wrapper, ctx->alg_encrypt_wrapper,
+                    ctx->alg_encrypt_wrapper, ctx->alg_decrypt_wrapper,
                     ctx->iv, len, out, in);
 #else
         xts_encrypt_message(ctx->ctx, ctx->ctx_tweak,