From 8dc7ac56ef67935cc9ed4599f7208bd7d86a6fa4 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 7 May 2024 10:13:34 +0200 Subject: [PATCH 1/4] Remove dependency github.com/pkg/errors Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- client/client.go | 2 +- go.mod | 1 - go.sum | 2 -- testing/mocks.go | 2 +- verify/verify.go | 2 +- 5 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/client.go b/client/client.go index cca0fca..57c8687 100644 --- a/client/client.go +++ b/client/client.go @@ -15,13 +15,13 @@ package client import ( + "errors" "flag" "fmt" "github.com/google/go-sev-guest/abi" labi "github.com/google/go-sev-guest/client/linuxabi" pb "github.com/google/go-sev-guest/proto/sevsnp" - "github.com/pkg/errors" ) var sevGuestPath = flag.String("sev_guest_device_path", "default", diff --git a/go.mod b/go.mod index 716877f..1e21e44 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/google/go-configfs-tsm v0.2.2 github.com/google/logger v1.1.1 github.com/google/uuid v1.6.0 - github.com/pkg/errors v0.9.1 go.uber.org/multierr v1.11.0 golang.org/x/crypto v0.17.0 golang.org/x/sys v0.15.0 diff --git a/go.sum b/go.sum index dcb0643..2a64077 100644 --- a/go.sum +++ b/go.sum @@ -11,8 +11,6 @@ github.com/google/logger v1.1.1 h1:+6Z2geNxc9G+4D4oDO9njjjn2d0wN5d7uOo0vOIW1NQ= github.com/google/logger v1.1.1/go.mod h1:BkeJZ+1FhQ+/d087r4dzojEg1u2ZX+ZqG1jTUrLM+zQ= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= -github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= diff --git a/testing/mocks.go b/testing/mocks.go index 782f799..97cb8c4 100644 --- a/testing/mocks.go +++ b/testing/mocks.go @@ -16,6 +16,7 @@ package testing import ( "encoding/hex" + "errors" "fmt" "syscall" "testing" @@ -23,7 +24,6 @@ import ( "github.com/google/go-sev-guest/abi" labi "github.com/google/go-sev-guest/client/linuxabi" spb "github.com/google/go-sev-guest/proto/sevsnp" - "github.com/pkg/errors" "golang.org/x/sys/unix" ) diff --git a/verify/verify.go b/verify/verify.go index 6b4005c..7f919d3 100644 --- a/verify/verify.go +++ b/verify/verify.go @@ -20,6 +20,7 @@ import ( "crypto/rsa" "crypto/x509" "crypto/x509/pkix" + "errors" "flag" "fmt" "time" @@ -30,7 +31,6 @@ import ( spb "github.com/google/go-sev-guest/proto/sevsnp" "github.com/google/go-sev-guest/verify/trust" "github.com/google/logger" - "github.com/pkg/errors" "go.uber.org/multierr" ) From 75ee64ebe6358f68102908ed8843841d1c75381b Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 7 May 2024 10:15:02 +0200 Subject: [PATCH 2/4] Gitignore kdsdatabase test output Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5f209ee..3551b24 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ !*.* !*/ *~ -external/* \ No newline at end of file +external/* +kdsdatabase.bin* From e6f26b42ab2c07b1fab4d148900c7bbba96f8ad4 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Tue, 7 May 2024 10:17:42 +0200 Subject: [PATCH 3/4] Remove nilness check that is always true Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- verify/verify.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/verify/verify.go b/verify/verify.go index 7f919d3..7eafbad 100644 --- a/verify/verify.go +++ b/verify/verify.go @@ -677,7 +677,7 @@ func SnpAttestation(attestation *spb.Attestation, options *Options) error { if err != nil { return err } - if options != nil && options.CheckRevocations { + if options.CheckRevocations { if err := VcekNotRevoked(root, endorsementKeyCert, options); err != nil { return err } From 8c614dd8b0228ac478c7320988fdd254063e57b1 Mon Sep 17 00:00:00 2001 From: Paul Meyer <49727155+katexochen@users.noreply.github.com> Date: Mon, 15 Jul 2024 17:48:18 +0200 Subject: [PATCH 4/4] Remove unused github.com/golang/protobuf Signed-off-by: Paul Meyer <49727155+katexochen@users.noreply.github.com> --- go.mod | 1 - go.sum | 6 ------ 2 files changed, 7 deletions(-) diff --git a/go.mod b/go.mod index 1e21e44..c3534b8 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/google/go-sev-guest go 1.19 require ( - github.com/golang/protobuf v1.5.3 github.com/google/go-cmp v0.5.7 github.com/google/go-configfs-tsm v0.2.2 github.com/google/logger v1.1.1 diff --git a/go.sum b/go.sum index 2a64077..83d5d8c 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,4 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= -github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= -github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= -github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/go-configfs-tsm v0.2.2 h1:YnJ9rXIOj5BYD7/0DNnzs8AOp7UcvjfTvt215EWcs98= @@ -22,8 +18,6 @@ golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=