oath_hotp_validate(3)
β¨ NAME β¨
oath_hotp_validate β API function. Yep, thatβs the whole name bestie, and this page lives under the manual name liboath π«Άπ.
πΈ SYNOPSIS πΈ
#include <oath.h>
int oath_hotp_validate(const char * secret, size_t secret_length,
uint64_t start_moving_factor, size_t window, const char * otp);
π ARGUMENTS π
const char * secretβ the shared secret string πsize_t secret_lengthβ length ofsecretπuint64_t start_moving_factorβ start counter in OTP stream π’size_t windowβ how many OTPs after start counter to test πͺconst char * otpβ the OTP to validate. β
π DESCRIPTION π
Okay so this function validates an OTP according to the OATH HOTP algorithm per RFC 4226. Literally the main character of this whole page β¨.
Currently only OTP lengths of 6, 7 or 8 digits are supported. This restrictions may be lifted in future versions, although some limitations are inherent in the protocol β so yeah, some protocol limits are just built different π.
π₯ RETURNS π₯
It returns position in 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 return-value tea βπ
π REPORTING BUGS π
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.
Signing off with liboath 2.6.15 β thatβs the footerβs source/version flex, and thereβs no date in the footer, just vibes π«Άππ
π¦ 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