google / go-tpm

Apache License 2.0
561 stars 161 forks source link

Replay google/master work since the start of tpmdirect #330

Closed chrisfenner closed 1 year ago

chrisfenner commented 1 year ago

This PR cherry-picks 4 of the 5 commits that master had since the start of tpmdirect atop main (which has just been created based on tpmdirect).

Big picture: we will release this* as "major prerelease" 0.9.0 of go-tpm, to share the new tpmdirect API with external users.

*minor change, Startup_ will be renamed to Startup, a change that has to be coordinated with go-tpm-tools migrating to use the legacy API via its new path

16613e24ca4db99617ac5409b3b8ad603438c00d is not included because we had already updated to an even more recent version of golang.org/x/sys (0.5.0)

This PR also includes a minor lint-fixing commit based on issues identified by checks on this PR.

This mainly replays some work that happened in tpm2/credactivation into legacy/tpm2/credactivation.

The only interesting conflicts occurred in e7821111f45313b63d406ae7587ec61df2ce626e. I've undone changes to credactivation 0b55c34ffe2754e7e7f16178b67d0bcd95dc0631 in favor of taking the code exactly as-is after @brandonweeks changes. I don't recall why I touched this file as part of introducing tpmdirect; I suspect it was to make a build or linter happy.