<feed xmlns='http://www.w3.org/2005/Atom'>
<title>qemu/include/crypto, branch master</title>
<subtitle>QEMU development tree</subtitle>
<id>https://git.zx2c4.com/qemu/atom/include/crypto?h=master</id>
<link rel='self' href='https://git.zx2c4.com/qemu/atom/include/crypto?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/'/>
<updated>2024-07-24T09:39:10Z</updated>
<entry>
<title>crypto: propagate errors from TLS session I/O callbacks</title>
<updated>2024-07-24T09:39:10Z</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2024-03-15T14:29:11Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=97f7bf113eb50fcdaf0c73aa2ee01e5355abc073'/>
<id>urn:sha1:97f7bf113eb50fcdaf0c73aa2ee01e5355abc073</id>
<content type='text'>
GNUTLS doesn't know how to perform I/O on anything other than plain
FDs, so the TLS session provides it with some I/O callbacks. The
GNUTLS API design requires these callbacks to return a unix errno
value, which means we're currently loosing the useful QEMU "Error"
object.

This changes the I/O callbacks in QEMU to stash the "Error" object
in the QCryptoTLSSession class, and fetch it when seeing an I/O
error returned from GNUTLS, thus preserving useful error messages.

Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: push error reporting into TLS session I/O APIs</title>
<updated>2024-07-24T09:39:10Z</updated>
<author>
<name>Daniel P. Berrangé</name>
<email>berrange@redhat.com</email>
</author>
<published>2024-03-15T14:07:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=57941c9c86357a6a642f9ee3279d881df4043b6d'/>
<id>urn:sha1:57941c9c86357a6a642f9ee3279d881df4043b6d</id>
<content type='text'>
The current TLS session I/O APIs just return a synthetic errno
value on error, which has been translated from a gnutls error
value. This looses a large amount of valuable information that
distinguishes different scenarios.

Pushing population of the "Error *errp" object into the TLS
session I/O APIs gives more detailed error information.

Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@linaro.org&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto/block: drop qcrypto_block_open() n_threads argument</title>
<updated>2024-06-10T09:05:43Z</updated>
<author>
<name>Stefan Hajnoczi</name>
<email>stefanha@redhat.com</email>
</author>
<published>2024-05-27T15:58:51Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=3ab0f063e58ed9224237d69c4211ca83335164c4'/>
<id>urn:sha1:3ab0f063e58ed9224237d69c4211ca83335164c4</id>
<content type='text'>
The n_threads argument is no longer used since the previous commit.
Remove it.

Signed-off-by: Stefan Hajnoczi &lt;stefanha@redhat.com&gt;
Message-ID: &lt;20240527155851.892885-3-stefanha@redhat.com&gt;
Reviewed-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
Acked-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Kevin Wolf &lt;kwolf@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: Modify the qcrypto_block_create to support creation flags</title>
<updated>2024-02-09T12:50:37Z</updated>
<author>
<name>Hyman Huang</name>
<email>yong.huang@smartx.com</email>
</author>
<published>2024-01-30T05:37:21Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=d74523a3b395dc8470177dcdfa13644b98494334'/>
<id>urn:sha1:d74523a3b395dc8470177dcdfa13644b98494334</id>
<content type='text'>
Expand the signature of qcrypto_block_create to enable the
formation of LUKS volumes with detachable headers. To accomplish
that, introduce QCryptoBlockCreateFlags to instruct the creation
process to set the payload_offset_sector to 0.

Signed-off-by: Hyman Huang &lt;yong.huang@smartx.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: Support LUKS volume with detached header</title>
<updated>2024-02-09T12:50:33Z</updated>
<author>
<name>Hyman Huang</name>
<email>yong.huang@smartx.com</email>
</author>
<published>2024-01-30T05:37:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=9ad5c4e7ee513019e75ea8ece0d1da6ecce540e6'/>
<id>urn:sha1:9ad5c4e7ee513019e75ea8ece0d1da6ecce540e6</id>
<content type='text'>
By enhancing the LUKS driver, it is possible to implement
the LUKS volume with a detached header.

Normally a LUKS volume has a layout:
  disk:  | header | key material | disk payload data |

With a detached LUKS header, you need 2 disks so getting:
  disk1:  | header | key material |
  disk2:  | disk payload data |

There are a variety of benefits to doing this:
 * Secrecy - the disk2 cannot be identified as containing LUKS
             volume since there's no header
 * Control - if access to the disk1 is restricted, then even
             if someone has access to disk2 they can't unlock
             it. Might be useful if you have disks on NFS but
             want to restrict which host can launch a VM
             instance from it, by dynamically providing access
             to the header to a designated host
 * Flexibility - your application data volume may be a given
                 size and it is inconvenient to resize it to
                 add encryption.You can store the LUKS header
                 separately and use the existing storage
                 volume for payload
 * Recovery - corruption of a bit in the header may make the
              entire payload inaccessible. It might be
              convenient to take backups of the header. If
              your primary disk header becomes corrupt, you
              can unlock the data still by pointing to the
              backup detached header

Take the raw-format image as an example to introduce the usage
of the LUKS volume with a detached header:

1. prepare detached LUKS header images
$ dd if=/dev/zero of=test-header.img bs=1M count=32
$ dd if=/dev/zero of=test-payload.img bs=1M count=1000
$ cryptsetup luksFormat --header test-header.img test-payload.img
&gt; --force-password --type luks1

2. block-add a protocol blockdev node of payload image
$ virsh qemu-monitor-command vm '{"execute":"blockdev-add",
&gt; "arguments":{"node-name":"libvirt-1-storage", "driver":"file",
&gt; "filename":"test-payload.img"}}'

3. block-add a protocol blockdev node of LUKS header as above.
$ virsh qemu-monitor-command vm '{"execute":"blockdev-add",
&gt; "arguments":{"node-name":"libvirt-2-storage", "driver":"file",
&gt; "filename": "test-header.img" }}'

4. object-add the secret for decrypting the cipher stored in
   LUKS header above
$ virsh qemu-monitor-command vm '{"execute":"object-add",
&gt; "arguments":{"qom-type":"secret", "id":
&gt; "libvirt-2-storage-secret0", "data":"abc123"}}'

5. block-add the raw-drived blockdev format node
$ virsh qemu-monitor-command vm '{"execute":"blockdev-add",
&gt; "arguments":{"node-name":"libvirt-1-format", "driver":"raw",
&gt; "file":"libvirt-1-storage"}}'

6. block-add the luks-drived blockdev to link the raw disk
   with the LUKS header by specifying the field "header"
$ virsh qemu-monitor-command vm '{"execute":"blockdev-add",
&gt; "arguments":{"node-name":"libvirt-2-format", "driver":"luks",
&gt; "file":"libvirt-1-format", "header":"libvirt-2-storage",
&gt; "key-secret":"libvirt-2-format-secret0"}}'

7. hot-plug the virtio-blk device finally
$ virsh qemu-monitor-command vm '{"execute":"device_add",
&gt; "arguments": {"num-queues":"1", "driver":"virtio-blk-pci",
&gt; "drive": "libvirt-2-format", "id":"virtio-disk2"}}'

Starting a VM with a LUKS volume with detached header is
somewhat similar to hot-plug in that both maintaining the
same json command while the starting VM changes the
"blockdev-add/device_add" parameters to "blockdev/device".

Signed-off-by: Hyman Huang &lt;yong.huang@smartx.com&gt;
Reviewed-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
Signed-off-by: Daniel P. Berrangé &lt;berrange@redhat.com&gt;
</content>
</entry>
<entry>
<title>crypto: Add generic 64-bit carry-less multiply routine</title>
<updated>2023-09-15T13:57:00Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-07-11T09:10:47Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=00f463b38aa7cfca0bc65e3af7f2c49e1b9da690'/>
<id>urn:sha1:00f463b38aa7cfca0bc65e3af7f2c49e1b9da690</id>
<content type='text'>
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>crypto: Add generic 32-bit carry-less multiply routines</title>
<updated>2023-09-15T13:57:00Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-07-11T08:54:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=9a65a570fab1bf2e907d593631a6b588a821d365'/>
<id>urn:sha1:9a65a570fab1bf2e907d593631a6b588a821d365</id>
<content type='text'>
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>crypto: Add generic 16-bit carry-less multiply routines</title>
<updated>2023-09-15T13:57:00Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-07-11T08:14:58Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=cf1b2cab835f816915c8a170ec783922bc4e56a3'/>
<id>urn:sha1:cf1b2cab835f816915c8a170ec783922bc4e56a3</id>
<content type='text'>
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>crypto: Add generic 8-bit carry-less multiply routines</title>
<updated>2023-09-15T13:56:59Z</updated>
<author>
<name>Richard Henderson</name>
<email>richard.henderson@linaro.org</email>
</author>
<published>2023-07-10T14:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=07f348d77c35b6ff1f99075e20bffbf67e772d8b'/>
<id>urn:sha1:07f348d77c35b6ff1f99075e20bffbf67e772d8b</id>
<content type='text'>
Reviewed-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Signed-off-by: Richard Henderson &lt;richard.henderson@linaro.org&gt;
</content>
</entry>
<entry>
<title>crypto: Add SM4 constant parameter CK</title>
<updated>2023-09-11T01:45:55Z</updated>
<author>
<name>Max Chou</name>
<email>max.chou@sifive.com</email>
</author>
<published>2023-07-11T16:59:13Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/qemu/commit/?id=f5f3a9152ae1242f5d1113852aa97d13b382815b'/>
<id>urn:sha1:f5f3a9152ae1242f5d1113852aa97d13b382815b</id>
<content type='text'>
Adds sm4_ck constant for use in sm4 cryptography across different targets.

Signed-off-by: Max Chou &lt;max.chou@sifive.com&gt;
Reviewed-by: Frank Chang &lt;frank.chang@sifive.com&gt;
Signed-off-by: Max Chou &lt;max.chou@sifive.com&gt;
Message-ID: &lt;20230711165917.2629866-15-max.chou@sifive.com&gt;
Signed-off-by: Alistair Francis &lt;alistair.francis@wdc.com&gt;
</content>
</entry>
</feed>
