]> www.infradead.org Git - users/dwmw2/qemu.git/commitdiff
crypto/nettle: Fix xts_encrypt arguments
authorRichard Henderson <richard.henderson@linaro.org>
Fri, 28 Aug 2020 17:05:11 +0000 (10:05 -0700)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 10 Sep 2020 10:02:23 +0000 (11:02 +0100)
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

index 256931a823000f1ff7495c9130621573d133a669..0404cfc6daf54d44a140040f9cd25e7e067193e2 100644 (file)
@@ -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,