Fix linting issue and order of test SUT

This commit is contained in:
Herman Slatman 2023-01-27 15:43:57 +01:00
parent 2ab9beb7ed
commit 0f9128c873
No known key found for this signature in database
GPG key ID: F4D8A44EA0A75A4F
2 changed files with 7 additions and 8 deletions

View file

@ -349,7 +349,6 @@ type attestationObject struct {
func deviceAttest01Validate(ctx context.Context, ch *Challenge, db DB, jwk *jose.JSONWebKey, payload []byte) error {
var p payloadType
if err := json.Unmarshal(payload, &p); err != nil {
return WrapErrorISE(err, "error unmarshalling JSON")
}
if p.Error != "" {

View file

@ -677,7 +677,7 @@ func TestChallenge_Validate(t *testing.T) {
err := NewError(ErrorRejectedIdentifierType, "payload contained error: an error")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3195,7 +3195,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
err := NewError(ErrorRejectedIdentifierType, "payload contained error: an error")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3229,7 +3229,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
err := NewError(ErrorRejectedIdentifierType, "payload contained error: an error")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3343,7 +3343,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
err := NewError(ErrorBadAttestationStatementType, "attestation format %q is not enabled", "step")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3393,7 +3393,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
err := NewError(ErrorBadAttestationStatementType, "x5c not present")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3689,7 +3689,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
"challenge identifier \"12345678\" doesn't match the attested hardware identifier \"87654321\"",
))
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)
@ -3776,7 +3776,7 @@ func Test_deviceAttest01Validate(t *testing.T) {
err := NewError(ErrorBadAttestationStatementType, "unexpected attestation object format")
sassert.EqualError(t, err.Err, updch.Error.Err.Error())
sassert.EqualError(t, updch.Error.Err, err.Err.Error())
sassert.Equal(t, err.Type, updch.Error.Type)
sassert.Equal(t, err.Detail, updch.Error.Detail)
sassert.Equal(t, err.Status, updch.Error.Status)