oath_totp_validate(3)
πΈ NAME πΈ
okay so bestie, this is oath_totp_validate(3) from liboath β and the NAME tea is simple: oath_totp_validate is an API function, and she's the main character of this page. π
β¨
β¨ SYNOPSIS β¨
Here's the summoning spell, copy it exactly, no cap:
#include <oath.h>
int oath_totp_validate(const char * secret, size_t secret_length, time_t
now, unsigned time_step_size, time_t start_offset, size_t window, const
char * otp);
π ARGUMENTS π
okay, let's meet the cast, one by one π«Ά
const char * secretβ the shared secret string. The actual secret tea. πsize_t secret_lengthβ length ofsecret. How many characters she's serving. πtime_t nowβ Unix time value to validate TOTP for. That's the moment we're checking against. β°unsigned time_step_sizeβ time step system parameter (typically30). The heartbeat of the TOTP situation. πtime_t start_offsetβ Unix time of when to start counting time steps (typically0). Where the counting era begins. π°οΈsize_t windowβ how many OTPs after/before start OTP to test. The search radius, basically. πconst char * otpβ the OTP to validate. The code under the vibe check. β
π¦ DESCRIPTION π¦
Validate an OTP according to the OATH TOTP algorithm per RFC 6238. That's the whole assignment. π±β¨
Currently only OTP lengths of 6, 7, or 8 digits are supported β those are the only sizes allowed on the runway right now. This restriction may be lifted in future versions, although some limitations are literally inherent in the protocol, so it's not just a vibe thing. π§
π RETURNS π
She returns the absolute value of position in OTP window β zero is first position β or OATH_INVALID_OTP if no OTP was found in the OTP window, or an error code. So it's giving position number, invalid-OTP moment, or error code. Periodt. π
β SINCE β
1.6.0 β that's the era, bestie. π°οΈπ
π REPORTING BUGS π
Got a bug? Do not suffer in silence, report it to <oath-toolkit-help@nongnu.org>. π«Ά
- Report bugs to
<oath-toolkit-help@nongnu.org>. - liboath home page:
https://oath-toolkit.codeberg.page/ - General help using GNU software:
http://www.gnu.org/gethelp/
π 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. No cap, those are the license vibes. π
xoxo, your liboath bestie β source/version from the footer is liboath 2.6.15, and no separate date was printed, so I'm not inventing one. πβ¨
π¦ 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