From: Lennart Poettering Date: Wed, 11 Feb 2026 12:10:05 +0000 (+0100) Subject: cryptsetup: extend HAVE_TPM2 conditioning to cover more X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a8f393c64f3716883cf57a7a28bf7dae03e06b3;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index d3e4ce3747f..dbd0b14d7bd 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -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)