![]() |
TrinityCore
|
#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 size_t | SALT_LENGTH = 32 |
| static constexpr size_t | VERIFIER_LENGTH = 32 |
| static constexpr 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 Trinity::Crypto::SRP6::EphemeralKey = std::array<uint8, EPHEMERAL_KEY_LENGTH> |
| using Trinity::Crypto::SRP6::Salt = std::array<uint8, SALT_LENGTH> |
| using Trinity::Crypto::SRP6::Verifier = std::array<uint8, VERIFIER_LENGTH> |
|
inlinestaticprivate |
Definition at line 70 of file SRP6.h.
References BigNumber::ModExp().
|
staticprivate |
Definition at line 40 of file SRP6.cpp.
References _g, _N, Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf(), BigNumber::ModExp(), and BigNumber::ToByteArray().
Referenced by MakeRegistrationData().
|
inlinestatic |
Definition at line 47 of file SRP6.h.
Referenced by RASession::CheckPassword(), and AccountMgr::CheckPassword().
|
inlinestatic |
Definition at line 52 of file SRP6.h.
References Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf().
Referenced by AuthSession::HandleLogonProof().
|
static |
Definition at line 32 of file SRP6.cpp.
References CalculateVerifier(), and Trinity::Crypto::GetRandomBytes().
Referenced by AccountMgr::ChangePassword(), AccountMgr::ChangeUsername(), and AccountMgr::CreateAccount().
|
staticprivate |
Definition at line 51 of file SRP6.cpp.
References Trinity::Impl::GenericHash< HashCreator, DigestLength >::DIGEST_LENGTH, EPHEMERAL_KEY_LENGTH, and Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf().
Referenced by VerifyChallengeResponse().
| std::optional< SessionKey > SRP6::VerifyChallengeResponse | ( | EphemeralKey const & | A, |
| SHA1::Digest const & | clientM | ||
| ) |
Definition at line 84 of file SRP6.cpp.
References _b, _I, _N, _used, _v, ASSERT, B, g, Trinity::Impl::GenericHash< HashCreator, DigestLength >::GetDigestOf(), BigNumber::ModExp(), N, s, and SHA1Interleave().
|
private |
Definition at line 74 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
staticprivate |
Definition at line 67 of file SRP6.h.
Referenced by CalculateVerifier().
|
private |
Definition at line 73 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
staticprivate |
Definition at line 68 of file SRP6.h.
Referenced by CalculateVerifier(), and VerifyChallengeResponse().
|
private |
Definition at line 61 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
private |
Definition at line 75 of file SRP6.h.
Referenced by VerifyChallengeResponse().
| EphemeralKey const Trinity::Crypto::SRP6::B |
Definition at line 79 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
staticconstexpr |
Definition at line 38 of file SRP6.h.
Referenced by SHA1Interleave().
|
static |
Definition at line 41 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
static |
Definition at line 42 of file SRP6.h.
Referenced by VerifyChallengeResponse().
| Salt const Trinity::Crypto::SRP6::s |
Definition at line 78 of file SRP6.h.
Referenced by VerifyChallengeResponse().
|
staticconstexpr |
Definition at line 34 of file SRP6.h.
Referenced by RASession::CheckPassword(), AccountMgr::CheckPassword(), and AuthSession::LogonChallengeCallback().
|
staticconstexpr |
Definition at line 36 of file SRP6.h.
Referenced by RASession::CheckPassword(), AccountMgr::CheckPassword(), and AuthSession::LogonChallengeCallback().