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

OTP verified with negative time delta #88

Open
Circles24 opened this issue Nov 9, 2023 · 0 comments
Open

OTP verified with negative time delta #88

Circles24 opened this issue Nov 9, 2023 · 0 comments

Comments

@Circles24
Copy link

I was able to validate a TOTP with negative delta, lets say the OTP was generated on x timestamp then validating OTP on x-10 timestamp is working.

The issue is not reproducible at go playground, there the validation in failing, here's the go playground link : https://go.dev/play/p/xmCJkmRkzXA

This is the go version I'm using at my machine

➜  temp git:(main) ✗ go version  
go version go1.21.3 darwin/amd64

library version

github.com/pquerna/otp v1.4.0

here are the logs I get at my machine

➜  temp git:(main) ✗ go run main.go
2023/11/09 07:39:10 otp generated 118067
2023/11/09 07:39:10 2023-11-09 07:39:10.457564 +0530 IST m=+0.000233439
2023/11/09 07:39:10 2023-11-09 07:39:00.457564 +0530 IST m=-9.999766561
2023/11/09 07:39:10 otp verified

logs from go-playground

2009/11/10 23:00:00 otp generated 470478
2009/11/10 23:00:00 2009-11-10 23:00:00 +0000 UTC m=+0.000000001
2009/11/10 23:00:00 2009-11-10 22:59:59 +0000 UTC m=-0.999999999
2009/11/10 23:00:00 otp verification failed

Program exited.
@Circles24 Circles24 changed the title otp is verified with negative time delta OTP verified with negative time delta Nov 9, 2023
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

No branches or pull requests

1 participant