Correct tolerance values for timestamp fuzz default tip
authorDan Fuhry <dan@enanocms.org>
Wed, 11 Jan 2017 13:08:02 +0000
changeset 13 8a8cdc21aa15
parent 12 31387f4022e5
Correct tolerance values for timestamp fuzz
yms/backend.php
--- a/yms/backend.php	Wed Jan 11 13:02:34 2017 +0000
+++ b/yms/backend.php	Wed Jan 11 13:08:02 2017 +0000
@@ -354,7 +354,7 @@
     // Tolerate up to a 0.5Hz deviance from 8Hz. I've observed Yubikey
     // clocks running at 8.32Hz
     $actual_delta = $otp['timestamp'] - $token_time;
-    $fuzz = 150 + round(($actual_delta / 7.5) - ($actual_delta / 8.5));
+    $fuzz = 150 + round(($actual_delta / 7.75) - ($actual_delta / 8.25));
     // Now that we've calculated fuzz, convert the actual delta to quasi-seconds
     $actual_delta /= 8;
     if ( !yms_within($expect_delta, $actual_delta, $fuzz) )