Commit Graph

10 Commits

Author SHA1 Message Date
johnnyq
31cc3f3ac3 Replace Function strtoAZaz09() with toAlphanumeric() 2026-07-14 17:30:13 -04:00
johnnyq
8de3cd300d Replace Function key32gen() with generateTotpSecret() 2026-07-14 17:27:02 -04:00
johnnyq
b57ddc0e5c Replace Function sanitizeInput() with just escapeSql() and update all instances throughout 2026-07-14 17:17:50 -04:00
johnnyq
7bc47a58fe Replace Function nullable_htmlentities() with just escapeHtml() and update all instances throughout 2026-07-14 17:10:45 -04:00
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