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

Update VerifyAttestation logic #209

Merged
merged 3 commits into from
Jun 28, 2022
Merged

Update VerifyAttestation logic #209

merged 3 commits into from
Jun 28, 2022

Conversation

jkl73
Copy link
Contributor

@jkl73 jkl73 commented Jun 17, 2022

Update VerifyAttestation to ignore pubkey if cert exists
Update hash validation on the signing hash algorithm in VerifyQuote

Signed-off-by: Jiankun Lu jiankun@google.com

@jkl73 jkl73 changed the title Update AttestionVerify to ignore pubkey if cert exists Update VerifyAttestation logic Jun 17, 2022
@jkl73 jkl73 marked this pull request as ready for review June 18, 2022 00:06
@jkl73 jkl73 requested review from josephlr, alexmwu and jessieqliu June 18, 2022 00:06
Copy link
Member

@josephlr josephlr left a comment

Choose a reason for hiding this comment

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

This is basically correct, I can clean this up a merge it.

server/verify.go Outdated Show resolved Hide resolved
client/example_test.go Outdated Show resolved Hide resolved
Copy link
Member

@josephlr josephlr left a comment

Choose a reason for hiding this comment

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

@jkl73 @alexmwu I made some changes to how we do the hash algorithm validation.

Basically, this change just rejects all SHA-1 signatures, rather than using the opts.AllowSHA1 option to make it configurable. We only really need to allow SHA-1 for the PCRs, but we shouldn't ever need to accept SHA-1 signatures. TPM2s will always have SHA256 support for signing keys, even if a firmware issue leaves us with only SHA-1 TCG eventlog events.

PTAL and let me know if it looks good to you. I split this up into two separate commits to make review easier.

@josephlr josephlr force-pushed the fixcertkey branch 2 times, most recently from 4098f9e to e430bd4 Compare June 27, 2022 20:35
server/verify_test.go Outdated Show resolved Hide resolved
internal/quote.go Outdated Show resolved Hide resolved
server/verify.go Outdated Show resolved Hide resolved
@josephlr josephlr force-pushed the fixcertkey branch 2 times, most recently from 3ba3bee to 72ad2e3 Compare June 28, 2022 01:08
@jkl73
Copy link
Contributor Author

jkl73 commented Jun 28, 2022

LGTM

We now only allow SHA-1 for PCRs and not for the signing algorithm.
This does two things:
  - Reduces the risk of SHA-1 collision attacks
  - Reduces the scope of the AllowSHA1 flag
  - Simplifies the signing validation logic

Signed-off-by: Joe Richey <joerichey@google.com>
josephlr added 2 commits June 27, 2022 18:15
Also splits out the cert/key verification stuff into its own functions.

Signed-off-by: Joe Richey <joerichey@google.com>
Signed-off-by: Joe Richey <joerichey@google.com>
@josephlr josephlr merged commit 8c899f5 into google:master Jun 28, 2022
@JoshuaKrstic JoshuaKrstic mentioned this pull request Aug 19, 2022
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.

4 participants