aboutsummaryrefslogtreecommitdiff
path: root/src/common/Cryptography/TOTP.cpp
diff options
context:
space:
mode:
authorTreeston <treeston.mmoc@gmail.com>2019-08-11 13:29:50 +0200
committerTreeston <treeston.mmoc@gmail.com>2019-08-11 13:29:50 +0200
commit0f7e070ed4cd01ffb4c5384b74d7b7b01d758c0d (patch)
tree40cce105af22f31223a383c1052bb29c0677529e /src/common/Cryptography/TOTP.cpp
parent4211645834c467a03c60248e80818d3607be9ea7 (diff)
Common/Crypto: Make C++14 compilers happy.
Diffstat (limited to 'src/common/Cryptography/TOTP.cpp')
-rw-r--r--src/common/Cryptography/TOTP.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/common/Cryptography/TOTP.cpp b/src/common/Cryptography/TOTP.cpp
index 1b720ab082a..533024a4c18 100644
--- a/src/common/Cryptography/TOTP.cpp
+++ b/src/common/Cryptography/TOTP.cpp
@@ -20,11 +20,10 @@
#include <openssl/evp.h>
#include <openssl/hmac.h>
-using namespace Trinity::Crypto;
-
+constexpr std::size_t Trinity::Crypto::TOTP::RECOMMENDED_SECRET_LENGTH;
static constexpr uint32 TOTP_INTERVAL = 30;
static constexpr uint32 HMAC_RESULT_SIZE = 20;
-/*static*/ uint32 TOTP::GenerateToken(TOTP::Secret const& secret, time_t timestamp)
+/*static*/ uint32 Trinity::Crypto::TOTP::GenerateToken(Secret const& secret, time_t timestamp)
{
timestamp /= TOTP_INTERVAL;
unsigned char challenge[8];
@@ -41,7 +40,7 @@ static constexpr uint32 HMAC_RESULT_SIZE = 20;
return (truncated % 1000000);
}
-/*static*/ bool TOTP::ValidateToken(TOTP::Secret const& secret, uint32 token)
+/*static*/ bool Trinity::Crypto::TOTP::ValidateToken(Secret const& secret, uint32 token)
{
time_t now = time(nullptr);
return (