mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-27 23:56:25 +00:00
feat(Core/Authserver): TOTP rewrite (#5620)
This commit is contained in:
25
src/common/Cryptography/TOTP.h
Normal file
25
src/common/Cryptography/TOTP.h
Normal file
@@ -0,0 +1,25 @@
|
||||
/*
|
||||
* Copyright (C) 2016+ AzerothCore <www.azerothcore.org>, released under GNU AGPL v3 license: https://github.com/azerothcore/azerothcore-wotlk/blob/master/LICENSE-AGPL3
|
||||
* Copyright (C) 2021+ WarheadCore <https://github.com/WarheadCore>
|
||||
*/
|
||||
|
||||
#ifndef WARHEAD_TOTP_H
|
||||
#define WARHEAD_TOTP_H
|
||||
|
||||
#include "Define.h"
|
||||
#include <ctime>
|
||||
#include <vector>
|
||||
|
||||
namespace acore::Crypto
|
||||
{
|
||||
struct AC_COMMON_API TOTP
|
||||
{
|
||||
static constexpr size_t RECOMMENDED_SECRET_LENGTH = 20;
|
||||
using Secret = std::vector<uint8>;
|
||||
|
||||
static uint32 GenerateToken(Secret const& key, time_t timestamp);
|
||||
static bool ValidateToken(Secret const& key, uint32 token);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user