Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
SkyFire::Crypto::SRP6 Class Reference

#include <SRP6.h>

Collaboration diagram for SkyFire::Crypto::SRP6:

Public Types

using EphemeralKey = std::array<uint8, EPHEMERAL_KEY_LENGTH>
using Salt = std::array<uint8, SALT_LENGTH>
using Verifier = std::array<uint8, VERIFIER_LENGTH>

Public Member Functions

 SRP6 (std::string const &username, Salt const &salt, Verifier const &verifier)
std::optional< SessionKeyVerifyChallengeResponse (EphemeralKey const &A, SHA1::Digest const &clientM)

Static Public Member Functions

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)
static std::pair< Salt, VerifierMakeRegistrationData (std::string const &username, std::string const &password)

Public Attributes

EphemeralKey const B
Salt const s

Static Public Attributes

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 constexpr size_t SALT_LENGTH = 32
static constexpr size_t VERIFIER_LENGTH = 32

Static Private Member Functions

static EphemeralKey _B (BigNumber const &b, BigNumber const &v)
static Verifier CalculateVerifier (std::string const &username, std::string const &password, Salt const &salt)
static SessionKey SHA1Interleave (EphemeralKey const &S)

Private Attributes

BigNumber const _b
SHA1::Digest const _I
bool _used = false
BigNumber const _v

Static Private Attributes

static BigNumber const _g
static BigNumber const _N

Detailed Description

Definition at line 14 of file SRP6.h.

Member Typedef Documentation

◆ EphemeralKey

Definition at line 22 of file SRP6.h.

◆ Salt

Definition at line 18 of file SRP6.h.

◆ Verifier

Definition at line 20 of file SRP6.h.

Constructor & Destructor Documentation

◆ SRP6()

SRP6::SRP6 ( std::string const & username,
Salt const & salt,
Verifier const & verifier )

Definition at line 64 of file SRP6.cpp.

References _B(), _b, _I, _v, B, SkyFire::Crypto::GetRandomBytes(), and s.

Member Function Documentation

◆ _B()

EphemeralKey SkyFire::Crypto::SRP6::_B ( BigNumber const & b,
BigNumber const & v )
inlinestaticprivate

Definition at line 53 of file SRP6.h.

References _g, _N, EPHEMERAL_KEY_LENGTH, and N.

Referenced by SRP6().

◆ CalculateVerifier()

SRP6::Verifier SRP6::CalculateVerifier ( std::string const & username,
std::string const & password,
SRP6::Salt const & salt )
staticprivate

◆ CheckLogin()

bool SkyFire::Crypto::SRP6::CheckLogin ( std::string const & username,
std::string const & password,
Salt const & salt,
Verifier const & verifier )
inlinestatic

Definition at line 30 of file SRP6.h.

References CalculateVerifier().

Referenced by RASocket::check_password(), and AccountMgr::CheckPassword().

◆ GetSessionVerifier()

SHA1::Digest SkyFire::Crypto::SRP6::GetSessionVerifier ( EphemeralKey const & A,
SHA1::Digest const & clientM,
SessionKey const & K )
inlinestatic

◆ MakeRegistrationData()

std::pair< SRP6::Salt, SRP6::Verifier > SRP6::MakeRegistrationData ( std::string const & username,
std::string const & password )
static

◆ SHA1Interleave()

◆ VerifyChallengeResponse()

std::optional< SessionKey > SRP6::VerifyChallengeResponse ( EphemeralKey const & A,
SHA1::Digest const & clientM )

Member Data Documentation

◆ _b

BigNumber const SkyFire::Crypto::SRP6::_b
private

Definition at line 57 of file SRP6.h.

Referenced by SRP6(), and VerifyChallengeResponse().

◆ _g

BigNumber const SRP6::_g
staticprivate

Definition at line 50 of file SRP6.h.

Referenced by _B(), and CalculateVerifier().

◆ _I

SHA1::Digest const SkyFire::Crypto::SRP6::_I
private

Definition at line 56 of file SRP6.h.

Referenced by SRP6(), and VerifyChallengeResponse().

◆ _N

BigNumber const SRP6::_N
staticprivate

Definition at line 51 of file SRP6.h.

Referenced by _B(), CalculateVerifier(), and VerifyChallengeResponse().

◆ _used

bool SkyFire::Crypto::SRP6::_used = false
private

Definition at line 44 of file SRP6.h.

Referenced by VerifyChallengeResponse().

◆ _v

BigNumber const SkyFire::Crypto::SRP6::_v
private

Definition at line 58 of file SRP6.h.

Referenced by SRP6(), and VerifyChallengeResponse().

◆ B

EphemeralKey const SkyFire::Crypto::SRP6::B

Definition at line 62 of file SRP6.h.

Referenced by SRP6(), and VerifyChallengeResponse().

◆ EPHEMERAL_KEY_LENGTH

size_t SkyFire::Crypto::SRP6::EPHEMERAL_KEY_LENGTH = 32
staticconstexpr

Definition at line 21 of file SRP6.h.

Referenced by _B(), and SHA1Interleave().

◆ g

std::array< uint8, 1 > const SRP6::g = { 7 }
static

Definition at line 24 of file SRP6.h.

Referenced by VerifyChallengeResponse().

◆ N

std::array< uint8, 32 > const SRP6::N = HexStrToByteArray<32>("894B645E89E1535BBDAD5B8B290650530801B18EBFBF5E8FAB3C82872A3E9BB7", true)
static

Definition at line 25 of file SRP6.h.

Referenced by _B(), and VerifyChallengeResponse().

◆ s

Salt const SkyFire::Crypto::SRP6::s

Definition at line 61 of file SRP6.h.

Referenced by SRP6(), and VerifyChallengeResponse().

◆ SALT_LENGTH

size_t SkyFire::Crypto::SRP6::SALT_LENGTH = 32
staticconstexpr

Definition at line 17 of file SRP6.h.

Referenced by RASocket::check_password(), and AccountMgr::CheckPassword().

◆ VERIFIER_LENGTH

size_t SkyFire::Crypto::SRP6::VERIFIER_LENGTH = 32
staticconstexpr

Definition at line 19 of file SRP6.h.

Referenced by RASocket::check_password(), and AccountMgr::CheckPassword().


The documentation for this class was generated from the following files:
  • src/server/shared/Cryptography/Authentication/SRP6.h
  • src/server/shared/Cryptography/Authentication/SRP6.cpp