diff mbox series

[PULL,05/17] crypto/nettle: Fix xts_encrypt arguments

Message ID 20200910100623.1088965-6-berrange@redhat.com
State Accepted
Commit d6f77401be1dd2f34d862724fbe128a2349d379b
Headers show
Series Crypto next patches | expand

Commit Message

Daniel P. Berrangé Sept. 10, 2020, 10:06 a.m. UTC
From: Richard Henderson <richard.henderson@linaro.org>


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>

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

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

-- 
2.26.2
diff mbox series

Patch

diff --git a/crypto/cipher-nettle.c.inc b/crypto/cipher-nettle.c.inc
index 256931a823..0404cfc6da 100644
--- a/crypto/cipher-nettle.c.inc
+++ b/crypto/cipher-nettle.c.inc
@@ -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,