Skip to content

EspoCRM – Open Source CRM Application

TOTP 160 bits

Yurii65bd2aca5de0
diff --git a/application/Espo/Core/Authentication/TwoFactor/Totp/Util.php b/application/Espo/Core/Authentication/TwoFactor/Totp/Util.php
index 7f34c9c7bb..08d33644fc 100644
--- a/application/Espo/Core/Authentication/TwoFactor/Totp/Util.php
+++ b/application/Espo/Core/Authentication/TwoFactor/Totp/Util.php
@@ -35,6 +35,8 @@ use RuntimeException;
class Util
{
+ private const int BITS = 160;
+
public function verifyCode(string $secret, string $code): bool
{
$impl = new TwoFactorAuth();
@@ -47,7 +49,7 @@ class Util
$impl = new TwoFactorAuth();
try {
- return $impl->createSecret();
+ return $impl->createSecret(self::BITS);
} catch (TwoFactorAuthException $e) {
throw new RuntimeException($e->getMessage());
}