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

Use system clock for local offset, not timekeeping #90

Merged
merged 1 commit into from
Jun 18, 2019

Conversation

NKelias
Copy link
Contributor

@NKelias NKelias commented Jun 18, 2019

This uses the system clock for storing the offset since the last update only.
Unix timestamp of the set_time command is stored locally as u64 to prevent year 2038 integer overrun and added to current local offset for TOTP generation.

resolves #17

Firmware:
firmware.zip

@szszszsz szszszsz merged commit 13077b9 into Nitrokey:master Jun 18, 2019
szszszsz added a commit that referenced this pull request Jun 18, 2019
Allow TOTP implementation to work with timestamps beyond 2038

From #90:
> This uses the system clock for storing the offset since the last update only.
Unix timestamp of the set_time command is stored locally as u64 to prevent year 2038 integer overrun and added to current local offset for TOTP generation.
> Passes https://github.com/Nitrokey/libnitrokey/blob/0275ebc610b255e3519baf866438244f288576bc/unittest/test_pro.py#L456 now.

Fixes #17
Fixes #90
@szszszsz
Copy link
Member

Merged, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TOTP not working for time bigger than int32 / after year 2038
2 participants