qemu/crypto
Radim Krčmář becaeb726a crypto: fix build with nettle >= 3.0.0
In nettle 3, cbc_encrypt() accepts 'nettle_cipher_func' instead of
'nettle_crypt_func' and these two differ in 'const' qualifier of the
first argument.  The build fails with:

  In file included from crypto/cipher.c:71:0:
  ./crypto/cipher-nettle.c: In function ‘qcrypto_cipher_encrypt’:
  ./crypto/cipher-nettle.c:154:38: error: passing argument 2 of
  ‘nettle_cbc_encrypt’ from incompatible pointer type
           cbc_encrypt(ctx->ctx_encrypt, ctx->alg_encrypt,
                                               ^
  In file included from ./crypto/cipher-nettle.c:24:0,
                   from crypto/cipher.c:71:
  /usr/include/nettle/cbc.h:48:1: note: expected
  ‘void (*)(const void *, size_t, uint8_t *, const uint8_t *)
  but argument is of type
  ‘void (*)(      void *, size_t, uint8_t *, const uint8_t *)

To allow both versions, we switch to the new definition and #if typedef
it for old versions.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Message-Id: <1436548682-9315-2-git-send-email-rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2015-07-16 20:00:20 +02:00
..
aes.c crypto: move built-in AES implementation into crypto/ 2015-07-07 12:04:13 +02:00
cipher-builtin.c crypto: fix builtin qcrypto_cipher_free 2015-07-09 16:53:45 +02:00
cipher-gcrypt.c crypto: add a gcrypt cipher implementation 2015-07-08 13:11:01 +02:00
cipher-nettle.c crypto: fix build with nettle >= 3.0.0 2015-07-16 20:00:20 +02:00
cipher.c crypto: add a nettle cipher implementation 2015-07-08 13:11:01 +02:00
desrfb.c crypto: move built-in D3DES implementation into crypto/ 2015-07-07 12:04:31 +02:00
hash.c crypto: introduce new module for computing hash digests 2015-07-07 12:04:07 +02:00
init.c crypto: add a gcrypt cipher implementation 2015-07-08 13:11:01 +02:00
Makefile.objs crypto: introduce generic cipher API & built-in implementation 2015-07-08 13:11:01 +02:00