mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Common/Crypto: Make C++14 compilers happy.
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user