summaryrefslogtreecommitdiffstats
path: root/src/cryptenroll/cryptenroll-recovery.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-08-27 16:31:39 +0200
committerLennart Poettering <lennart@poettering.net>2024-08-30 14:15:33 +0200
commit549c1a99d469d9d1ec42ddfccba26724dea0d28a (patch)
tree209c0592b49aa5b320af1331d1761749640f8d1e /src/cryptenroll/cryptenroll-recovery.c
parentmkosi: update debian commit reference (diff)
downloadsystemd-549c1a99d469d9d1ec42ddfccba26724dea0d28a.tar.xz
systemd-549c1a99d469d9d1ec42ddfccba26724dea0d28a.zip
cryptenroll: iovec'ify a few more things
Diffstat (limited to 'src/cryptenroll/cryptenroll-recovery.c')
-rw-r--r--src/cryptenroll/cryptenroll-recovery.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/cryptenroll/cryptenroll-recovery.c b/src/cryptenroll/cryptenroll-recovery.c
index 0b1e380e06..0a5e9cdcbe 100644
--- a/src/cryptenroll/cryptenroll-recovery.c
+++ b/src/cryptenroll/cryptenroll-recovery.c
@@ -3,6 +3,7 @@
#include "ansi-color.h"
#include "cryptenroll-recovery.h"
#include "glyph-util.h"
+#include "iovec-util.h"
#include "json-util.h"
#include "memory-util.h"
#include "qrcode-util.h"
@@ -11,8 +12,7 @@
int enroll_recovery(
struct crypt_device *cd,
- const void *volume_key,
- size_t volume_key_size) {
+ const struct iovec *volume_key) {
_cleanup_(sd_json_variant_unrefp) sd_json_variant *v = NULL;
_cleanup_(erase_and_freep) char *password = NULL;
@@ -21,8 +21,7 @@ int enroll_recovery(
const char *node;
assert_se(cd);
- assert_se(volume_key);
- assert_se(volume_key_size > 0);
+ assert_se(iovec_is_set(volume_key));
assert_se(node = crypt_get_device_name(cd));
@@ -37,8 +36,8 @@ int enroll_recovery(
keyslot = crypt_keyslot_add_by_volume_key(
cd,
CRYPT_ANY_SLOT,
- volume_key,
- volume_key_size,
+ volume_key->iov_base,
+ volume_key->iov_len,
password,
strlen(password));
if (keyslot < 0)