-
Notifications
You must be signed in to change notification settings - Fork 12
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
(RP204-) getCodeFromTimeStamp() returns incorrect code #2
Comments
If timestamp on both side (2FA Server and RP2040) are based from UTC±0. It no need to use setTimezone.
|
Oh ok so that basically does correction if the user hasn't done so beforehand. Thanks a lot I'll try it when I get home. Also you should probably make that a bit clearer in the README, as well as the fact that the string provided by most apps is base32 and needs to be upcased and decoded, because I initially thought it was ascii and converted it like that which obviously didn't work. |
Thank you very much for your comment. I will update Readme clearly!! |
MCU: RP2040
Compiler: arm-none-eabi-gcc
Compiler host machine: macOS
I have converted the base32 string provided by the 2fa server to hex using the Base32 (RFC 3548, RFC 4648) algorithm and provided it as hmacKey[] to the TOTP constructor.
I have also set the timezone to UTC+3 since it's summer and I'm in Greece using setTimezone(3), but the unix timestamp provided by the RP2040 RTC is already corrected to UTC±0. Is that how I'm supposed to do it?
Anyway, the provided timestamp from the RTC is correct but the generated token is invalid.
Any ideas?
The text was updated successfully, but these errors were encountered: