tpm2: Add initial Connection.ResetDictionaryAttackLock APIs#512
Open
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
Open
tpm2: Add initial Connection.ResetDictionaryAttackLock APIs#512chrisccoulson wants to merge 1 commit intocanonical:masterfrom
chrisccoulson wants to merge 1 commit intocanonical:masterfrom
Conversation
This adds initial APIs for resetting the TPM's dictionary attack counter to replace the direct use of go-tpm2's TPMContext.DictionaryAttackLockReset API. This doesn't yet include the changes to Connection.EnsureProvisioned which will create the authorization data that will be persisted by snapd and passed to this new API - this is coming in a follow-up PR. This is split into 2 APIs: - Connection.ResetDictionaryAttackLock which will be supplied with data that will be provided by an updated EnsureProvisioned API. - Connection.ResetDictionaryAttackLockWithAuthValue which will be supplied with a plain authorization value, previously chosen by snapd and provided to the current EnsureProvisioned API. I did think about having this as 1 API, and handling the case where decoding of the authorization data fails and treating it as an authorization value if the length is 32 bytes. But as this value is chosen by snapd and nothing in secboot enforces a size of 32 bytes, I thought it was safer to have this as 2 APIs so that snapd can be explicit about the format of the supplied data. Fixes: FR-10809
8b57362 to
b03116f
Compare
pedronis
reviewed
Mar 4, 2026
|
|
||
| _, err := params.AuthPolicy.Execute( | ||
| policyutil.NewPolicyExecuteSession(t.TPMContext, session), | ||
| policyutil.WithSessionUsageCommandConstraint(tpm2.CommandDictionaryAttackLockReset, []policyutil.NamedHandle{t.LockoutHandleContext()}), |
Collaborator
There was a problem hiding this comment.
can you comment on this bit of setup?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds initial APIs for resetting the TPM's dictionary attack counter
to replace the direct use of go-tpm2's
TPMContext.DictionaryAttackLockResetAPI.This doesn't yet include the changes to
Connection.EnsureProvisionedwhich will create the authorization data that will be persisted by
snapd and passed to this new API - this is coming in a follow-up PR.
This is split into 2 APIs:
Connection.ResetDictionaryAttackLockwhich will be supplied with datathat will be provided by an updated
EnsureProvisionedAPI.Connection.ResetDictionaryAttackLockWithAuthValuewhich will besupplied with a plain authorization value, previously chosen by snapd
and provided to the current
EnsureProvisionedAPI.I did think about having this as 1 API, and handling the case where
decoding of the authorization data fails and treating it as an
authorization value if the length is 32 bytes. But as this value is
chosen by snapd and nothing in secboot enforces a size of 32 bytes, I
thought it was safer to have this as 2 APIs so that snapd can be
explicit about the format of the supplied data.
Fixes: FR-10809