mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02: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
|
||||
|
||||
this->m_pinEnabled = false;
|
||||
this->m_matrixEnabled = false;
|
||||
this->m_tokenEnabled = false;
|
||||
|
||||
// TODO
|
||||
|
||||
this->m_loginResponse->UpdateLoginStatus(
|
||||
LOGIN_STATE_CONNECTING,
|
||||
LOGIN_OK,
|
||||
@ -274,8 +280,25 @@ void GruntLogin::LogonResult(Grunt::Result result, const uint8_t* sessionKey, ui
|
||||
}
|
||||
|
||||
LOGIN_STATE GruntLogin::NextSecurityState(LOGIN_STATE state) {
|
||||
// TODO
|
||||
return LOGIN_STATE_CHECKINGVERSIONS;
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
void GruntLogin::ProveVersion(const uint8_t* versionChecksum) {
|
||||
|
||||
@ -9,6 +9,10 @@ class GruntLogin : public Login {
|
||||
public:
|
||||
// Member variables
|
||||
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;
|
||||
|
||||
// Virtual member functions
|
||||
|
||||
Loading…
Reference in New Issue
Block a user