Commit Graph

6 Commits

Author SHA1 Message Date
johnnyq
d62b6e2ae7 Update comment 2026-07-14 16:58:16 -04:00
johnnyq
5eb9f6b6d5 Fix weak RNG in key32gen (TOTP secret generation)
Replace srand()/rand() with random_int() for cryptographically secure,
unbiased key generation. The previous implementation seeded rand() from
microtime(), making TOTP secrets predictable if the generation time
could be approximated. Also removes modulo bias and dead while(1)
wrapper.

Output format is unchanged: 32 chars from the base32 alphabet (A-Z,
2-7), so existing TOTP enrollments are unaffected.
2026-07-14 16:57:16 -04:00
johnnyq
29bea9517d Removed the last of legacy validate functions and replaced with the new enforce fumctions. 2026-07-14 16:49:14 -04:00
johnnyq
a2a96f9752 Removed unused legacy functions and split the functions into their own file and use function.php to call them 2026-07-14 16:32:45 -04:00
johnnyq
f29d122376 Move totp.php out of functions folder into plugins then removed functions folder 2025-01-24 21:07:01 -05:00
johnnyq
8e04e10753 Combine base32static.php and rfc6238.php into 1 file called totp.php and place it into the functions folder 2025-01-24 20:26:46 -05:00