1oath_totp_validate3(3) liboath oath_totp_validate3(3)
2
3
4
6 oath_totp_validate3 - API function
7
9 #include <oath.h>
10
11 int oath_totp_validate3(const char * secret, size_t secret_length,
12 time_t now, unsigned time_step_size, time_t start_offset, size_t win‐
13 dow, int * otp_pos, uint64_t * otp_counter, const char * otp);
14
16 const char * secret
17 the shared secret string
18
19 size_t secret_length
20 length of secret
21
22 time_t now Unix time value to validate TOTP for
23
24 unsigned time_step_size
25 time step system parameter (typically 30)
26
27 time_t start_offset
28 Unix time of when to start counting time steps (typically
29 0)
30
31 size_t window
32 how many OTPs after/before start OTP to test
33
34 int * otp_pos
35 output search position in search window (may be NULL).
36
37 uint64_t * otp_counter
38 counter value used to calculate OTP value (may be NULL).
39
40 const char * otp
41 the OTP to validate.
42
44 Validate an OTP according to OATH TOTP algorithm per RFC 6238.
45
46 Currently only OTP lengths of 6, 7 or 8 digits are supported. This
47 restrictions may be lifted in future versions, although some limita‐
48 tions are inherent in the protocol.
49
51 Returns absolute value of position in OTP window (zero is first posi‐
52 tion), or OATH_INVALID_OTP if no OTP was found in OTP window, or an
53 error code.
54
56 2.4.0
57
59 Report bugs to <oath-toolkit-help@nongnu.org>. liboath home page:
60 http://www.gnu.org/software/liboath/ General help using GNU software:
61 http://www.gnu.org/gethelp/
62
64 Copyright © 2009-2016 Simon Josefsson.
65 Copying and distribution of this file, with or without modification,
66 are permitted in any medium without royalty provided the copyright
67 notice and this notice are preserved.
68
69
70
71liboath 2.6.2 oath_totp_validate3(3)