cryptsetup: extend HAVE_TPM2 conditioning to cover more

If TPM2 support is off, any check for TPM2 support will fail, hence we
can just suppress it.
This commit is contained in:
Lennart Poettering
2026-02-17 22:00:13 +01:00
parent be36f69c90
commit 0a8f393c64
+3 -2
View File
@@ -1097,8 +1097,9 @@ static int measure_keyslot(
const char *mechanism,
int keyslot) {
#if HAVE_TPM2
int r;
#endif
assert(cd);
assert(name);
@@ -1107,6 +1108,7 @@ static int measure_keyslot(
return 0;
}
#if HAVE_TPM2
r = efi_measured_uki(LOG_WARNING);
if (r < 0)
return r;
@@ -1115,7 +1117,6 @@ static int measure_keyslot(
return 0;
}
#if HAVE_TPM2
_cleanup_(tpm2_context_unrefp) Tpm2Context *c = NULL;
r = tpm2_context_new_or_warn(arg_tpm2_device, &c);
if (r < 0)