Skip to content

Commit be496f1

Browse files
brandonweekscopybara-github
authored andcommitted
Internal change
PiperOrigin-RevId: 394330027
1 parent a35bd36 commit be496f1

File tree

16 files changed

+40
-120
lines changed

16 files changed

+40
-120
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 66 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,11 @@ API changes at any time.
2020

2121
Please note that this is not an official Google product.
2222

23-
TPM 1.2 support is best effort, meaning we will accept fixes for TPM 1.2, but
24-
testing is not covered by CI.
25-
2623
## Installation
2724

2825
The go-attestation package is installable using go get: `go get github.com/google/go-attestation/attest`
2926

30-
### TPM1.2
31-
By default, go-attestation does not build in TPM1.2 support on Linux.
32-
Linux users must install [`libtspi`](http://trousers.sourceforge.net/) and its headers if they need TPM 1.2 support. This can be installed on debian-based systems using: `sudo apt-get install libtspi-dev`.
33-
Then, build go-attestation with the `tspi` [build tag](https://pkg.go.dev/go/build#hdr-Build_Constraints) `go build --tags=tspi`.
34-
35-
Windows users can use go-attestation with TPM1.2 by default.
27+
Linux users must install `libtspi` and its headers. This can be installed on debian-based systems using: `sudo apt-get install libtspi-dev`.
3628

3729
## Example: device identity
3830

attest/activation.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,11 @@ type ActivationParameters struct {
3636
// TPMVersion holds the version of the TPM, either 1.2 or 2.0.
3737
TPMVersion TPMVersion
3838

39-
// EK, the endorsement key, describes an asymmetric key whose
40-
// private key is permanently bound to the TPM.
39+
// EK, the endorsement key, describes an asymmetric key who's
40+
// private key is permenantly bound to the TPM.
4141
//
4242
// Activation will verify that the provided EK is held on the same
43-
// TPM as the AK. However, it is the caller's responsibility to
43+
// TPM as the AK. However, it is the callers responsibility to
4444
// ensure the EK they provide corresponds to the the device which
4545
// they are trying to associate the AK with.
4646
EK crypto.PublicKey

attest/attest-tool/attest-tool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func selftestCredentialActivation(tpm *attest.TPM, ak *attest.AK) error {
8383

8484
func selftestAttest(tpm *attest.TPM, ak *attest.AK) error {
8585
// This nonce is used in generating the quote. As this is a selftest,
86-
// it's set to an arbitrary value.
86+
// its set to an arbitrary value.
8787
nonce := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8}
8888

8989
pub, err := attest.ParseAKPublic(tpm.Version(), ak.AttestationParameters().Public)

attest/attest_simulated_tpm20_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ func setupSimulatedTPM(t *testing.T) (*simulator.Simulator, *TPM) {
3333
if err != nil {
3434
t.Fatal(err)
3535
}
36-
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &fakeCmdChannel{tpm}})
36+
attestTPM, err := OpenTPM(&OpenConfig{CommandChannel: &linuxCmdChannel{tpm}})
3737
if err != nil {
3838
t.Fatal(err)
3939
}

attest/eventlog.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ func (e EventType) String() string {
115115
}
116116

117117
// Event is a single event from a TCG event log. This reports descrete items such
118-
// as BIOS measurements or EFI states.
118+
// as BIOs measurements or EFI states.
119119
//
120120
// There are many pitfalls for using event log events correctly to determine the
121-
// state of a machine[1]. In general it's much safer to only rely on the raw PCR
121+
// state of a machine[1]. In general it's must safer to only rely on the raw PCR
122122
// values and use the event log for debugging.
123123
//
124124
// [1] https://github.com/google/go-attestation/blob/master/docs/event-log-disclosure.md
@@ -216,7 +216,7 @@ func (e *EventLog) Events(hash HashAlg) []Event {
216216
// Verify replays the event log against a TPM's PCR values, returning the
217217
// events which could be matched to a provided PCR value.
218218
//
219-
// PCRs provide no security guarantees unless they're attested to have been
219+
// PCRs provide no security guarentees unless they're attested to have been
220220
// generated by a TPM. Verify does not perform these checks.
221221
//
222222
// An error is returned if the replayed digest for events with a given PCR
@@ -401,7 +401,7 @@ func extend(pcr PCR, replay []byte, e rawEvent, locality byte) (pcrDigest []byte
401401
// replayPCR replays the event log for a specific PCR, using pcr and
402402
// event digests with the algorithm in pcr. An error is returned if the
403403
// replayed values do not match the final PCR digest, or any event tagged
404-
// with that PCR does not possess an event digest with the specified algorithm.
404+
// with that PCR does not posess an event digest with the specified algorithm.
405405
func replayPCR(rawEvents []rawEvent, pcr PCR) ([]Event, bool) {
406406
var (
407407
replay []byte
@@ -525,7 +525,7 @@ func ParseEventLog(measurementLog []byte) (*EventLog, error) {
525525
// Switch to parsing crypto agile events. Don't include this in the
526526
// replayed events since it intentionally doesn't extend the PCRs.
527527
//
528-
// Note that this doesn't actually guarantee that events have SHA256
528+
// Note that this doesn't actually guarentee that events have SHA256
529529
// digests.
530530
parseFn = parseRawEvent2
531531
} else {

attest/example_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ func ExampleAK_credentialActivation() {
7979
log.Fatalf("Failed to generate activation challenge: %v", err)
8080
}
8181

82-
// Challenge the AK & EK properties to receive the decrypted secret.
82+
// Challenge the AK & EK properties to recieve the decrypted secret.
8383
decrypted, err := ak.ActivateCredential(tpm, *challenge)
8484
if err != nil {
8585
log.Fatalf("Failed to activate credential: %v", err)

attest/key_linux.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
// License for the specific language governing permissions and limitations under
1313
// the License.
1414

15-
// +build linux,!gofuzz,cgo,tspi
15+
// +build linux,!gofuzz,cgo
1616

1717
package attest
1818

attest/pcp_windows.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626

2727
"github.com/google/certificate-transparency-go/x509"
2828

29-
"github.com/google/go-tpm/tpmutil"
30-
tpmtbs "github.com/google/go-tpm/tpmutil/tbs"
3129
"golang.org/x/sys/windows"
30+
tpmtbs "github.com/google/go-tpm/tpmutil/tbs"
31+
"github.com/google/go-tpm/tpmutil"
3232
)
3333

3434
const (

attest/secureboot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ import (
1919
"errors"
2020
"fmt"
2121

22-
"github.com/google/certificate-transparency-go/x509"
2322
"github.com/google/go-attestation/attest/internal"
23+
"github.com/google/certificate-transparency-go/x509"
2424
)
2525

2626
// SecurebootState describes the secure boot status of a machine, as determined

0 commit comments

Comments
 (0)