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

attest: Add AK signing interface #338

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

smo4201
Copy link
Contributor

@smo4201 smo4201 commented Jun 23, 2023

Restricted TPM keys, such as AKs, are usually used to sign objects generated within the TPM, such as quotes. However, they can also be used for signing data that was not generated within the TPM, if the data does not start with TPM_GENERATED_VALUE. This requires hashing the data to-be-signed by the TPM and retrieving a validation ticket together with the digest from the TPM.

It can be useful, e.g., to generate a self-signed Certificate Signing Request for the AK and then retrieve AK certificates from CAs (which are able to perform credential activation) via standard protocols such as Enrollment over Secure Transport (EST). EST mandates that the CSR is self-signed with the corresponding private key (RFC 7030, Section 4.2.1), so this is imho the only possibility to be EST compliant.

This pull request therefore adds a sign() method to the AK interface for signing arbitrary objects. Furthermore, it adds a hash() method to the TPM interface, as the data to-be-signed by a restricted key must be hashed within the TPM to retrieve a TPM validation ticket. The existing internal sign() method of the wrappedKey20 implementation was extended with a validation ticket parameter to be able to prove that the data was hashed within the TPM.

Note: currently, I only implemented this additional functionality for the Linux TPM2.0. The TPM1.2 and Windows TPM throw a "not implemented" error if the new methods are called.

Restricted AKs can be used for signing data that was not generated
by the TPM, if the data does not start with TPM_GENERATED_VALUE.
This requires hashing the data to-be-signed by the TPM. This
can be useful to generate a CSR for the AK and then retrieve
AK certificates from CAs that are able to perform credential
activation via standard protocols such as EST.
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.

1 participant