AzerothCore 3.3.5a
OpenSource WoW Emulator
|
#include "SRP6.h"
Public Types | |
using | Salt = std::array< uint8, SALT_LENGTH > |
using | Verifier = std::array< uint8, VERIFIER_LENGTH > |
using | EphemeralKey = std::array< uint8, EPHEMERAL_KEY_LENGTH > |
Public Member Functions | |
SRP6 (std::string const &username, Salt const &salt, Verifier const &verifier) | |
std::optional< SessionKey > | VerifyChallengeResponse (EphemeralKey const &A, SHA1::Digest const &clientM) |
Static Public Member Functions | |
static std::pair< Salt, Verifier > | MakeRegistrationData (std::string const &username, std::string const &password) |
static bool | CheckLogin (std::string const &username, std::string const &password, Salt const &salt, Verifier const &verifier) |
static SHA1::Digest | GetSessionVerifier (EphemeralKey const &A, SHA1::Digest const &clientM, SessionKey const &K) |
Public Attributes | |
Salt const | s |
EphemeralKey const | B |
Static Public Attributes | |
static constexpr std::size_t | SALT_LENGTH = 32 |
static constexpr std::size_t | VERIFIER_LENGTH = 32 |
static constexpr std::size_t | EPHEMERAL_KEY_LENGTH = 32 |
static std::array< uint8, 1 > const | g = { 7 } |
static std::array< uint8, 32 > const | N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true) |
Static Private Member Functions | |
static Verifier | CalculateVerifier (std::string const &username, std::string const &password, Salt const &salt) |
static SessionKey | SHA1Interleave (EphemeralKey const &S) |
static EphemeralKey | _B (BigNumber const &b, BigNumber const &v) |
Private Attributes | |
bool | _used = false |
SHA1::Digest const | _I |
BigNumber const | _b |
BigNumber const | _v |
Static Private Attributes | |
static BigNumber const | _g |
static BigNumber const | _N |
using Acore::Crypto::SRP6::EphemeralKey = std::array<uint8, EPHEMERAL_KEY_LENGTH> |
using Acore::Crypto::SRP6::Salt = std::array<uint8, SALT_LENGTH> |
using Acore::Crypto::SRP6::Verifier = std::array<uint8, VERIFIER_LENGTH> |
|
inlinestaticprivate |
References BigNumber::ModExp().
|
staticprivate |
References _g, _N, Acore::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf(), BigNumber::ModExp(), and BigNumber::ToByteArray().
Referenced by MakeRegistrationData().
|
inlinestatic |
Referenced by RASession::CheckPassword(), and AccountMgr::CheckPassword().
|
inlinestatic |
References Acore::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf().
Referenced by AuthSession::HandleLogonProof().
|
static |
References CalculateVerifier(), and Acore::Crypto::GetRandomBytes().
Referenced by AccountMgr::ChangePassword(), AccountMgr::ChangeUsername(), and AccountMgr::CreateAccount().
|
staticprivate |
References Acore::Impl::GenericHash< HashCreator, DigestLength >::DIGEST_LENGTH, EPHEMERAL_KEY_LENGTH, and Acore::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf().
Referenced by VerifyChallengeResponse().
std::optional< SessionKey > SRP6::VerifyChallengeResponse | ( | EphemeralKey const & | A, |
SHA1::Digest const & | clientM | ||
) |
References _b, _I, _N, _used, _v, ASSERT, B, g, Acore::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf(), BigNumber::ModExp(), N, s, and SHA1Interleave().
|
private |
Referenced by VerifyChallengeResponse().
|
staticprivate |
Referenced by CalculateVerifier().
|
private |
Referenced by VerifyChallengeResponse().
|
staticprivate |
Referenced by CalculateVerifier(), and VerifyChallengeResponse().
|
private |
Referenced by VerifyChallengeResponse().
|
private |
Referenced by VerifyChallengeResponse().
EphemeralKey const Acore::Crypto::SRP6::B |
Referenced by VerifyChallengeResponse().
|
staticconstexpr |
Referenced by SHA1Interleave().
|
static |
Referenced by VerifyChallengeResponse().
|
static |
Referenced by VerifyChallengeResponse().
Salt const Acore::Crypto::SRP6::s |
Referenced by VerifyChallengeResponse().
|
staticconstexpr |
Referenced by RASession::CheckPassword(), AccountMgr::CheckPassword(), and AuthSession::LogonChallengeCallback().
|
staticconstexpr |
Referenced by RASession::CheckPassword(), AccountMgr::CheckPassword(), and AuthSession::LogonChallengeCallback().