[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[OATH-Toolkit-help] Re: oathtoolkit 1.6.2 - computational error in calcu
From: |
Simon Josefsson |
Subject: |
[OATH-Toolkit-help] Re: oathtoolkit 1.6.2 - computational error in calculation of elapsed time since epoch hence wrong result. |
Date: |
Mon, 04 Apr 2011 22:42:07 +0200 |
User-agent: |
Gnus/5.110016 (No Gnus v0.16) Emacs/23.2 (gnu/linux) |
Hi Martin!
Welcome to the list. I'm cutting to the details in your post:
> # oathtool --totp -v -N "2033-05-18 03:33:20"
> 3132333435363738393031323334353637383930 -d 8
> Hex secret: 3132333435363738393031323334353637383930
> Digits: 8
> Window size: 0
> Step size (seconds): 30
> Start time: 1970-01-01 00:00:00 UTC (0)
> Current time: 2033-05-18 02:33:20 UTC (1999996400)
> Counter: 0x3F94032 (66666546)
>
> 48573438
>
> Conclusion
>
> It is apparent that both the calculated time since epoch value is in
> error leading to the wrong computation.
>
> When I adjust the time so that Current time has value of 2000000000 ie
> 2033-05-18 03:33:20 I do get the correct output value of 69279037
Try specifying the time zone for your time, which should be UTC:
oathtool --totp -v -N "2033-05-18 03:33:20 UTC"
3132333435363738393031323334353637383930 -d 8
Then I get the expected value 69279037. If the time zone is not
specified, the tool will use local time.
Was this your only problem? You referred to some problem with an
Android app, but didn't give details.
Cheers,
/Simon