diff --git a/tools/attest/attest.go b/tools/attest/attest.go index 1cd9d6e..fc0ee3a 100644 --- a/tools/attest/attest.go +++ b/tools/attest/attest.go @@ -20,7 +20,6 @@ import ( "flag" "fmt" "io" - "log" "os" "github.com/google/go-sev-guest/abi" @@ -158,17 +157,17 @@ func main() { } if !(*outform == "bin" || *outform == "proto" || *outform == "textproto") { - log.Fatalf("-outform is %s. Expect \"bin\", \"proto\", or \"textproto\"", + logger.Fatalf("-outform is %s. Expect \"bin\", \"proto\", or \"textproto\"", *outform) } if *vmpl < 0 || *vmpl > 3 { - log.Fatalf("-vmpl is %d. Expect 0-3.", *vmpl) + logger.Fatalf("-vmpl is %d. Expect 0-3.", *vmpl) } outwriter, filetoclose, err := outWriter() if err != nil { - log.Fatal(err) + logger.Fatal(err) } defer func() { if filetoclose != nil { @@ -178,18 +177,18 @@ func main() { device, err := client.OpenDevice() if err != nil { - log.Fatal(err) + logger.Fatal(err) } defer device.Close() var reportData64 [abi.ReportDataSize]byte copy(reportData64[:], reportData) if *extended { if err := outputExtendedReport(device, reportData64, outwriter); err != nil { - log.Fatal(err) + logger.Fatal(err) } } else { if err := outputReport(device, reportData64, outwriter); err != nil { - log.Fatal(err) + logger.Fatal(err) } } } diff --git a/verify/verify_test.go b/verify/verify_test.go index 7e104df..9117f4d 100644 --- a/verify/verify_test.go +++ b/verify/verify_test.go @@ -22,6 +22,7 @@ import ( "encoding/asn1" "math/big" "math/rand" + "os" "strings" "sync" "testing" @@ -34,6 +35,7 @@ import ( test "github.com/google/go-sev-guest/testing" testclient "github.com/google/go-sev-guest/testing/client" "github.com/google/go-sev-guest/verify/trust" + "github.com/google/logger" ) // These certificates are committed regardless of its expiration date since we adjust the @@ -61,6 +63,11 @@ func initSigner() { signer = newSigner } +func TestMain(m *testing.M) { + logger.Init("VerifyTestLog", false, false, os.Stderr) + os.Exit(m.Run()) +} + func TestEmbeddedCertsAppendixB3Expectations(t *testing.T) { // https://www.amd.com/system/files/TechDocs/55766_SEV-KM_API_Specification.pdf // Appendix B.1