KEYCLOAK-18880 TimeBasedOTP should use look-around to mitigate clock skew

Make TimeBasedOTP#clockSkewIndexToDelta private.
This commit is contained in:
Thomas Darimont 2021-08-24 14:03:24 +02:00 committed by Marek Posolda
parent af892d469c
commit fd2787ae7d

View file

@ -101,7 +101,7 @@ public class TimeBasedOTP extends HmacOTP {
/**
* maps 0, 1, 2, 3, 4, 5, 6, 7, ... to 0, -1, 1, -2, 2, -3, 3, ...
*/
public static long clockSkewIndexToDelta(int idx) {
private long clockSkewIndexToDelta(int idx) {
return (idx + 1) / 2 * (1 - (idx % 2) * 2);
}