mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-02 08:42:45 +03:00
feat(net): implement all of GruntLogin::NextSecurityState
This commit is contained in:
parent
8e1df61749
commit
cb986335f6
@ -137,6 +137,12 @@ void GruntLogin::Logon(const char* loginServer, const char* loginPortal) {
|
|||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
this->m_pinEnabled = false;
|
||||||
|
this->m_matrixEnabled = false;
|
||||||
|
this->m_tokenEnabled = false;
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
|
||||||
this->m_loginResponse->UpdateLoginStatus(
|
this->m_loginResponse->UpdateLoginStatus(
|
||||||
LOGIN_STATE_CONNECTING,
|
LOGIN_STATE_CONNECTING,
|
||||||
LOGIN_OK,
|
LOGIN_OK,
|
||||||
@ -274,8 +280,25 @@ void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, ui
|
|||||||
}
|
}
|
||||||
|
|
||||||
LOGIN_STATE GruntLogin::NextSecurityState(LOGIN_STATE state) {
|
LOGIN_STATE GruntLogin::NextSecurityState(LOGIN_STATE state) {
|
||||||
// TODO
|
switch (state) {
|
||||||
|
case LOGIN_STATE_FIRST_SECURITY:
|
||||||
|
if (this->m_pinEnabled) {
|
||||||
|
return LOGIN_STATE_PIN;
|
||||||
|
}
|
||||||
|
|
||||||
|
case LOGIN_STATE_PIN:
|
||||||
|
if (this->m_matrixEnabled) {
|
||||||
|
return LOGIN_STATE_MATRIX;
|
||||||
|
}
|
||||||
|
|
||||||
|
case LOGIN_STATE_MATRIX:
|
||||||
|
if (this->m_tokenEnabled) {
|
||||||
|
return LOGIN_STATE_TOKEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
default:
|
||||||
return LOGIN_STATE_CHECKINGVERSIONS;
|
return LOGIN_STATE_CHECKINGVERSIONS;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GruntLogin::ProveVersion(const uint8_t* versionChecksum) {
|
void GruntLogin::ProveVersion(const uint8_t* versionChecksum) {
|
||||||
|
|||||||
@ -9,6 +9,10 @@ class GruntLogin : public Login {
|
|||||||
public:
|
public:
|
||||||
// Member variables
|
// Member variables
|
||||||
uint8_t m_versionChallenge[LOGIN_VERSION_CHALLENGE_LEN];
|
uint8_t m_versionChallenge[LOGIN_VERSION_CHALLENGE_LEN];
|
||||||
|
uint8_t m_pinEnabled;
|
||||||
|
uint8_t m_matrixEnabled;
|
||||||
|
uint8_t m_tokenEnabled;
|
||||||
|
uint8_t m_tokenRequired;
|
||||||
Grunt::ClientLink* m_clientLink = nullptr;
|
Grunt::ClientLink* m_clientLink = nullptr;
|
||||||
|
|
||||||
// Virtual member functions
|
// Virtual member functions
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user