From 41e228be3c4a75fd0a2fe84fe3b64083bd633782 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Thu, 22 Feb 2024 16:45:38 -0500 Subject: [PATCH] Fixes creating new account. --- Source/Framework/Cryptography/SRP6.cs | 2 +- Source/Game/Accounts/BNetAccountManager.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Framework/Cryptography/SRP6.cs b/Source/Framework/Cryptography/SRP6.cs index 2e4b70c07..5903f2727 100644 --- a/Source/Framework/Cryptography/SRP6.cs +++ b/Source/Framework/Cryptography/SRP6.cs @@ -330,7 +330,7 @@ namespace Framework.Cryptography { byte[] fix = new byte[65]; fix[64] = 1; - x -= new BigInteger(fix); + x -= new BigInteger(fix, true); } return x % (N - 1); diff --git a/Source/Game/Accounts/BNetAccountManager.cs b/Source/Game/Accounts/BNetAccountManager.cs index 9f2b0004e..a568f2021 100644 --- a/Source/Game/Accounts/BNetAccountManager.cs +++ b/Source/Game/Accounts/BNetAccountManager.cs @@ -45,7 +45,7 @@ namespace Game if (withGameAccount) { gameAccountName = newAccountId + "#1"; - string gameAccountPassword = password.Substring(0, 16); + string gameAccountPassword = password.Substring(0, Math.Min(16, password.Length)); Global.AccountMgr.CreateAccount(gameAccountName, gameAccountPassword.ToUpper(), email, newAccountId, 1); }