cryptenroll,cryptsetup: clean up unlock credential for TPM2 + FIDO2

Let's make sure that when cryptenroll asks for the TPM2 or FIDO2 token
PIN it uses cryptenroll.* credential namespace, and cryptsetup uses
cryptsetup.*.
This commit is contained in:
Lennart Poettering
2024-02-20 16:50:00 +01:00
parent a96c284f10
commit b3a635841a
7 changed files with 56 additions and 32 deletions
+3 -2
View File
@@ -34,9 +34,10 @@ int load_volume_key_fido2(
device,
/* until= */ 0,
/* headless= */ false,
"cryptenroll.fido2-pin",
ASK_PASSWORD_PUSH_CACHE|ASK_PASSWORD_ACCEPT_CACHED,
&decrypted_key,
&decrypted_key_size,
ASK_PASSWORD_PUSH_CACHE|ASK_PASSWORD_ACCEPT_CACHED);
&decrypted_key_size);
if (r == -EAGAIN)
return log_error_errno(r, "FIDO2 token does not exist, or UV is blocked. Please try again.");
if (r < 0)
+2 -1
View File
@@ -211,7 +211,8 @@ int load_volume_key_tpm2(
tpm2_flags,
/* until= */ 0,
/* headless= */ false,
/* ask_password_flags= */ 0,
"cryptenroll.tpm2-pin",
/* askpw_flags= */ 0,
&decrypted_key);
if (IN_SET(r, -EACCES, -ENOLCK))
return log_notice_errno(SYNTHETIC_ERRNO(EAGAIN), "TPM2 PIN unlock failed");