oath_totp_validate2(3)
π
oath_totp_validate2(3) β liboath bestie era π
πΈ NAME πΈ
oath_totp_validate2 β an API function from liboath, and it's literally here to validate TOTP for you, bestie. π
β¨ SYNOPSIS β¨
#include <oath.h>
int oath_totp_validate2(const char * secret, size_t secret_length,
time_t now, unsigned time_step_size, time_t start_offset, size_t window,
int * otp_pos, const char * otp);
π ARGUMENTS π
const char * secretβ the shared secret string, aka the vibe check material. πsize_t secret_lengthβ length ofsecret. No cap, you gotta know how long it is. πtime_t nowβ Unix time value to validate TOTP for. β°unsigned time_step_sizeβ time step system parameter (typically30). π°οΈtime_t start_offsetβ Unix time of when to start counting time steps (typically0). πsize_t windowβ how many OTPs after/before start OTP to test. Like, the search radius, bestie. πint * otp_posβ output search position in search window (may beNULL). It can literally beNULL, no pressure. πconst char * otpβ the OTP to validate. This is the one we're checking, periodt. β
π¦ DESCRIPTION π¦
Okay so this function validates an OTP according to the OATH TOTP algorithm per RFC 6238. Iconic. π₯
Currently only OTP lengths of 6, 7 or 8 digits are supported. This restriction may be lifted in future versions, although some limitations are inherent in the protocol. So yeah, for now that's the digits situation, bestie. π
π RETURNS π
It returns the absolute value of the position in the OTP window (zero is first position), or OATH_INVALID_OTP if no OTP was found in OTP window, or an error code. That's the whole return vibe. π«Ά
π SINCE π
1.10.0 β she's been around, and she ate. π
π REPORTING BUGS π
Report bugs to <oath-toolkit-help@nongnu.org>. The liboath home page is https://oath-toolkit.codeberg.page/. General help using GNU software: http://www.gnu.org/gethelp/. Go off, but like, report it nicely. π«‘
π COPYRIGHT π
Copyright Β© 2009-2026 Simon Josefsson.
Copying and distribution of this file, with or without modification, are permitted in any medium without royalty provided the copyright notice and this notice are preserved. Keep the notice, bestie, it's the rules. π
π signed off from liboath 2.6.15 β and the only date energy on this page is the copyright's 2009-2026, bestie, periodt π
π¦ where this page comes from
- arch rolling: oath-toolkit 2.6.15-1 Β· GPL-3.0-or-later
- nixpkgs unstable: oath-toolkit 2.6.15
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms