_cleanup_(table_unrefp) Table *table = NULL;
int r;
- bool have_tpm2 = tpm2_is_fully_supported();
+ bool have_tpm2 = tpm2_is_mostly_supported();
if (!have_tpm2)
log_notice("System lacks full TPM2 support, not showing NvPCR state.");
const char *alg = NULL;
int r;
- if (!tpm2_is_fully_supported())
- log_notice("System lacks full TPM2 support, not showing PCR state.");
+ if (!tpm2_is_mostly_supported())
+ log_notice("System lacks sufficient TPM2 support, not showing PCR state.");
else {
r = get_pcr_alg(&alg);
if (r < 0)
if (arg_event_type >= 0)
event = arg_event_type;
- if (arg_graceful && !tpm2_is_fully_supported()) {
+ if (arg_graceful && !tpm2_is_mostly_supported()) {
log_notice("No complete TPM2 support detected, exiting gracefully.");
return EXIT_SUCCESS;
}
* container tpm2_support will detect this, and will return a different flag combination of
* TPM2_SUPPORT_FULL, effectively skipping the use of TPM2 when inside one. */
- try_tpm2 = tpm2_is_fully_supported();
+ try_tpm2 = tpm2_is_mostly_supported();
if (!try_tpm2)
log_debug("System lacks TPM2 support or running in a container, not attempting to use TPM2.");
} else
/* Combined flags for generic (i.e. not tool-specific) support */
TPM2_SUPPORT_FULL = TPM2_SUPPORT_API|TPM2_SUPPORT_LIBTSS2_ALL,
+ TPM2_SUPPORT_SOFTWARE = TPM2_SUPPORT_FULL & ~TPM2_SUPPORT_FIRMWARE, /* Same, just without PC firmware support */
} Tpm2Support;
Tpm2Support tpm2_support_full(Tpm2Support mask);
static inline bool tpm2_is_fully_supported(void) {
return tpm2_support() == TPM2_SUPPORT_FULL;
}
+static inline bool tpm2_is_mostly_supported(void) {
+ return (tpm2_support() & TPM2_SUPPORT_SOFTWARE) == TPM2_SUPPORT_SOFTWARE;
+}
int verb_has_tpm2_generic(bool quiet);
if (r <= 0)
return r;
- if (arg_graceful && !tpm2_is_fully_supported()) {
+ if (arg_graceful && !tpm2_is_mostly_supported()) {
log_notice("No complete TPM2 support detected, exiting gracefully.");
return EXIT_SUCCESS;
}