Skip to content

Fix lint and style errors #322

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion metadata/decode.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func (d *Decoder) DecodeBytes(bytes []byte) (payload *PayloadJSON, err error) {

if x5c, ok = token.Header[HeaderX509Certificate].([]any); !ok {
// If that attribute is missing as well, Metadata TOC signing trust anchor is considered the TOC signing certificate chain.
chain[0] = d.root
chain = []any{d.root}
} else {
chain = x5c
}
Expand Down
8 changes: 5 additions & 3 deletions protocol/attestation_androidkey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ func TestVerifyAndroidKeyFormat(t *testing.T) {
if got != tt.want {
t.Errorf("verifyAndroidKeyFormat() got = %v, want %v", got, tt.want)
}
//if !reflect.DeepEqual(got1, tt.want1) {
// t.Errorf("verifySafetyNetFormat() got1 = %v, want %v", got1, tt.want1)
//}
/*
if !reflect.DeepEqual(got1, tt.want1) {
t.Errorf("verifySafetyNetFormat() got1 = %v, want %v", got1, tt.want1)
}
*/
})
}
}
Expand Down
2 changes: 1 addition & 1 deletion protocol/attestation_apple.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func verifyAppleFormat(att AttestationObject, clientDataHash []byte, _ metadata.
return "", nil, ErrAttestationFormat.WithDetails("Unable to parse apple attestation certificate extensions")
}

if !bytes.Equal(decoded.Nonce, nonce[:]) || err != nil {
if !bytes.Equal(decoded.Nonce, nonce[:]) {
return "", nil, ErrInvalidAttestation.WithDetails("Attestation certificate does not contain expected nonce")
}

Expand Down
2 changes: 1 addition & 1 deletion protocol/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type CollectedClientData struct {
// Type the string "webauthn.create" when creating new credentials,
// and "webauthn.get" when getting an assertion from an existing credential. The
// purpose of this member is to prevent certain types of signature confusion attacks
//(where an attacker substitutes one legitimate signature for another).
// (where an attacker substitutes one legitimate signature for another).
Type CeremonyType `json:"type"`
Challenge string `json:"challenge"`
Origin string `json:"origin"`
Expand Down
2 changes: 1 addition & 1 deletion protocol/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ type AttestationFormat string
const (
// AttestationFormatPacked is the "packed" attestation statement format is a WebAuthn-optimized format for
// attestation. It uses a very compact but still extensible encoding method. This format is implementable by
//authenticators with limited resources (e.g., secure elements).
// authenticators with limited resources (e.g., secure elements).
AttestationFormatPacked AttestationFormat = "packed"

// AttestationFormatTPM is the TPM attestation statement format returns an attestation statement in the same format
Expand Down
Loading