1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix multiple password changes in one session

This commit is contained in:
savilli 2024-01-19 11:50:55 +01:00 committed by GitHub
parent a8cf10b0b5
commit 432988a4ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 23 additions and 15 deletions

View file

@ -19,6 +19,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <sstream>
#include "clientiface.h"
#include "debug.h"
#include "network/connection.h"
#include "network/serveropcodes.h"
#include "remoteplayer.h"
@ -31,6 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "server/player_sao.h"
#include "log.h"
#include "util/srp.h"
#include "util/string.h"
#include "face_position_cache.h"
static std::string string_sanitize_ascii(const std::string &s, u32 max_length)
@ -649,6 +651,14 @@ void RemoteClient::resetChosenMech()
chosen_mech = AUTH_MECHANISM_NONE;
}
void RemoteClient::setEncryptedPassword(const std::string& pwd)
{
FATAL_ERROR_IF(!str_starts_with(pwd, "#1#"), "must be srp");
enc_pwd = pwd;
// We just set SRP encrypted password, we accept only it now
allowed_auth_mechs = AUTH_MECHANISM_SRP;
}
void RemoteClient::setVersionInfo(u8 major, u8 minor, u8 patch, const std::string &full)
{
m_version_major = major;