summaryrefslogtreecommitdiff
path: root/plugins/auth_internal
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2019-11-01 10:34:31 +0300
committerAndrew Dolgov <[email protected]>2019-11-01 10:34:31 +0300
commit178bcd43497253c2ffb35d6c3ab3456277bf4ab6 (patch)
tree6962bc3db90a46e642a7b4cb11ab788cccb88238 /plugins/auth_internal
parent904ecc31e2ad743d5c0779d5be2d0c7cbc3865e8 (diff)
auth_internal: fix OTP seed checking
Diffstat (limited to 'plugins/auth_internal')
-rw-r--r--plugins/auth_internal/init.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/auth_internal/init.php b/plugins/auth_internal/init.php
index b9c26b3c2..638baa83a 100644
--- a/plugins/auth_internal/init.php
+++ b/plugins/auth_internal/init.php
@@ -36,7 +36,7 @@ class Auth_Internal extends Plugin implements IAuthModule {
$base32 = new \OTPHP\Base32();
$otp_enabled = $row['otp_enabled'];
- $secret = $base32->encode(sha1($row['salt']));
+ $secret = $base32->encode(mb_substr(sha1($row["salt"]), 0, 12), false);
$topt = new \OTPHP\TOTP($secret);
$otp_check = $topt->now();