summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Cai <peter@typeblog.net>2022-12-18 02:28:51 +0100
committerPeter Cai <peter@typeblog.net>2022-12-22 17:20:56 +0100
commit52105bb4870e9b0728a185275fe001d69ff6b92c (patch)
tree82aed55a0dba80f1a2e9139a59cf54deceddd5dd
parentcryptsetup-fido2: Relocate to libsystemd-shared (diff)
downloadsystemd-52105bb4870e9b0728a185275fe001d69ff6b92c.tar.xz
systemd-52105bb4870e9b0728a185275fe001d69ff6b92c.zip
cryptsetup-fido2: Remove plain mode parameters from `acquire_fido2_key_auto()`
`acquire_fido2_key_auto()` will not be used in PLAIN mode, and parameters such as the salt will be acquired from the LUKS header. Parameters intended for PLAIN mode are useless in `acquire_fido2_key_auto()`.
-rw-r--r--src/cryptsetup/cryptsetup.c1
-rw-r--r--src/shared/cryptsetup-fido2.c7
-rw-r--r--src/shared/cryptsetup-fido2.h6
3 files changed, 3 insertions, 11 deletions
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 389bf4fdcf..a79a08e566 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -1121,7 +1121,6 @@ static int attach_luks_or_plain_or_bitlk_by_fido2(
name,
friendly,
arg_fido2_device,
- key_file, arg_keyfile_size, arg_keyfile_offset,
until,
arg_headless,
&decrypted_key, &decrypted_key_size,
diff --git a/src/shared/cryptsetup-fido2.c b/src/shared/cryptsetup-fido2.c
index a3bdedba1d..285b82a7e2 100644
--- a/src/shared/cryptsetup-fido2.c
+++ b/src/shared/cryptsetup-fido2.c
@@ -132,9 +132,6 @@ int acquire_fido2_key_auto(
const char *name,
const char *friendly_name,
const char *fido2_device,
- const char *key_file,
- size_t key_file_size,
- uint64_t key_file_offset,
usec_t until,
bool headless,
void **ret_decrypted_key,
@@ -252,7 +249,9 @@ int acquire_fido2_key_auto(
fido2_device,
rp,
cid, cid_size,
- key_file, key_file_size, key_file_offset,
+ /* key_file= */ NULL, /* salt is read from LUKS header instead of key_file */
+ /* key_file_size= */ 0,
+ /* key_file_offset= */ 0,
salt, salt_size,
until,
headless,
diff --git a/src/shared/cryptsetup-fido2.h b/src/shared/cryptsetup-fido2.h
index 371bf21f0e..d96bb403ff 100644
--- a/src/shared/cryptsetup-fido2.h
+++ b/src/shared/cryptsetup-fido2.h
@@ -34,9 +34,6 @@ int acquire_fido2_key_auto(
const char *name,
const char *friendly_name,
const char *fido2_device,
- const char *key_file,
- size_t key_file_size,
- uint64_t key_file_offset,
usec_t until,
bool headless,
void **ret_decrypted_key,
@@ -73,9 +70,6 @@ static inline int acquire_fido2_key_auto(
const char *name,
const char *friendly_name,
const char *fido2_device,
- const char *key_file,
- size_t key_file_size,
- uint64_t key_file_offset,
usec_t until,
bool headless,
void **ret_decrypted_key,