Closed jamescook closed 4 years ago
@veelenga The general use case is to prevent timing attacks on HMAC signatures. In terms of tests, there is already coverage around signature and claim verification. Is there a test you can think of that needs to be added?
@jamescook I see, thanks. Well, I just try to follow the rule that every change should be enforced by the test, otherwise, if someone accidentally (or intensionally) changes it back, the suite will pass and there will not be any reason not to merge that as well.
However, I would rely on @stakach's input here.
Both of the popular Ruby and Go JWT implementations use constant-time string comparisons to some extent. Both use constant time comparison of a HMAC signature, but only Go uses constant time comparison for the 'aud' and 'iss'.