creds-util: fix validation check for TPM2 PCR mask

... field on big-endian architectures.
This commit is contained in:
Siteshwar Vashisht authored and Yu Watanabe committed 2026-10-04 18:15:40 +09:00
1 parent d5b4357f8f
commit 542c3cd97a
1 file changed
+1 -1
+1 -1
View File
@@ -1445,7 +1445,7 @@ int decrypt_credential_and_warn(
struct tpm2_public_key_credential_header *z_pubkey = NULL;
struct tpm2_pinned_srk_credential_header *z_srk = NULL;
if (!TPM2_PCR_MASK_VALID(t->pcr_mask))
if (!TPM2_PCR_MASK_VALID(le64toh(t->pcr_mask)))
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "TPM2 PCR mask out of range.");
if (!tpm2_hash_alg_to_string(le16toh(t->pcr_bank)))
return log_error_errno(SYNTHETIC_ERRNO(EBADMSG), "TPM2 PCR bank invalid or not supported");