Skip to content

Commit

Permalink
refactor(protocol): clean up 'nil != nil' is always false
Browse files Browse the repository at this point in the history
`err` is nil after the above `Unmarshal`, so `err` must be `nil` at this point.
This warning is via gopls x/tools/go/analysis/passes/nilness "impossible condition: nil != nil nilness(cond)"
  • Loading branch information
robert-wallis committed Jul 16, 2024
1 parent 7dee1ee commit 6a6503e
Showing 1 changed file with 1 addition and 1 deletion.
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) (string, []
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

0 comments on commit 6a6503e

Please sign in to comment.