]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: extend HAVE_TPM2 conditioning to cover more
authorLennart Poettering <lennart@amutable.com>
Wed, 11 Feb 2026 12:10:05 +0000 (13:10 +0100)
committerLennart Poettering <lennart@amutable.com>
Tue, 17 Feb 2026 21:00:13 +0000 (22:00 +0100)
If TPM2 support is off, any check for TPM2 support will fail, hence we
can just suppress it.

src/cryptsetup/cryptsetup.c

index d3e4ce3747faa64f69a5fdaa90af35bc07b58832..dbd0b14d7bd1b2066029bd191800169d88b43b88 100644 (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)