From e9ba92f7f0d51ccd140b6557af61b459e587c341 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Sun, 4 Oct 2026 08:24:02 +0200 Subject: [PATCH] tpm2-util: `TPM2_PCR_MASK_VALID()` should take 64-bit parameter ... as some of the fields like `pcr_mask` field of `struct tpm2_credential_header` that are passed to this function are 64-bit. (cherry picked from commit de827820240d56a142aea7a2b012121a8869282d) --- src/shared/tpm2-util.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 1d0ed81138..2244a87823 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -40,7 +40,9 @@ typedef enum TPM2Flags { static inline bool TPM2_PCR_INDEX_VALID(unsigned pcr) { return pcr < TPM2_PCRS_MAX; } -static inline bool TPM2_PCR_MASK_VALID(uint32_t pcr_mask) { + +/* Some fields like `pcr_mask` field of `struct tpm2_credential_header` are 64-bit. */ +static inline bool TPM2_PCR_MASK_VALID(uint64_t pcr_mask) { return pcr_mask <= TPM2_PCRS_MASK; }