diff options
author | Treeston <treeston.mmoc@gmail.com> | 2020-08-06 00:20:23 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2022-01-26 16:21:43 +0100 |
commit | 7603dacc6431598ce5e770907bf9f53c51a29014 (patch) | |
tree | 57e562cd929975a2e2118f452000c7677342b6d0 /src/server/bnetserver/Server/SessionManager.cpp | |
parent | 4a6db9fb592648d8d7e5b3c602e82afd039f9849 (diff) |
Core/Authserver: Deprecation of sha_pass_hash (PR #25138)
see also #25157
(cherry picked from commit 44a3aad0af4bdd132b8761761dc83df2d7d6c601)
Diffstat (limited to 'src/server/bnetserver/Server/SessionManager.cpp')
-rw-r--r-- | src/server/bnetserver/Server/SessionManager.cpp | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/server/bnetserver/Server/SessionManager.cpp b/src/server/bnetserver/Server/SessionManager.cpp index e503bba4219..9b074d3bcad 100644 --- a/src/server/bnetserver/Server/SessionManager.cpp +++ b/src/server/bnetserver/Server/SessionManager.cpp @@ -16,6 +16,7 @@ */ #include "SessionManager.h" +#include "Config.h" #include "DatabaseEnv.h" #include "SRP6.h" #include "Util.h" @@ -43,6 +44,7 @@ void Battlenet::SessionManager::FixLegacyAuthHashes() return; } + bool const shouldUpdate = sConfigMgr->GetBoolDefault("AllowDeprecatedExternalPasswords", false, true); bool hadWarning = false; uint32 c = 0; LoginDatabaseTransaction tx = LoginDatabase.BeginTransaction(); @@ -53,10 +55,37 @@ void Battlenet::SessionManager::FixLegacyAuthHashes() HexStrToByteArray<Trinity::Crypto::SHA1::DIGEST_LENGTH>((*result)[1].GetString()) ); - if ((*result)[2].GetInt64() && !hadWarning) + if ((*result)[2].GetInt64()) { - hadWarning = true; - TC_LOG_WARN("server.bnetserver", "(!) You appear to be using an outdated external account management tool.\n(!!) This is INSECURE, has been deprecated, and will cease to function entirely in the near future.\n(!) Update your external tool.\n(!!) If no update is available, refer your tool's developer to https://github.com/TrinityCore/TrinityCore/issues/25157."); + if (!hadWarning) + { + hadWarning = true; + if (shouldUpdate) + { + TC_LOG_WARN("server.bnetserver", + " ========\n" + "(!) You appear to be using an outdated external account management tool.\n" + "(!!) This is INSECURE, has been deprecated, and will cease to function entirely on September 6, 2020.\n" + "(!) Update your external tool.\n" + "(!!) If no update is available, refer your tool's developer to https://github.com/TrinityCore/TrinityCore/issues/25157.\n" + " ========"); + } + else + { + TC_LOG_ERROR("server.bnetserver", + " ========\n" + "(!) You appear to be using an outdated external account management tool.\n" + "(!!) This is INSECURE, and the account(s) in question will not be able to log in.\n" + "(!) Update your external tool.\n" + "(!!) If no update is available, refer your tool's developer to https://github.com/TrinityCore/TrinityCore/issues/25157.\n" + "(!) You can override this behavior by adding \"AllowDeprecatedExternalPasswords = 1\" to your authserver.conf file.\n" + "(!!) Note that this override will cease to function entirely on September 6, 2020.\n" + " ========"); + } + } + + if (!shouldUpdate) + continue; } LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_UPD_LOGON); |