diff mbox

Fix use of libnettle

Message ID 1437034991-1940-1-git-send-email-ncornu@aldebaran.com
State New
Headers show

Commit Message

ncornu@aldebaran.com July 16, 2015, 8:23 a.m. UTC
From: Nicolas Cornu <ncornu@aldebaran.com>

With libnettle 3.1.1 a new struct is used

Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>
---
 crypto/cipher-nettle.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Peter Maydell July 16, 2015, 2:17 p.m. UTC | #1
On 16 July 2015 at 09:23,  <ncornu@aldebaran.com> wrote:
> From: Nicolas Cornu <ncornu@aldebaran.com>
>
> With libnettle 3.1.1 a new struct is used
>
> Signed-off-by: Nicolas Cornu <ncornu@aldebaran.com>

Thanks for the patch, but we already have patches on the list to
fix this one.

-- PMM
diff mbox

Patch

diff --git a/crypto/cipher-nettle.c b/crypto/cipher-nettle.c
index e5a14bc..f06ea92 100644
--- a/crypto/cipher-nettle.c
+++ b/crypto/cipher-nettle.c
@@ -27,8 +27,8 @@  typedef struct QCryptoCipherNettle QCryptoCipherNettle;
 struct QCryptoCipherNettle {
     void *ctx_encrypt;
     void *ctx_decrypt;
-    nettle_crypt_func *alg_encrypt;
-    nettle_crypt_func *alg_decrypt;
+    nettle_cipher_func *alg_encrypt;
+    nettle_cipher_func *alg_decrypt;
     uint8_t *iv;
     size_t niv;
 };
@@ -83,8 +83,8 @@  QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
         des_set_key(ctx->ctx_encrypt, rfbkey);
         g_free(rfbkey);
 
-        ctx->alg_encrypt = (nettle_crypt_func *)des_encrypt;
-        ctx->alg_decrypt = (nettle_crypt_func *)des_decrypt;
+        ctx->alg_encrypt = (nettle_cipher_func *)des_encrypt;
+        ctx->alg_decrypt = (nettle_cipher_func *)des_decrypt;
 
         ctx->niv = DES_BLOCK_SIZE;
         break;
@@ -98,8 +98,8 @@  QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg,
         aes_set_encrypt_key(ctx->ctx_encrypt, nkey, key);
         aes_set_decrypt_key(ctx->ctx_decrypt, nkey, key);
 
-        ctx->alg_encrypt = (nettle_crypt_func *)aes_encrypt;
-        ctx->alg_decrypt = (nettle_crypt_func *)aes_decrypt;
+        ctx->alg_encrypt = (nettle_cipher_func *)aes_encrypt;
+        ctx->alg_decrypt = (nettle_cipher_func *)aes_decrypt;
 
         ctx->niv = AES_BLOCK_SIZE;
         break;