Skip to content

efi/preinstall,tpm2: Don't fail due to lack of TPM_CAP_AUTH_POLICIES#534

Merged
chrisccoulson merged 1 commit intocanonical:masterfrom
chrisccoulson:preinstall-fix-issue-408
Apr 9, 2026
Merged

efi/preinstall,tpm2: Don't fail due to lack of TPM_CAP_AUTH_POLICIES#534
chrisccoulson merged 1 commit intocanonical:masterfrom
chrisccoulson:preinstall-fix-issue-408

Conversation

@chrisccoulson
Copy link
Copy Markdown
Contributor

TPMs based on versions of the refeference library older than v1.38 may
not implement TPM_CAP_AUTH_POLICICES. The preinstall checks currently
rely on this in order to determine whether TPM hierarchies have an
authorization policy set.

The existence of an authorization policy isn't relevant if the
hierarcy's authorization value isn't set, as the empty authorization
value can be used to clear the policy. In the case where the
authorization value is unset, there's no point in checking for the
existence of a policy.

Only check for the existence of an authorization policy for the lockout
hierarchy if it has an authorization value. In this case, the presence
of a policy is presented in the error message as additional information.
We take ownerhip of the lockout hierarchy in
tpm2.Connection.EnsureProvisioned, and for now, this function will clear
any policy before the authorization value is set. A subsequent PR will
set a more appropriate policy based on the requirement to be able to
rotate the authorization value safely during reprovisioning.

Fixes: #408

TPMs based on versions of the refeference library older than v1.38 may
not implement TPM_CAP_AUTH_POLICICES. The preinstall checks currently
rely on this in order to determine whether TPM hierarchies have an
authorization policy set.

The existence of an authorization policy isn't relevant if the
hierarcy's authorization value isn't set, as the empty authorization
value can be used to clear the policy. In the case where the
authorization value is unset, there's no point in checking for the
existence of a policy.

Only check for the existence of an authorization policy for the lockout
hierarchy if it has an authorization value. In this case, the presence
of a policy is presented in the error message as additional information.
We take ownerhip of the lockout hierarchy in
tpm2.Connection.EnsureProvisioned, and for now, this function will clear
any policy before the authorization value is set. A subsequent PR will
set a more appropriate policy based on the requirement to be able to
rotate the authorization value safely during reprovisioning.

Fixes: canonical#408
Comment thread efi/preinstall/check_tpm.go
Comment thread efi/preinstall/check_tpm.go
@chrisccoulson chrisccoulson merged commit 2b0a173 into canonical:master Apr 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

efi/preinstall: TPM_CAP_AUTH_POLICIES is not supported on TPMs that implement < v1.38 of the TCG reference spec

2 participants