summaryrefslogtreecommitdiffstats
path: root/src/cryptenroll/cryptenroll-pkcs11.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-02-19 18:45:49 +0100
committerLennart Poettering <lennart@poettering.net>2024-02-20 16:50:04 +0100
commitb2ac9280889ce5915e9b8437ee2aff134142ace9 (patch)
treef24f06dfaefbb8537de9313c5954506261e74b84 /src/cryptenroll/cryptenroll-pkcs11.c
parentman: tweak cryptsetup credentials docs a bit (diff)
downloadsystemd-b2ac9280889ce5915e9b8437ee2aff134142ace9.tar.xz
systemd-b2ac9280889ce5915e9b8437ee2aff134142ace9.zip
cryptsetup: drop "headless" bool, make it a flag in AskPasswordFlags instead
This bool controls whether we should interactively ask for a password, which is pretty much what the ask_password-api.c APIs are about. Hence, just make the bool a flag in AskPasswordFlags enum, and use it everywhere. This still catches the flag early in upper levels of the codebase, exactly as before, but if the flag is still present in the lower layers it's also handled there and results in ENOEXEC if seen. This is mostly an excercise in simplifying our ridiculously long function call parameter lists a bit.
Diffstat (limited to 'src/cryptenroll/cryptenroll-pkcs11.c')
-rw-r--r--src/cryptenroll/cryptenroll-pkcs11.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/cryptenroll/cryptenroll-pkcs11.c b/src/cryptenroll/cryptenroll-pkcs11.c
index 9cdb840763..09875c1598 100644
--- a/src/cryptenroll/cryptenroll-pkcs11.c
+++ b/src/cryptenroll/cryptenroll-pkcs11.c
@@ -55,7 +55,14 @@ int enroll_pkcs11(
assert_se(node = crypt_get_device_name(cd));
- r = pkcs11_acquire_public_key(uri, "volume enrollment operation", "drive-harddisk", "cryptenroll.pkcs11-pin", &pkey, NULL);
+ r = pkcs11_acquire_public_key(
+ uri,
+ "volume enrollment operation",
+ "drive-harddisk",
+ "cryptenroll.pkcs11-pin",
+ /* askpw_flags= */ 0,
+ &pkey,
+ /* ret_pin_used= */ NULL);
if (r < 0)
return r;