mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Apply fixes from StyleCI (#13201)
This commit is contained in:
@@ -184,11 +184,11 @@ class TwoFactor
|
||||
}
|
||||
}
|
||||
$hash = hash_hmac('sha1', pack('N*', 0) . pack('N*', $counter), $kbin, true);
|
||||
$offset = ord($hash[19]) & 0xf;
|
||||
$truncated = (((ord($hash[$offset + 0]) & 0x7f) << 24) |
|
||||
((ord($hash[$offset + 1]) & 0xff) << 16) |
|
||||
((ord($hash[$offset + 2]) & 0xff) << 8) |
|
||||
(ord($hash[$offset + 3]) & 0xff)) % pow(10, self::OTP_SIZE);
|
||||
$offset = ord($hash[19]) & 0xF;
|
||||
$truncated = (((ord($hash[$offset + 0]) & 0x7F) << 24) |
|
||||
((ord($hash[$offset + 1]) & 0xFF) << 16) |
|
||||
((ord($hash[$offset + 2]) & 0xFF) << 8) |
|
||||
(ord($hash[$offset + 3]) & 0xFF)) % pow(10, self::OTP_SIZE);
|
||||
|
||||
return str_pad($truncated, self::OTP_SIZE, '0', STR_PAD_LEFT);
|
||||
}
|
||||
|
Reference in New Issue
Block a user