Skip to content

Commit

Permalink
use const time equal for alg in parse (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
cristaloleg authored Jan 25, 2021
1 parent 152cfba commit 56ff534
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func ParseAndVerify(raw []byte, verifier Verifier) (*Token, error) {
if err != nil {
return nil, err
}
if token.Header().Algorithm != verifier.Algorithm() {
if !constTimeAlgEqual(token.Header().Algorithm, verifier.Algorithm()) {
return nil, ErrAlgorithmMismatch
}
if err := verifier.Verify(token.Payload(), token.Signature()); err != nil {
Expand Down

0 comments on commit 56ff534

Please sign in to comment.