Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tpm2: Create TPM2 keys with noDA attribute if no user auth is required #352

Merged

Conversation

chrisccoulson
Copy link
Collaborator

@chrisccoulson chrisccoulson commented Dec 2, 2024

By default, all TPM2 keys are protected by the TPM's dictionary attack
protection logic. Given that the user auth mode is immutable, we should
take advantage of this to create keys that require no user auth with the
noDA attribute, so that they aren't protected by the TPM's dictionary
attack protection logic. This means that these keys will still be
recoverable, even if the TPM is in lockout mode.

By default, all TPM2 keys are protected by the TPM's dictionary attack
protection logic. Given that the user auth mode is immutable, we should
take advantage of this to create keys that require no user auth with the
noDA attribute, so that they aren't protected by the TPM's dictionary
attack protection logic. This means that these keys will still be
recoverable, even if the TPM is in lockout mode.
@chrisccoulson chrisccoulson force-pushed the tpm2-no-da-for-no-auth-keys branch from 14fc136 to b5882cd Compare December 2, 2024 14:31
@chrisccoulson chrisccoulson changed the title [WIP] tpm2: Create TPM2 keys with noDA attribute if no user auth is required Dec 2, 2024
@chrisccoulson
Copy link
Collaborator Author

I can't request a review from you @tonyespy, but I thought you might be interested in this one :)

@chrisccoulson chrisccoulson marked this pull request as ready for review December 2, 2024 14:55
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, small comment

@@ -160,7 +160,7 @@ func makeSealedKeyData(tpm *tpm2.TPMContext, params *makeSealedKeyDataParams, se
}

// Seal the symmetric key and nonce.
priv, pub, importSymSeed, err := sealer.CreateSealedObject(symKey[:], nameAlg, authPolicyDigest)
priv, pub, importSymSeed, err := sealer.CreateSealedObject(symKey[:], nameAlg, authPolicyDigest, !requireAuthValue)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably worth having a comment here explaining !RequireAuthValue policy/logic

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added a comment here now.

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@chrisccoulson chrisccoulson merged commit 082c84b into canonical:master Dec 6, 2024
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.

2 participants