[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 14/41] virtio-crypto: use the correct length for ciph
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 14/41] virtio-crypto: use the correct length for cipher operation |
Date: |
Tue, 10 Jan 2017 07:39:56 +0200 |
From: Gonglei <address@hidden>
In some modes of cipher algorithms, the length of destination data
maybe larger then source data, such as ciphertext stealing (CTS).
For symmetric algorithms, the length of ciphertext is definitly
equal to the plaintext for each crypto operation. So we should
use the src_len instead of dst_len avoid to pass the incorrect
cryptographical results to the frontend driver.
Signed-off-by: Gonglei <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
hw/virtio/virtio-crypto.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/virtio/virtio-crypto.c b/hw/virtio/virtio-crypto.c
index c23e1ad..f872c87 100644
--- a/hw/virtio/virtio-crypto.c
+++ b/hw/virtio/virtio-crypto.c
@@ -355,7 +355,7 @@ virtio_crypto_sym_input_data_helper(VirtIODevice *vdev,
return;
}
- len = sym_op_info->dst_len;
+ len = sym_op_info->src_len;
/* Save the cipher result */
s = iov_from_buf(req->in_iov, req->in_num, 0, sym_op_info->dst, len);
if (s != len) {
--
MST
[Qemu-devel] [PULL 09/41] virtio-pci: address space translation service (ATS) support, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 10/41] acpi: add ATSR for q35, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 11/41] memory: handle alias for iommu notifier, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 12/41] memory: handle alias in memory_region_is_iommu(), Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 13/41] doc/pcie: correct command line examples, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 14/41] virtio-crypto: use the correct length for cipher operation,
Michael S. Tsirkin <=
[Qemu-devel] [PULL 15/41] cryptodev: introduce a new is_used property, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 16/41] cryptodev: wrap the ready flag, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 17/41] virtio-crypto-pci: add check for cryptodev object, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 18/41] virtio-crypto: avoid one cryptodev device is used by multiple virtio crypto devices, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 19/41] virtio-crypto-pci: tag virtio-crypto device hot pluggable, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 20/41] virtio-crypto: zeroize the key material before free, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 21/41] pcie_aer: Convert pcie_aer_init to Error, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 23/41] virtio: fix vq->inuse recalc after migr, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 22/41] pcie_aer: support configurable AER capa version, Michael S. Tsirkin, 2017/01/10
[Qemu-devel] [PULL 24/41] balloon: Don't balloon roms, Michael S. Tsirkin, 2017/01/10