|
Project SkyFire Core
SkyFire 5.4.8 server core API documentation
|
#include <AuthSocket.h>
Public Member Functions | |
| bool | _HandleLogonChallenge () |
| bool | _HandleLogonProof () |
| bool | _HandleRealmList () |
| bool | _HandleReconnectChallenge () |
| bool | _HandleReconnectProof () |
| bool | _HandleXferAccept () |
| bool | _HandleXferCancel () |
| bool | _HandleXferResume () |
| AuthSocket (RealmSocket &socket) | |
| virtual void | OnAccept (void) |
| virtual void | OnClose (void) |
| virtual void | OnRead (void) |
| virtual | ~AuthSocket (void) |
| Public Member Functions inherited from RealmSocket::Session | |
| Session (void) | |
| virtual | ~Session (void) |
Static Public Member Functions | |
| static Skyfire::Net::Address const & | GetAddressForClient (Realm const &realm, Skyfire::Net::Address const &clientAddr) |
Static Public Attributes | |
| static const int | s_BYTE_SIZE = 32 |
Private Member Functions | |
| RealmSocket & | socket (void) |
Private Attributes | |
| AccountTypes | _accountSecurityLevel |
| bool | _authed |
| uint16 | _build |
| uint8 | _expversion |
| std::string | _localizationName |
| std::string | _login |
| std::string | _os |
| std::array< uint8, 16 > | _reconnectProof = {} |
| SessionKey | _sessionKey = {} |
| std::optional< SkyFire::Crypto::SRP6 > | _srp6 |
| std::string | _tokenKey |
| RealmSocket & | socket_ |
Definition at line 18 of file AuthSocket.h.
| AuthSocket::AuthSocket | ( | RealmSocket & | socket | ) |
Definition at line 169 of file AuthSocket.cpp.
References _accountSecurityLevel, _authed, _build, _expversion, socket(), and socket_.
|
virtual |
Definition at line 176 of file AuthSocket.cpp.
| bool AuthSocket::_HandleLogonChallenge | ( | ) |
Definition at line 245 of file AuthSocket.cpp.
References _accountSecurityLevel, _build, _expversion, _localizationName, _login, _os, _srp6, _tokenKey, ByteBuffer::append(), AUTH_LOGON_CHALLENGE, AUTH_LOGON_CHALLENGE_C::build, ByteBuffer::contents(), AUTH_LOGON_CHALLENGE_C::country, EndianConvert(), EndianConvertPtr(), EndianConvertReverse(), AUTH_LOGON_CHALLENGE_C::gamename, Field::GetCString(), GetLocaleByName(), RealmSocket::getRemoteAddress(), Field::GetString(), AUTH_LOGON_CHALLENGE_C::I, AUTH_LOGON_CHALLENGE_C::I_len, AUTH_LOGON_CHALLENGE_C::ip, AuthHelper::IsAcceptedClientBuild(), AuthHelper::IsPostBCAcceptedClientBuild(), AuthHelper::IsPreBCAcceptedClientBuild(), LOGIN_DEL_EXPIRED_IP_BANS, LOGIN_SEL_ACCOUNT_BANNED, LOGIN_SEL_IP_BANNED, LOGIN_SEL_LOGON_COUNTRY, LOGIN_SEL_LOGONCHALLENGE, LOGIN_UPD_EXPIRED_ACCOUNT_BANS, LoginDatabase, NO_VALID_EXP_FLAG, AUTH_LOGON_CHALLENGE_C::os, AUTH_LOGON_CHALLENGE_C::platform, POST_BC_EXP_FLAG, PRE_BC_EXP_FLAG, RealmSocket::QueueSend(), SEC_ADMINISTRATOR, RealmSocket::SetPacketLogAccountName(), BigNumber::SetRand(), PreparedStatement::setString(), PreparedStatement::setUInt32(), SF_LOG_DEBUG, AUTH_LOGON_CHALLENGE_C::size, ByteBuffer::size(), socket(), AUTH_LOGON_CHALLENGE_C::timezone_bias, BigNumber::ToByteArray(), Skyfire::Net::ToIPv4NetworkOrder(), WOW_FAIL_BANNED, WOW_FAIL_LOCKED_ENFORCED, WOW_FAIL_SUSPENDED, WOW_FAIL_UNKNOWN_ACCOUNT, WOW_FAIL_UNLOCKABLE_LOCK, WOW_FAIL_VERSION_INVALID, and WOW_SUCCESS.
| bool AuthSocket::_HandleLogonProof | ( | ) |
Definition at line 465 of file AuthSocket.cpp.
References _authed, _expversion, _localizationName, _login, _os, _sessionKey, _srp6, _tokenKey, AUTH_LOGON_PROOF_C::A, AUTH_LOGON_PROOF, AUTH_LOGON_PROOF_C::clientM, RealmSocket::Close(), AUTH_LOGON_PROOF_S::cmd, AUTH_LOGON_PROOF_S_OLD::cmd, AUTH_LOGON_PROOF_S::error, AUTH_LOGON_PROOF_S_OLD::error, TOTP::GenerateToken(), GetLocaleByName(), SkyFire::Crypto::SRP6::GetSessionVerifier(), LOGIN_INS_ACCOUNT_AUTO_BANNED, LOGIN_INS_IP_AUTO_BANNED, LOGIN_SEL_FAILEDLOGINS, LOGIN_UPD_FAILEDLOGINS, LOGIN_UPD_LOGONPROOF, LoginDatabase, AUTH_LOGON_PROOF_S::M2, AUTH_LOGON_PROOF_S_OLD::M2, NO_VALID_EXP_FLAG, POST_BC_EXP_FLAG, RealmSocket::QueueSend(), sConfigMgr, AUTH_LOGON_PROOF_C::securityFlags, PreparedStatement::setBinary(), PreparedStatement::setString(), PreparedStatement::setUInt32(), SF_LOG_DEBUG, socket(), AUTH_LOGON_PROOF_S::unk1, AUTH_LOGON_PROOF_S::unk2, AUTH_LOGON_PROOF_S_OLD::unk2, AUTH_LOGON_PROOF_S::unk3, and WOW_FAIL_UNKNOWN_ACCOUNT.
| bool AuthSocket::_HandleRealmList | ( | ) |
Definition at line 757 of file AuthSocket.cpp.
References _accountSecurityLevel, _build, _expversion, _login, Realm::allowedSecurityLevel, ByteBuffer::append(), RealmBuildInfo::BugfixVersion, RealmBuildInfo::Build, RealmSocket::Close(), ByteBuffer::contents(), RealmSocket::DiscardBytes(), Realm::ExternalAddress, Realm::flag, Realm::gamebuild, GetAddressForClient(), GetAddressString(), AuthHelper::GetBuildInfo(), Skyfire::Net::Address::GetPort(), Field::GetUInt32(), Realm::icon, AuthHelper::IsPreBCAcceptedClientBuild(), LOGIN_SEL_ACCOUNT_ID_BY_NAME, LOGIN_SEL_NUM_CHARS_ON_REALM, LoginDatabase, Realm::m_ID, RealmBuildInfo::MajorVersion, RealmBuildInfo::MinorVersion, Realm::populationLevel, POST_BC_EXP_FLAG, PRE_BC_EXP_FLAG, RealmSocket::QueueSend(), REALM_FLAG_OFFLINE, REALM_FLAG_SPECIFYBUILD, REALM_LIST, Skyfire::Net::Address::SetPort(), PreparedStatement::setString(), PreparedStatement::setUInt32(), SF_LOG_DEBUG, SF_LOG_ERROR, ByteBuffer::size(), socket(), sRealmList, and Realm::timezone.
| bool AuthSocket::_HandleReconnectChallenge | ( | ) |
Definition at line 631 of file AuthSocket.cpp.
References _accountSecurityLevel, _build, _expversion, _login, _os, _reconnectProof, _sessionKey, ByteBuffer::append(), AUTH_RECONNECT_CHALLENGE, AUTH_LOGON_CHALLENGE_C::build, RealmSocket::Close(), ByteBuffer::contents(), Field::GetBinary(), SkyFire::Crypto::GetRandomBytes(), AUTH_LOGON_CHALLENGE_C::I, AUTH_LOGON_CHALLENGE_C::I_len, AuthHelper::IsPostBCAcceptedClientBuild(), AuthHelper::IsPreBCAcceptedClientBuild(), LOGIN_SEL_SESSIONKEY, LoginDatabase, NO_VALID_EXP_FLAG, AUTH_LOGON_CHALLENGE_C::os, POST_BC_EXP_FLAG, PRE_BC_EXP_FLAG, RealmSocket::QueueSend(), SEC_ADMINISTRATOR, SESSION_KEY_LENGTH, RealmSocket::SetPacketLogAccountName(), PreparedStatement::setString(), SF_LOG_DEBUG, SF_LOG_ERROR, AUTH_LOGON_CHALLENGE_C::size, ByteBuffer::size(), and socket().
| bool AuthSocket::_HandleReconnectProof | ( | ) |
Definition at line 693 of file AuthSocket.cpp.
References _authed, _login, _reconnectProof, _sessionKey, AUTH_RECONNECT_PROOF, RealmSocket::Close(), ByteBuffer::contents(), SkyFire::Impl::GenericHash< HashCreator, DigestLength >::Finalize(), SkyFire::Impl::GenericHash< HashCreator, DigestLength >::GetDigest(), RealmSocket::QueueSend(), AUTH_RECONNECT_PROOF_C::R1, AUTH_RECONNECT_PROOF_C::R2, BigNumber::SetBinary(), SF_LOG_DEBUG, SF_LOG_ERROR, ByteBuffer::size(), socket(), BigNumber::ToByteArray(), and SkyFire::Impl::GenericHash< HashCreator, DigestLength >::UpdateData().
| bool AuthSocket::_HandleXferAccept | ( | ) |
Definition at line 928 of file AuthSocket.cpp.
References Skyfire::Auth::Accept, RealmSocket::Close(), Skyfire::Auth::EvaluatePatchTransferRequest(), SF_LOG_DEBUG, SF_LOG_ERROR, socket(), and Skyfire::Auth::Unsupported.
| bool AuthSocket::_HandleXferCancel | ( | ) |
Definition at line 912 of file AuthSocket.cpp.
References Skyfire::Auth::Cancel, RealmSocket::Close(), RealmSocket::DiscardBytes(), Skyfire::Auth::EvaluatePatchTransferRequest(), SF_LOG_DEBUG, and socket().
| bool AuthSocket::_HandleXferResume | ( | ) |
Definition at line 891 of file AuthSocket.cpp.
References Skyfire::Auth::Cancel, RealmSocket::Close(), Skyfire::Auth::EvaluatePatchTransferRequest(), Skyfire::Auth::NeedResumeOffset, Skyfire::Auth::Resume, SF_LOG_DEBUG, SF_LOG_ERROR, socket(), and Skyfire::Auth::Unsupported.
|
static |
Definition at line 734 of file AuthSocket.cpp.
References Realm::ExternalAddress, IsIPAddrInNetwork(), Skyfire::Net::Address::IsLoopback(), Realm::LocalAddress, and Realm::LocalSubnetMask.
Referenced by _HandleRealmList().
|
virtual |
Implements RealmSocket::Session.
Definition at line 179 of file AuthSocket.cpp.
References SF_LOG_DEBUG, and socket().
|
virtual |
Implements RealmSocket::Session.
Definition at line 185 of file AuthSocket.cpp.
References SF_LOG_DEBUG.
|
virtual |
Implements RealmSocket::Session.
Definition at line 191 of file AuthSocket.cpp.
References _authed, AUTH_LOGON_CHALLENGE, AUTH_TOTAL_COMMANDS, RealmSocket::Close(), MAX_AUTH_LOGON_CHALLENGES_IN_A_ROW, SF_LOG_DEBUG, SF_LOG_ERROR, SF_LOG_WARN, socket(), STATUS_AUTHED, STATUS_CONNECTED, and table.
|
inlineprivate |
Definition at line 45 of file AuthSocket.h.
References socket_.
Referenced by _HandleLogonChallenge(), _HandleLogonProof(), _HandleRealmList(), _HandleReconnectChallenge(), _HandleReconnectProof(), _HandleXferAccept(), _HandleXferCancel(), _HandleXferResume(), AuthSocket(), OnAccept(), and OnRead().
|
private |
Definition at line 62 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), _HandleRealmList(), _HandleReconnectChallenge(), and AuthSocket().
|
private |
Definition at line 51 of file AuthSocket.h.
Referenced by _HandleLogonProof(), _HandleReconnectProof(), AuthSocket(), and OnRead().
|
private |
Definition at line 60 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), _HandleRealmList(), _HandleReconnectChallenge(), and AuthSocket().
|
private |
Definition at line 61 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), _HandleLogonProof(), _HandleRealmList(), _HandleReconnectChallenge(), and AuthSocket().
|
private |
Definition at line 58 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), and _HandleLogonProof().
|
private |
Definition at line 53 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), _HandleLogonProof(), _HandleRealmList(), _HandleReconnectChallenge(), and _HandleReconnectProof().
|
private |
Definition at line 59 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), _HandleLogonProof(), and _HandleReconnectChallenge().
|
private |
Definition at line 49 of file AuthSocket.h.
Referenced by _HandleReconnectChallenge(), and _HandleReconnectProof().
|
private |
Definition at line 48 of file AuthSocket.h.
Referenced by _HandleLogonProof(), _HandleReconnectChallenge(), and _HandleReconnectProof().
|
private |
Definition at line 47 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), and _HandleLogonProof().
|
private |
Definition at line 54 of file AuthSocket.h.
Referenced by _HandleLogonChallenge(), and _HandleLogonProof().
|
static |
Definition at line 21 of file AuthSocket.h.
|
private |
Definition at line 44 of file AuthSocket.h.
Referenced by AuthSocket(), and socket().