aboutsummaryrefslogtreecommitdiff
path: root/crypto/block-luks.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2017-04-21 20:27:02 +0800
committerMarkus Armbruster <armbru@redhat.com>2017-04-24 09:13:22 +0200
commit375092332eeaa6e47561ce47fd36144cdaf964d0 (patch)
tree88ad159539d14fcd35c6223cbd602698ba684037 /crypto/block-luks.c
parent9217283dc8ce48688ea0556763574c0333faf79c (diff)
crypto: Make errp the last parameter of functions
Move opaque to 2nd instead of the 2nd to last, so that compilers help check with the conversion. Signed-off-by: Fam Zheng <famz@redhat.com> Message-Id: <20170421122710.15373-7-famz@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> [Commit message typo corrected] Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'crypto/block-luks.c')
-rw-r--r--crypto/block-luks.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/crypto/block-luks.c b/crypto/block-luks.c
index 4530f8241c..d5a31bbaeb 100644
--- a/crypto/block-luks.c
+++ b/crypto/block-luks.c
@@ -473,10 +473,10 @@ qcrypto_block_luks_load_key(QCryptoBlock *block,
* then encrypted.
*/
rv = readfunc(block,
+ opaque,
slot->key_offset * QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
splitkey, splitkeylen,
- errp,
- opaque);
+ errp);
if (rv < 0) {
goto cleanup;
}
@@ -676,11 +676,10 @@ qcrypto_block_luks_open(QCryptoBlock *block,
/* Read the entire LUKS header, minus the key material from
* the underlying device */
- rv = readfunc(block, 0,
+ rv = readfunc(block, opaque, 0,
(uint8_t *)&luks->header,
sizeof(luks->header),
- errp,
- opaque);
+ errp);
if (rv < 0) {
ret = rv;
goto fail;
@@ -1246,7 +1245,7 @@ qcrypto_block_luks_create(QCryptoBlock *block,
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE;
/* Reserve header space to match payload offset */
- initfunc(block, block->payload_offset, &local_err, opaque);
+ initfunc(block, opaque, block->payload_offset, &local_err);
if (local_err) {
error_propagate(errp, local_err);
goto error;
@@ -1268,11 +1267,10 @@ qcrypto_block_luks_create(QCryptoBlock *block,
/* Write out the partition header and key slot headers */
- writefunc(block, 0,
+ writefunc(block, opaque, 0,
(const uint8_t *)&luks->header,
sizeof(luks->header),
- &local_err,
- opaque);
+ &local_err);
/* Delay checking local_err until we've byte-swapped */
@@ -1297,12 +1295,11 @@ qcrypto_block_luks_create(QCryptoBlock *block,
/* Write out the master key material, starting at the
* sector immediately following the partition header. */
- if (writefunc(block,
+ if (writefunc(block, opaque,
luks->header.key_slots[0].key_offset *
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE,
splitkey, splitkeylen,
- errp,
- opaque) != splitkeylen) {
+ errp) != splitkeylen) {
goto error;
}