Skip to content

[v14] Add tpm package with Attestation/Validation functionality (#40351)#40496

Merged
strideynet merged 2 commits intobranch/v14from
strideynet/v14/backport-40351
Apr 11, 2024
Merged

[v14] Add tpm package with Attestation/Validation functionality (#40351)#40496
strideynet merged 2 commits intobranch/v14from
strideynet/v14/backport-40351

Conversation

@strideynet
Copy link
Copy Markdown
Contributor

Backport #40351

* Add structure of `tpm` package

* Add proto conversion methods

* Add tests for proto conversions

* Add startup stuff for tpm sim based tests

* try and fail to write a fake ekcert to the tpm

* Working ability to write to a TPM ekcert index

* Tidy up

* Add finishing touches to test and add godocs

* Go mod tidy

* Appease linter

* Remove incorrectly copied comment

* Tidy up line wrapping

* Add license header

* Update lib/tpm/tpm.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/tpm_simulator_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/validate.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/tpm.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/tpm_simulator_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/tpm_simulator_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Update lib/tpm/tpm_simulator_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Avoid managing closure in the attestWithTPM func

* Use ekCertSerialHex const

* Simpler JoinAuditAttributes method

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add missing err return

* Add remark on the nvram rsa ekcert index

* Update lib/tpm/tpm_simulator_test.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Add subtests

* Clarify in hex

* Switch to testing exported iface

* Use x509.CertPool and switch to testing public APi

* Remove overly cautious check

* Validate Validate params

* Reuse strings builder when handling an odd number of hex digits

* Switch to gocmp and struct for ekcert

* Use return struct for Attest

* Avoid marshalling PKIX key twice

* Update lib/tpm/validate.go

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

---------

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
@strideynet strideynet added the no-changelog Indicates that a PR does not require a changelog entry label Apr 11, 2024
@github-actions github-actions Bot requested review from avatus and codingllama April 11, 2024 18:05
@strideynet strideynet enabled auto-merge April 11, 2024 18:15
@strideynet strideynet added this pull request to the merge queue Apr 11, 2024
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 11, 2024
@strideynet strideynet added this pull request to the merge queue Apr 11, 2024
Merged via the queue into branch/v14 with commit 359bb92 Apr 11, 2024
@strideynet strideynet deleted the strideynet/v14/backport-40351 branch April 11, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport no-changelog Indicates that a PR does not require a changelog entry size/lg

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants