]> git.proxmox.com Git - mirror_qemu.git/commit
crypto: add sanity checking of plaintext/ciphertext length
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 16 Oct 2015 15:35:06 +0000 (16:35 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Thu, 22 Oct 2015 18:03:08 +0000 (19:03 +0100)
commit3a661f1eabf7e8db66e28489884d9b54aacb94ea
tree4a0b45548a6eb797c9c254797f065b2b5cd9b33e
parenteb2a770b178b9040c3fc04ee31dc38d1775db09a
crypto: add sanity checking of plaintext/ciphertext length

When encrypting/decrypting data, the plaintext/ciphertext
buffers are required to be a multiple of the cipher block
size. If this is not done, nettle will abort and gcrypt
will report an error. To get consistent behaviour add
explicit checks upfront for the buffer sizes.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
crypto/cipher-builtin.c
crypto/cipher-gcrypt.c
crypto/cipher-nettle.c
tests/test-crypto-cipher.c