1oath_totp_validate(3)               liboath              oath_totp_validate(3)
2
3
4

NAME

6       oath_totp_validate - API function
7

SYNOPSIS

9       #include <oath.h>
10
11       int  oath_totp_validate(const  char  *  secret,  size_t  secret_length,
12       time_t now, unsigned time_step_size, time_t start_offset,  size_t  win‐
13       dow, const char * otp);
14

ARGUMENTS

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       const char * otp
35                   the OTP to validate.
36

DESCRIPTION

38       Validate an OTP according to OATH TOTP algorithm per RFC 6238.
39
40       Currently only OTP lengths of 6, 7 or 8 digits are supported.  This re‐
41       strictions  may be lifted in future versions, although some limitations
42       are inherent in the protocol.
43

RETURNS

45       Returns absolute value of position in OTP window (zero is  first  posi‐
46       tion), or OATH_INVALID_OTP if no OTP was found in OTP window, or an er‐
47       ror code.
48

SINCE

50       1.6.0
51

REPORTING BUGS

53       Report bugs  to  <oath-toolkit-help@nongnu.org>.   liboath  home  page:
54       https://www.nongnu.org/oath-toolkit/  General  help using GNU software:
55       http://www.gnu.org/gethelp/
56
58       Copyright © 2009-2020 Simon Josefsson.
59       Copying and distribution of this file, with  or  without  modification,
60       are  permitted in any medium without royalty provided the copyright no‐
61       tice and this notice are preserved.
62
63
64
65liboath                              2.6.7               oath_totp_validate(3)
Impressum