mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Clean up some auth packet handling related code
This commit is contained in:
parent
00f71c3b9d
commit
a65f6f07f3
9 changed files with 52 additions and 98 deletions
|
@ -472,20 +472,14 @@ void RemoteClient::notifyEvent(ClientStateEvent event)
|
|||
{
|
||||
case CSE_AuthAccept:
|
||||
m_state = CS_AwaitingInit2;
|
||||
if (chosen_mech == AUTH_MECHANISM_SRP ||
|
||||
chosen_mech == AUTH_MECHANISM_LEGACY_PASSWORD)
|
||||
srp_verifier_delete((SRPVerifier *) auth_data);
|
||||
chosen_mech = AUTH_MECHANISM_NONE;
|
||||
resetChosenMech();
|
||||
break;
|
||||
case CSE_Disconnect:
|
||||
m_state = CS_Disconnecting;
|
||||
break;
|
||||
case CSE_SetDenied:
|
||||
m_state = CS_Denied;
|
||||
if (chosen_mech == AUTH_MECHANISM_SRP ||
|
||||
chosen_mech == AUTH_MECHANISM_LEGACY_PASSWORD)
|
||||
srp_verifier_delete((SRPVerifier *) auth_data);
|
||||
chosen_mech = AUTH_MECHANISM_NONE;
|
||||
resetChosenMech();
|
||||
break;
|
||||
default:
|
||||
myerror << "HelloSent: Invalid client state transition! " << event;
|
||||
|
@ -561,9 +555,7 @@ void RemoteClient::notifyEvent(ClientStateEvent event)
|
|||
break;
|
||||
case CSE_SudoSuccess:
|
||||
m_state = CS_SudoMode;
|
||||
if (chosen_mech == AUTH_MECHANISM_SRP)
|
||||
srp_verifier_delete((SRPVerifier *) auth_data);
|
||||
chosen_mech = AUTH_MECHANISM_NONE;
|
||||
resetChosenMech();
|
||||
break;
|
||||
/* Init GotInit2 SetDefinitionsSent SetMediaSent SetDenied */
|
||||
default:
|
||||
|
@ -598,7 +590,7 @@ void RemoteClient::notifyEvent(ClientStateEvent event)
|
|||
|
||||
void RemoteClient::resetChosenMech()
|
||||
{
|
||||
if (chosen_mech == AUTH_MECHANISM_SRP) {
|
||||
if (auth_data) {
|
||||
srp_verifier_delete((SRPVerifier *) auth_data);
|
||||
auth_data = nullptr;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue