Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Radim Krčmář
2015-07-10 14:56+0100, Peter Maydell: > On 10 July 2015 at 14:38, Peter Maydell wrote: >> On 10 July 2015 at 14:31, Radim Krčmář wrote: >>> We pass 'ctx' as a 'void *' in the code, but these functions accept >>> specialized structures, which makes them incompatible: >>> >>> void nettle_cipher_f

Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Radim Krčmář
2015-07-10 14:38+0100, Peter Maydell: > On 10 July 2015 at 14:31, Radim Krčmář wrote: >> 2015-07-10 13:56+0100, Peter Maydell: >>> On 10 July 2015 at 13:33, Radim Krčmář wrote: @@ -83,8 +87,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm alg, -ctx->alg_encryp

Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Peter Maydell
On 10 July 2015 at 14:38, Peter Maydell wrote: > On 10 July 2015 at 14:31, Radim Krčmář wrote: >> We pass 'ctx' as a 'void *' in the code, but these functions accept >> specialized structures, which makes them incompatible: >> >> void nettle_cipher_func(const void *ctx, size_t length, [...]) >>

Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Peter Maydell
On 10 July 2015 at 14:31, Radim Krčmář wrote: > 2015-07-10 13:56+0100, Peter Maydell: >> On 10 July 2015 at 13:33, Radim Krčmář wrote: >>> @@ -83,8 +87,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm >>> alg, >>> -ctx->alg_encrypt = (nettle_crypt_func *)des_encrypt; >>> -

Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Radim Krčmář
2015-07-10 13:56+0100, Peter Maydell: > On 10 July 2015 at 13:33, Radim Krčmář wrote: >> @@ -83,8 +87,8 @@ QCryptoCipher *qcrypto_cipher_new(QCryptoCipherAlgorithm >> alg, >> -ctx->alg_encrypt = (nettle_crypt_func *)des_encrypt; >> -ctx->alg_decrypt = (nettle_crypt_func *)des_decr

Re: [Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Peter Maydell
On 10 July 2015 at 13:33, Radim Krčmář wrote: > 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-n

[Qemu-devel] [PATCH] crypt: fix build with nettle >= 3.0.0

2015-07-10 Thread Radim Krčmář
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/