Hash password at server side
This commit is contained in:
@ -91,7 +91,7 @@ namespace RageCoop.Client
|
||||
PedID = Main.LocalPlayerID,
|
||||
Username =username,
|
||||
ModVersion = Main.CurrentVersion,
|
||||
PassHashEncrypted=Security.Encrypt(password.GetSHA256Hash())
|
||||
PasswordEncrypted=Security.Encrypt(password.GetBytes())
|
||||
};
|
||||
|
||||
Security.GetSymmetricKeysCrypted(out handshake.AesKeyCrypted, out handshake.AesIVCrypted);
|
||||
|
@ -29,7 +29,7 @@ namespace RageCoop.Core
|
||||
/// <summary>
|
||||
/// The password hash with client Aes
|
||||
/// </summary>
|
||||
public byte[] PassHashEncrypted { get; set; }
|
||||
public byte[] PasswordEncrypted { get; set; }
|
||||
|
||||
public override void Pack(NetOutgoingMessage message)
|
||||
{
|
||||
@ -59,7 +59,7 @@ namespace RageCoop.Core
|
||||
|
||||
|
||||
// Write PassHash
|
||||
byteArray.AddArray(PassHashEncrypted);
|
||||
byteArray.AddArray(PasswordEncrypted);
|
||||
|
||||
byte[] result = byteArray.ToArray();
|
||||
|
||||
@ -87,7 +87,7 @@ namespace RageCoop.Core
|
||||
AesIVCrypted=reader.ReadByteArray();
|
||||
|
||||
|
||||
PassHashEncrypted=reader.ReadByteArray();
|
||||
PasswordEncrypted=reader.ReadByteArray();
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -562,7 +562,7 @@ namespace RageCoop.Server
|
||||
try
|
||||
{
|
||||
Security.AddConnection(connection.RemoteEndPoint, packet.AesKeyCrypted,packet.AesIVCrypted);
|
||||
passhash=Security.Decrypt(packet.PassHashEncrypted, connection.RemoteEndPoint).ToHexString();
|
||||
passhash=Security.Decrypt(packet.PasswordEncrypted, connection.RemoteEndPoint).GetString().GetSHA256Hash().ToHexString();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user