mirror of
https://github.com/google/go-attestation.git
synced 2025-05-28 13:04:30 +00:00
Fix minor spelling issues in comments
This commit is contained in:
parent
5df8a8e979
commit
e8c5dc4fd5
@ -36,11 +36,11 @@ type ActivationParameters struct {
|
|||||||
// TPMVersion holds the version of the TPM, either 1.2 or 2.0.
|
// TPMVersion holds the version of the TPM, either 1.2 or 2.0.
|
||||||
TPMVersion TPMVersion
|
TPMVersion TPMVersion
|
||||||
|
|
||||||
// EK, the endorsement key, describes an asymmetric key who's
|
// EK, the endorsement key, describes an asymmetric key whose
|
||||||
// private key is permenantly bound to the TPM.
|
// private key is permanently bound to the TPM.
|
||||||
//
|
//
|
||||||
// Activation will verify that the provided EK is held on the same
|
// Activation will verify that the provided EK is held on the same
|
||||||
// TPM as the AK. However, it is the callers responsibility to
|
// TPM as the AK. However, it is the caller's responsibility to
|
||||||
// ensure the EK they provide corresponds to the the device which
|
// ensure the EK they provide corresponds to the the device which
|
||||||
// they are trying to associate the AK with.
|
// they are trying to associate the AK with.
|
||||||
EK crypto.PublicKey
|
EK crypto.PublicKey
|
||||||
|
@ -83,7 +83,7 @@ func selftestCredentialActivation(tpm *attest.TPM, ak *attest.AK) error {
|
|||||||
|
|
||||||
func selftestAttest(tpm *attest.TPM, ak *attest.AK) error {
|
func selftestAttest(tpm *attest.TPM, ak *attest.AK) error {
|
||||||
// This nonce is used in generating the quote. As this is a selftest,
|
// This nonce is used in generating the quote. As this is a selftest,
|
||||||
// its set to an arbitrary value.
|
// it's set to an arbitrary value.
|
||||||
nonce := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8}
|
nonce := []byte{1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8}
|
||||||
|
|
||||||
pub, err := attest.ParseAKPublic(tpm.Version(), ak.AttestationParameters().Public)
|
pub, err := attest.ParseAKPublic(tpm.Version(), ak.AttestationParameters().Public)
|
||||||
|
@ -115,10 +115,10 @@ func (e EventType) String() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Event is a single event from a TCG event log. This reports descrete items such
|
// Event is a single event from a TCG event log. This reports descrete items such
|
||||||
// as BIOs measurements or EFI states.
|
// as BIOS measurements or EFI states.
|
||||||
//
|
//
|
||||||
// There are many pitfalls for using event log events correctly to determine the
|
// There are many pitfalls for using event log events correctly to determine the
|
||||||
// state of a machine[1]. In general it's must safer to only rely on the raw PCR
|
// state of a machine[1]. In general it's much safer to only rely on the raw PCR
|
||||||
// values and use the event log for debugging.
|
// values and use the event log for debugging.
|
||||||
//
|
//
|
||||||
// [1] https://github.com/google/go-attestation/blob/master/docs/event-log-disclosure.md
|
// [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 {
|
|||||||
// Verify replays the event log against a TPM's PCR values, returning the
|
// Verify replays the event log against a TPM's PCR values, returning the
|
||||||
// events which could be matched to a provided PCR value.
|
// events which could be matched to a provided PCR value.
|
||||||
//
|
//
|
||||||
// PCRs provide no security guarentees unless they're attested to have been
|
// PCRs provide no security guarantees unless they're attested to have been
|
||||||
// generated by a TPM. Verify does not perform these checks.
|
// generated by a TPM. Verify does not perform these checks.
|
||||||
//
|
//
|
||||||
// An error is returned if the replayed digest for events with a given PCR
|
// 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
|
|||||||
// replayPCR replays the event log for a specific PCR, using pcr and
|
// replayPCR replays the event log for a specific PCR, using pcr and
|
||||||
// event digests with the algorithm in pcr. An error is returned if the
|
// event digests with the algorithm in pcr. An error is returned if the
|
||||||
// replayed values do not match the final PCR digest, or any event tagged
|
// replayed values do not match the final PCR digest, or any event tagged
|
||||||
// with that PCR does not posess an event digest with the specified algorithm.
|
// with that PCR does not possess an event digest with the specified algorithm.
|
||||||
func replayPCR(rawEvents []rawEvent, pcr PCR) ([]Event, bool) {
|
func replayPCR(rawEvents []rawEvent, pcr PCR) ([]Event, bool) {
|
||||||
var (
|
var (
|
||||||
replay []byte
|
replay []byte
|
||||||
@ -525,7 +525,7 @@ func ParseEventLog(measurementLog []byte) (*EventLog, error) {
|
|||||||
// Switch to parsing crypto agile events. Don't include this in the
|
// Switch to parsing crypto agile events. Don't include this in the
|
||||||
// replayed events since it intentionally doesn't extend the PCRs.
|
// replayed events since it intentionally doesn't extend the PCRs.
|
||||||
//
|
//
|
||||||
// Note that this doesn't actually guarentee that events have SHA256
|
// Note that this doesn't actually guarantee that events have SHA256
|
||||||
// digests.
|
// digests.
|
||||||
parseFn = parseRawEvent2
|
parseFn = parseRawEvent2
|
||||||
} else {
|
} else {
|
||||||
|
@ -79,7 +79,7 @@ func ExampleAK_credentialActivation() {
|
|||||||
log.Fatalf("Failed to generate activation challenge: %v", err)
|
log.Fatalf("Failed to generate activation challenge: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Challenge the AK & EK properties to recieve the decrypted secret.
|
// Challenge the AK & EK properties to receive the decrypted secret.
|
||||||
decrypted, err := ak.ActivateCredential(tpm, *challenge)
|
decrypted, err := ak.ActivateCredential(tpm, *challenge)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalf("Failed to activate credential: %v", err)
|
log.Fatalf("Failed to activate credential: %v", err)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user