diff --git a/Pages/Account.cshtml.cs b/Pages/Account.cshtml.cs index 80ce73e..1e33e6c 100644 --- a/Pages/Account.cshtml.cs +++ b/Pages/Account.cshtml.cs @@ -1,9 +1,7 @@ using System; -using System.Text; using System.Linq; using System.Collections.Generic; using MySql.Data.MySqlClient; -using System.Security.Cryptography; using Microsoft.AspNetCore.Mvc.RazorPages; using Microsoft.Extensions.Logging; @@ -19,7 +17,6 @@ namespace NightmareCoreWeb2.Pages public bool IsGM { get; set; } public bool IsAuthenticated = false; public Account UserAccount { get; set; } - public List OnlineCharacters = new List(); public List Tickets = new List(); @@ -28,8 +25,6 @@ namespace NightmareCoreWeb2.Pages private MySqlConnection conn; public AccountModel(ILogger logger) { - - conn = new MySqlConnection(Program.connStr); _logger = logger; } @@ -47,6 +42,7 @@ namespace NightmareCoreWeb2.Pages c.AtLogin |= (Character.AtLoginOptions)action; } c.SetAtLogin(); + Response.Redirect("/Account"); } public void OnGet() @@ -98,8 +94,6 @@ namespace NightmareCoreWeb2.Pages this.UserAccount = a; } - - public void OnPostLogin() { UserEmail = Request.Form["UserEmail"]; diff --git a/SRP6.cs b/SRP6.cs index 30a05b4..bff6281 100644 --- a/SRP6.cs +++ b/SRP6.cs @@ -44,13 +44,6 @@ namespace Framework.Cryptography var salt = new byte[0].GenerateRandomKey(32); // random salt return (salt, CalculateVerifier(username, password, salt)); } - - [Obsolete] - public static (byte[] Salt, byte[] Verifier) MakeRegistrationDataFromHash(byte[] hash) - { - var salt = new byte[0].GenerateRandomKey(32); // random salt - return (salt, CalculateVerifierFromHash(hash, salt)); - } public static byte[] CalculateVerifier(string username, string password, byte[] salt) { @@ -64,14 +57,5 @@ namespace Framework.Cryptography // v = BigInteger.ModPow(gBN, x, BN); return BigInteger.ModPow(_g, new BigInteger(_sha1.ComputeHash(salt.Combine(hash)), true), _N).ToByteArray(); } - public static BigInteger CalculateBigIntVerifier(string username, string password, byte[] salt) { - byte[] hash = _sha1.ComputeHash(Encoding.UTF8.GetBytes(username.ToUpperInvariant() + ":" + password.ToUpperInvariant())); - return BigInteger.ModPow(_g, new BigInteger(_sha1.ComputeHash(salt.Combine(hash)), true), _N); - } - - public static bool CheckLogin(string username, string password, byte[] salt, byte[] verifier) - { - return verifier.Compare(CalculateVerifier(username, password, salt)); - } } } \ No newline at end of file