This is useful to enumerate all hash algorithms we want to predict
measurements for.
}
#endif
+const uint16_t tpm2_hash_algorithms[] = {
+ TPM2_ALG_SHA1,
+ TPM2_ALG_SHA256,
+ TPM2_ALG_SHA384,
+ TPM2_ALG_SHA512,
+ 0,
+};
+
+assert_cc(ELEMENTSOF(tpm2_hash_algorithms) == TPM2_N_HASH_ALGORITHMS + 1);
+
char *tpm2_pcr_mask_to_string(uint32_t mask) {
_cleanup_free_ char *s = NULL;
#define FOREACH_PCR_IN_MASK(pcr, mask) BIT_FOREACH(pcr, mask)
+#define TPM2_N_HASH_ALGORITHMS 4U
+
#if HAVE_TPM2
#include <tss2/tss2_esys.h>
char *tpm2_pcr_mask_to_string(uint32_t mask);
+extern const uint16_t tpm2_hash_algorithms[];
+
typedef struct {
uint32_t search_pcr_mask;
const char *device;