Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

leeway/window Migration path clarification #201

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions doc/UPGRADE_v10-v11.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,19 @@

Congratulation, you have nothing to do!
This version requires PHP8.1+, but no changes on your side are expected.

However, please note the change in behavior of the `window` feature between versions 10 and 11.

With version 10
---------------

The `window` of timestamps goes from `timestamp - window * period` to `timestamp + window * period`.
For example, if the window is `5`, the period `30` and the timestamp `1476822000`, the OTP tested are within `1476821850` (`1476822000 - 5 * 30`) and `1476822150` (`1476822000 + 5 * 30`).
In other words, this validated the **5 OTP before and after** the current timestamp.

With version 11
---------------
The window of TOTP acts as time drift.
If the window is `10`, the period `30` and the timestamp `147682209`, the OTP tested are within `1476821999` (`147682209 - 10`), `147682209` and `1476822219` (`147682209 + 10`).
This includes the previous OTP, but not the next one.
The `window` shall be lower than the `period`. In the previous example, the `window` shall be between `0` and `30`.
Loading