tpm2-util: For NV index errors report EREMOTE to be able to continue
When we have many LUKS slots and not all are for our TPM, we can get an NV index error when it's missing or has wrong content. Instead of fully erroring out, map these encounters to EREMOTE like we do for a foreign TPM key.
This commit is contained in:
@@ -112,7 +112,7 @@ int acquire_luks2_key(
|
||||
srk,
|
||||
ret_decrypted_key);
|
||||
if (r == -EREMOTE)
|
||||
return log_error_errno(r, "TPM key integrity check failed. Key enrolled in superblock most likely does not belong to this TPM.");
|
||||
return log_error_errno(r, "TPM key integrity check failed or NV index unusable. Key enrolled in superblock most likely does not belong to this TPM.");
|
||||
if (r == -EILSEQ)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(ENOANO), "Bad PIN."); /* cryptsetup docs say we should return ENOANO on bad PIN */
|
||||
if (r == -ENOLCK)
|
||||
|
||||
Reference in New Issue
Block a user