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

Invalid PCR selection during key.Attest() #257

Closed
daniel-weisse opened this issue Oct 28, 2022 · 0 comments · Fixed by #258
Closed

Invalid PCR selection during key.Attest() #257

daniel-weisse opened this issue Oct 28, 2022 · 0 comments · Fixed by #258

Comments

@daniel-weisse
Copy link
Contributor

Assuming we are running on a system with a TPM that does not support the full range of PCR Selections:

$ sudo tpm2_getcap pcrs
selected-pcrs:
  - sha1: [ ]
  - sha256: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]
  - sha384: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]
  - sha512: [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23 ]

Then calling key.Attest(AttestOpts{Nonce:nonce}) fails with the following error:

failed to verify quote: given PCRs and Quote do not have the same PCR selection

The error is fixed by adjusting implementedPCRs() to only add a PCRSelection to the implemented PCRs list if a given PCRSelection is not an empty list.

I can open a PR to fix this.

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 a pull request may close this issue.

1 participant