mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 03:32:57 +00:00
Hash Change
This commit is contained in:
parent
4b1eb054a3
commit
f998879e20
@ -1036,23 +1036,19 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
||||
if (pw != null)
|
||||
{
|
||||
var hashFunc = SHA256.Create();
|
||||
//var hash = hashFunc.ComputeHash(BinaryList.ToBytes(pw, remoteNonce, localNonce));
|
||||
var hash = hashFunc.ComputeHash((new BinaryList())
|
||||
.AddUInt8Array(pw)
|
||||
.AddUInt8Array(remoteNonce)
|
||||
.AddUInt8Array(pw)
|
||||
.AddUInt8Array(localNonce)
|
||||
.ToArray());
|
||||
|
||||
if (hash.SequenceEqual(remoteHash))
|
||||
{
|
||||
// send our hash
|
||||
//var localHash = hashFunc.ComputeHash(BinaryList.ToBytes(localNonce, remoteNonce, pw));
|
||||
//SendParams((byte)0, localHash);
|
||||
|
||||
var localHash = hashFunc.ComputeHash((new BinaryList())
|
||||
.AddUInt8Array(localNonce)
|
||||
.AddUInt8Array(remoteNonce)
|
||||
.AddUInt8Array(pw)
|
||||
.AddUInt8Array(remoteNonce)
|
||||
.ToArray());
|
||||
|
||||
SendParams()
|
||||
@ -1163,10 +1159,10 @@ public partial class DistributedConnection : NetworkConnection, IStore
|
||||
|
||||
// send our hash
|
||||
var hashFunc = SHA256.Create();
|
||||
//var localHash = hashFunc.ComputeHash(BinaryList.ToBytes(localPassword, localNonce, remoteNonce));
|
||||
// local nonce + password or token + remote nonce
|
||||
var localHash = hashFunc.ComputeHash(new BinaryList()
|
||||
.AddUInt8Array(localPasswordOrToken)
|
||||
.AddUInt8Array(localNonce)
|
||||
.AddUInt8Array(localPasswordOrToken)
|
||||
.AddUInt8Array(remoteNonce)
|
||||
.ToArray());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user