The FreeRADIUS server
$Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Common function for TOTP validation. More...
Go to the source code of this file.
Functions | |
int | fr_totp_cmp (fr_totp_t const *cfg, request_t *request, time_t now, uint8_t const *key, size_t keylen, char const *totp) |
Implement RFC 6238 TOTP algorithm (HMAC-SHA1). More... | |
Common function for TOTP validation.
Definition in file totp.c.
int fr_totp_cmp | ( | fr_totp_t const * | cfg, |
request_t * | request, | ||
time_t | now, | ||
uint8_t const * | key, | ||
size_t | keylen, | ||
char const * | totp | ||
) |
Implement RFC 6238 TOTP algorithm (HMAC-SHA1).
Appendix B has test vectors. Note that the test vectors are for 8-character challenges, and not for 6 character challenges!
[in] | cfg | Instance of fr_totp_t |
[in] | request | The current request |
[in] | now | The current time |
[in] | key | Key to encrypt. |
[in] | keylen | Length of key field. |
[in] | totp | TOTP password entered by the user. |
Definition at line 71 of file totp.c.