Skip to content

Commit

Permalink
qubes-hcl-report: fix TPM family detection
Browse files Browse the repository at this point in the history
For quite some time, "/sys/class/tpm/tpm0/tpm_version_major" is present
also for TPM 1.2. To properly test for family, the content of this file
must be read. It is "1" for TPM 1.2 and "2" for TPM 2.0.

Signed-off-by: Krystian Hebel <[email protected]>
  • Loading branch information
krystian-hebel committed Apr 24, 2024
1 parent ec10371 commit 92a007e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qvm-tools/qubes-hcl-report
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ else
HAP_VERBOSE="No"
fi

if [[ -f "/sys/class/tpm/tpm0/tpm_version_major" ]]
if [[ -f "/sys/class/tpm/tpm0/tpm_version_major" && $(< "/sys/class/tpm/tpm0/tpm_version_major") == "2" ]]
then
TPM="Device present (TPM 2.0)"
TPM_s="2.0"
Expand Down

0 comments on commit 92a007e

Please sign in to comment.