From ba301b297307cc7b73c44e3dd523749aacb6a9a8 Mon Sep 17 00:00:00 2001 From: Jacqueline Wong Date: Tue, 18 Feb 2025 18:56:22 -0800 Subject: [PATCH] Minor typo and formatting clean up --- verification/testing/deriveContext.go | 2 +- verification/testing/negativeCases.go | 4 ++-- verification/testing/sign.go | 2 +- verification/testing/tpm.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/verification/testing/deriveContext.go b/verification/testing/deriveContext.go index e583c758..ef93f636 100644 --- a/verification/testing/deriveContext.go +++ b/verification/testing/deriveContext.go @@ -539,7 +539,7 @@ func computeExpectedCumulative(lastCumulative []byte, tciValue []byte) []byte { } func verifyMeasurements(c client.DPEClient, t *testing.T, handle *client.ContextHandle, expectedCurrent []byte, expectedCumulative []byte) { - handle, tcbInfo, err := getTcbInfoForHandle(c, handle) + _, tcbInfo, err := getTcbInfoForHandle(c, handle) if err != nil { t.Fatal(err) } diff --git a/verification/testing/negativeCases.go b/verification/testing/negativeCases.go index 245f06ca..3dcc02b2 100644 --- a/verification/testing/negativeCases.go +++ b/verification/testing/negativeCases.go @@ -185,14 +185,14 @@ func TestUnsupportedCommandFlag(d client.TestDPEInstance, c client.DPEClient, t t.Errorf("[ERROR]: Incorrect error type. InternalInfo is not supported by DPE, DeriveContext should return %q, but returned %q", client.StatusArgumentNotSupported, err) } - // Check whether error is returned since InternalDice usgae is unsupported by DPE profile + // Check whether error is returned since InternalDice usage is unsupported by DPE profile if _, err := c.DeriveContext(handle, make([]byte, digestLen), client.DeriveContextFlags(client.InternalInputDice), 0, 0); err == nil { t.Errorf("[ERROR]:InternalDice is not supported by DPE, DeriveContext should return %q, but returned no error", client.StatusArgumentNotSupported) } else if !errors.Is(err, client.StatusArgumentNotSupported) { t.Errorf("[ERROR]: Incorrect error type. InternalDice is not supported by DPE, DeriveContext should return %q, but returned %q", client.StatusArgumentNotSupported, err) } - // Check whether error is returned since InternalDice usgae is unsupported by DPE profile + // Check whether error is returned since InternalDice usage is unsupported by DPE profile if _, err := c.DeriveContext(handle, make([]byte, digestLen), client.DeriveContextFlags(client.InputAllowX509), 0, 0); err == nil { t.Errorf("[ERROR]:X509 is not supported by DPE, DeriveContext should return %q, but returned no error", client.StatusArgumentNotSupported) } else if !errors.Is(err, client.StatusArgumentNotSupported) { diff --git a/verification/testing/sign.go b/verification/testing/sign.go index b4abc041..cf79afdd 100644 --- a/verification/testing/sign.go +++ b/verification/testing/sign.go @@ -80,7 +80,7 @@ func TestAsymmetricSigning(d client.TestDPEInstance, c client.DPEClient, t *test } } -// TestSignSimulation cheks command fails in simulated context because this context does not allow signing. +// TestSignSimulation checks command fails in simulated context because this context does not allow signing. // This is because simulation context does not allow using context's private key. func TestSignSimulation(d client.TestDPEInstance, c client.DPEClient, t *testing.T) { useSimulation := true diff --git a/verification/testing/tpm.go b/verification/testing/tpm.go index 667a1396..0112b715 100644 --- a/verification/testing/tpm.go +++ b/verification/testing/tpm.go @@ -85,7 +85,7 @@ func TestTpmPolicySigning(d dpe.TestDPEInstance, c dpe.DPEClient, t *testing.T) ec = tpm2.CurveNISTP384 } - //Create tpm auth session to get nonce and form label which is digest + // Create tpm auth session to get nonce and form label which is digest tpm, err := simulator.Get() if err != nil { t.Fatalf("[FATAL]: Can't open TPM")