summaryrefslogtreecommitdiffstats
path: root/src/shared/cryptsetup-fido2.h
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2024-11-25 23:31:01 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2024-11-26 14:04:24 +0100
commitc4d7a13c0665b9af2e8e0e671faa22fea95d83d3 (patch)
treea6caac44cc2560de9e22c0bccbac5177d788b245 /src/shared/cryptsetup-fido2.h
parentupdatectl: fix DBus method signature for SetFeatureEnabled (diff)
downloadsystemd-c4d7a13c0665b9af2e8e0e671faa22fea95d83d3.tar.xz
systemd-c4d7a13c0665b9af2e8e0e671faa22fea95d83d3.zip
cryptsetup: convert pkcs11/fido2 to iovec for key handling
key-data might be NULL. Fixes crash: 0 0x0000559c62120530 in attach_luks_or_plain_or_bitlk (cd=0x559c6b192830, name=0x7ffd57981dc4 "root", token_type=TOKEN_FIDO2, key_file=0x0, key_data=0x0, passwords=0x0, flags=524296, until=0) at ../src/cryptsetup/cryptsetup.c:2234 pass_volume_key = false r = 1469577760 __func__ = '\000' <repeats 29 times> 1 0x0000559c6212279c in run (argc=6, argv=0x7ffd5797fe98) at ../src/cryptsetup/cryptsetup.c:2597 discovered_key_data = {iov_base = 0x0, iov_len = 0} key_data = 0x0 token_type = TOKEN_FIDO2 destroy_key_file = 0x0 flags = 524296 until = 0 passphrase_type = PASSPHRASE_NONE volume = 0x7ffd57981dc4 "root" source = 0x7ffd57981dc9 "/dev/disk/by-uuid/8372fb39-9ba4-461a-a618-07dcaae66280" status = CRYPT_INACTIVE tries = 0 key_file = 0x0 config = 0x7ffd57981e05 "luks,discard,fido2-device=auto,x-initrd.attach" use_cached_passphrase = true try_discover_key = true discovered_key_fn = 0x7ffd5797fa70 "root.key" passwords = 0x0 cd = 0x559c6b192830 verb = 0x7ffd57981dbd "attach" r = 0 __func__ = "\000\000\000" 2 0x0000559c621231e6 in main (argc=6, argv=0x7ffd5797fe98) at ../src/cryptsetup/cryptsetup.c:2674 r = 32553 __func__ = "\000\000\000\000" Follow-up for 53b6c99018f918a5d2c9000ac5fe3a2440115ea7
Diffstat (limited to '')
-rw-r--r--src/shared/cryptsetup-fido2.h6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/shared/cryptsetup-fido2.h b/src/shared/cryptsetup-fido2.h
index bd25566806..86ac30c766 100644
--- a/src/shared/cryptsetup-fido2.h
+++ b/src/shared/cryptsetup-fido2.h
@@ -20,8 +20,7 @@ int acquire_fido2_key(
const char *key_file,
size_t key_file_size,
uint64_t key_file_offset,
- const void *key_data,
- size_t key_data_size,
+ const struct iovec *key_data,
usec_t until,
Fido2EnrollFlags required,
const char *askpw_credential,
@@ -52,8 +51,7 @@ static inline int acquire_fido2_key(
const char *key_file,
size_t key_file_size,
uint64_t key_file_offset,
- const void *key_data,
- size_t key_data_size,
+ const struct iovec *key_data,
usec_t until,
Fido2EnrollFlags required,
const char *askpw_credential,