diff --git a/attest/attest.go b/attest/attest.go index 79efed3..cba8963 100644 --- a/attest/attest.go +++ b/attest/attest.go @@ -123,8 +123,8 @@ func (k *AIK) Quote(tpm *TPM, nonce []byte, alg HashAlg) (*Quote, error) { return k.aik.quote(tpm.tpm, nonce, alg) } -// Parameters returns information about the AIK, typically used to generate -// a credential activation challenge. +// AttestationParameters returns information about the AIK, typically used to +// generate a credential activation challenge. func (k *AIK) AttestationParameters() AttestationParameters { return k.aik.attestationParameters() } diff --git a/attest/eventlog.go b/attest/eventlog.go index 8128d5f..cb00c0d 100644 --- a/attest/eventlog.go +++ b/attest/eventlog.go @@ -17,14 +17,14 @@ package attest import ( "bytes" "crypto" + "crypto/rsa" + "crypto/sha1" "encoding/binary" "fmt" "io" "sort" // Ensure hashes are available. - "crypto/rsa" - "crypto/sha1" _ "crypto/sha256" "github.com/google/go-tpm/tpm2" @@ -326,17 +326,18 @@ type specAlgSize struct { Size uint16 } -var ( - // Expected values for various Spec ID Event fields. - // https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf#page=19 - wantSignature = [16]byte{0x53, 0x70, - 0x65, 0x63, 0x20, 0x49, - 0x44, 0x20, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x30, - 0x33, 0x00} // "Spec ID Event03\0" - wantMajor uint8 = 2 - wantMinor uint8 = 0 - wantErrata = 0 +// Expected values for various Spec ID Event fields. +// https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf#page=19 +var wantSignature = [16]byte{0x53, 0x70, + 0x65, 0x63, 0x20, 0x49, + 0x44, 0x20, 0x45, 0x76, + 0x65, 0x6e, 0x74, 0x30, + 0x33, 0x00} // "Spec ID Event03\0" + +const ( + wantMajor = 2 + wantMinor = 0 + wantErrata = 0 ) // parseSpecIDEvent parses a TCG_EfiSpecIDEventStruct structure from the reader.