Skip to content

[v15] Add tpm package with Attestation/Validation functionality (#40351)#40495

Merged
strideynet merged 1 commit intobranch/v15from
strideynet/v15/backport-40351
Apr 11, 2024
Merged

[v15] Add tpm package with Attestation/Validation functionality (#40351)#40495
strideynet merged 1 commit intobranch/v15from
strideynet/v15/backport-40351

Conversation

@strideynet
Copy link
Copy Markdown
Contributor

Backports #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:02
@strideynet strideynet enabled auto-merge April 11, 2024 18:12
@strideynet strideynet added this pull request to the merge queue Apr 11, 2024
Merged via the queue into branch/v15 with commit 985f955 Apr 11, 2024
@strideynet strideynet deleted the strideynet/v15/backport-40351 branch April 11, 2024 18:39
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