Skip to content

Commit 3ac2472

Browse files
committed
Fixed key exchange signature issue
1 parent 74fbd2a commit 3ac2472

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MLAPI/NetworkingManagerComponents/Core/InternalMessageHandler.Receive.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ internal static void HandleHailRequest(uint clientId, Stream stream, int channel
4444
// Read the ECDH
4545
// Allocation justification: This runs on client and only once, at initial connection
4646
serverDiffieHellmanPublicPart = reader.ReadByteArray();
47+
48+
// Verify the key exchange
4749
if (netManager.NetworkConfig.SignKeyExchange)
4850
{
4951
byte[] serverDiffieHellmanPublicPartSignature = reader.ReadByteArray();
@@ -85,7 +87,7 @@ internal static void HandleHailRequest(uint clientId, Stream stream, int channel
8587
{
8688
using (SHA256CryptoServiceProvider sha = new SHA256CryptoServiceProvider())
8789
{
88-
writer.WriteByteArray(rsa.Encrypt(sha.ComputeHash(certificate.GetPublicKey()), false));
90+
writer.WriteByteArray(rsa.Encrypt(sha.ComputeHash(diffieHellmanPublicKey), false));
8991
}
9092
}
9193
else

0 commit comments

Comments
 (0)