diff options
author | Maxim Levitsky <mlevitsk@redhat.com> | 2020-06-25 14:55:36 +0200 |
---|---|---|
committer | Max Reitz <mreitz@redhat.com> | 2020-07-06 08:49:28 +0200 |
commit | 43cbd06df2dcdfe236e68351bb3c350e0d1d857a (patch) | |
tree | 64c4ab0ba1a95b19aca9f952f1e29fcd02da0cb5 /include/crypto | |
parent | d2a839ede850bbb23493ac03b1c2477026fe6bc7 (diff) | |
download | qemu-43cbd06df2dcdfe236e68351bb3c350e0d1d857a.zip qemu-43cbd06df2dcdfe236e68351bb3c350e0d1d857a.tar.gz qemu-43cbd06df2dcdfe236e68351bb3c350e0d1d857a.tar.bz2 |
qcrypto/core: add generic infrastructure for crypto options amendment
This will be used first to implement luks keyslot management.
block_crypto_amend_opts_init will be used to convert
qemu-img cmdline to QCryptoBlockAmendOptions
Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20200608094030.670121-2-mlevitsk@redhat.com>
Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'include/crypto')
-rw-r--r-- | include/crypto/block.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/crypto/block.h b/include/crypto/block.h index c77ccaf..d274819 100644 --- a/include/crypto/block.h +++ b/include/crypto/block.h @@ -144,6 +144,28 @@ QCryptoBlock *qcrypto_block_create(QCryptoBlockCreateOptions *options, void *opaque, Error **errp); +/** + * qcrypto_block_amend_options: + * @block: the block encryption object + * + * @readfunc: callback for reading data from the volume header + * @writefunc: callback for writing data to the volume header + * @opaque: data to pass to @readfunc and @writefunc + * @options: the new/amended encryption options + * @force: hint for the driver to allow unsafe operation + * @errp: error pointer + * + * Changes the crypto options of the encryption format + * + */ +int qcrypto_block_amend_options(QCryptoBlock *block, + QCryptoBlockReadFunc readfunc, + QCryptoBlockWriteFunc writefunc, + void *opaque, + QCryptoBlockAmendOptions *options, + bool force, + Error **errp); + /** * qcrypto_block_calculate_payload_offset: |