[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] crypto/cipher-nettle.c: Pass correct function t
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] crypto/cipher-nettle.c: Pass correct function type to cbc_encrypt and cbc_decrypt. |
Date: |
Thu, 16 Jul 2015 11:04:15 +0100 |
On 16 July 2015 at 10:55, Richard W.M. Jones <address@hidden> wrote:
> The prototypes of the {nettle_}cbc_encrypt and cbc_decrypt functions
> are:
>
> void
> cbc_encrypt(const void *ctx, nettle_cipher_func *f,
> size_t block_size, uint8_t *iv,
> size_t length, uint8_t *dst,
> const uint8_t *src);
>
> void
> cbc_decrypt(const void *ctx, nettle_cipher_func *f,
> size_t block_size, uint8_t *iv,
> size_t length, uint8_t *dst,
> const uint8_t *src);
>
> Since we passed nettle_crypt_func (instead of nettle_cipher_func) as
> the second argument, this gave the errors below.
>
> In file included from crypto/cipher.c:71:0:
> ./crypto/cipher-nettle.c: In function ‘qcrypto_cipher_encrypt’:
> ./crypto/cipher-nettle.c:154:39: error: passing argument 2 of
> ‘nettle_cbc_encrypt’ from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> 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 *) {aka void (*)(const void *, long
> unsigned int, unsigned char *, const unsigned char *)}’ but argument is of
> type ‘void (*)(void *, size_t, uint8_t *, const uint8_t *) {aka void
> (*)(void *, long unsigned int, unsigned char *, const unsigned char *)}’
> cbc_encrypt(const void *ctx, nettle_cipher_func *f,
> ^
> In file included from crypto/cipher.c:71:0:
> ./crypto/cipher-nettle.c: In function ‘qcrypto_cipher_decrypt’:
> ./crypto/cipher-nettle.c:183:21: error: passing argument 2 of
> ‘nettle_cbc_decrypt’ from incompatible pointer type
> [-Werror=incompatible-pointer-types]
> ctx->alg_decrypt, ctx->niv, ctx->iv,
> ^
> In file included from ./crypto/cipher-nettle.c:24:0,
> from crypto/cipher.c:71:
> /usr/include/nettle/cbc.h:54:1: note: expected ‘void (*)(const void *,
> size_t, uint8_t *, const uint8_t *) {aka void (*)(const void *, long
> unsigned int, unsigned char *, const unsigned char *)}’ but argument is of
> type ‘void (*)(void *, size_t, uint8_t *, const uint8_t *) {aka void
> (*)(void *, long unsigned int, unsigned char *, const unsigned char *)}’
> cbc_decrypt(const void *ctx, nettle_cipher_func *f,
Is this the same issue that Radim's patchset from a few days
back is addressing?
thanks
-- PMM