[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 04/20] crypto: Redundant type conversion for AES_KEY pointer
From: |
Daniel P . Berrangé |
Subject: |
Re: [PULL 04/20] crypto: Redundant type conversion for AES_KEY pointer |
Date: |
Mon, 4 May 2020 13:58:24 +0100 |
User-agent: |
Mutt/1.13.4 (2020-02-15) |
Hi Chen,
This patch triggered a build failure in QEMU about discarding the
"const" qualifier.
IOW, the type conversion is not redundant after all - it is required
in order to explicitly discard "const".
I believe we can probably fix this by changing
qcrypto_cipher_aes_ecb_(en|de)crypt() methods so that they also have
a "const" qualifier on the AES_KEY parameter.
On Mon, May 04, 2020 at 01:57:42PM +0200, Laurent Vivier wrote:
> From: Chen Qun <address@hidden>
>
> Fix: eaec903c5b8
>
> Reported-by: Euler Robot <address@hidden>
> Signed-off-by: Chen Qun <address@hidden>
> Acked-by: Daniel P. Berrangé <address@hidden>
> Reviewed-by: Laurent Vivier <address@hidden>
> Message-Id: <address@hidden>
> Signed-off-by: Laurent Vivier <address@hidden>
> ---
> crypto/cipher-builtin.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/crypto/cipher-builtin.c b/crypto/cipher-builtin.c
> index bf8413e71a6e..99d6280a1669 100644
> --- a/crypto/cipher-builtin.c
> +++ b/crypto/cipher-builtin.c
> @@ -133,8 +133,7 @@ static void qcrypto_cipher_aes_xts_encrypt(const void
> *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_encrypt((AES_KEY *)&aesctx->enc,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_encrypt(&aesctx->enc, src, dst, length);
> }
>
>
> @@ -145,8 +144,7 @@ static void qcrypto_cipher_aes_xts_decrypt(const void
> *ctx,
> {
> const QCryptoCipherBuiltinAESContext *aesctx = ctx;
>
> - qcrypto_cipher_aes_ecb_decrypt((AES_KEY *)&aesctx->dec,
> - src, dst, length);
> + qcrypto_cipher_aes_ecb_decrypt(&aesctx->dec, src, dst, length);
> }
>
>
> --
> 2.26.2
>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [PULL 00/20] Trivial branch for 5.1 patches, Laurent Vivier, 2020/05/04
- [PULL 02/20] display/blizzard: use extract16() for fix clang analyzer warning in blizzard_draw_line16_32(), Laurent Vivier, 2020/05/04
- [PULL 01/20] scsi/esp-pci: add g_assert() for fix clang analyzer warning in esp_pci_io_write(), Laurent Vivier, 2020/05/04
- [PULL 06/20] hw/mem/pc-dimm: Print slot number on error at pc_dimm_pre_plug(), Laurent Vivier, 2020/05/04
- [PULL 09/20] MAINTAINERS: Update Keith Busch's email address, Laurent Vivier, 2020/05/04
- [PULL 03/20] timer/exynos4210_mct: Remove redundant statement in exynos4210_mct_write(), Laurent Vivier, 2020/05/04
- [PULL 13/20] blockdev: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL 04/20] crypto: Redundant type conversion for AES_KEY pointer, Laurent Vivier, 2020/05/04
- Re: [PULL 04/20] crypto: Redundant type conversion for AES_KEY pointer,
Daniel P . Berrangé <=
- [PULL 10/20] chardev: Add macOS to list of OSes that support -chardev serial, Laurent Vivier, 2020/05/04
- [PULL 07/20] hw/mem/pc-dimm: Fix line over 80 characters warning, Laurent Vivier, 2020/05/04
- [PULL 11/20] Compress lines for immediate return, Laurent Vivier, 2020/05/04
- [PULL 14/20] hw/i2c/pm_smbus: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL 08/20] elf_ops: Don't try to g_mapped_file_unref(NULL), Laurent Vivier, 2020/05/04
- [PULL 18/20] hw/gpio/aspeed_gpio: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL 05/20] MAINTAINERS: Mark the LatticeMico32 target as orphan, Laurent Vivier, 2020/05/04
- [PULL 16/20] hw/ide/sii3112: Remove dead assignment, Laurent Vivier, 2020/05/04
- [PULL 12/20] block: Avoid dead assignment, Laurent Vivier, 2020/05/04