google / go-sev-guest

go-sev-guest offers a library to wrap the /dev/sev-guest device in Linux, as well as a library for attestation verification of fundamental components of an attestation report.
Apache License 2.0
52 stars 19 forks source link

Fix SevFirmwareErr implementation and clean up error conditionals #35

Closed deeglaze closed 1 year ago

deeglaze commented 1 year ago

An error type should be a pointer to an object that implements Error. The indirection makes direct error comparison fail, so we switch to the existing pattern of wantErr as a string with a Contains test.

The testing library implementation can't be used in kds_test.go due to a cyclic dependency that would induce, but it's a mild inconvenince.