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 of secret. 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 (typically 30). πŸ•°οΈ
  • time_t start_offset β€” Unix time of when to start counting time steps (typically 0). πŸš€
  • 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 be NULL). It can literally be NULL, 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 Β© 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