Fixed signature issue & allocation size

This commit is contained in:
Albin Corén 2018-04-02 17:19:08 +02:00
parent fd18634d32
commit 6ad088e46e
2 changed files with 2 additions and 6 deletions

View File

@ -119,10 +119,6 @@ namespace MLAPI.Data
/// Wheter or not to enable scene switching /// Wheter or not to enable scene switching
/// </summary> /// </summary>
public bool EnableSceneSwitching = false; public bool EnableSceneSwitching = false;
/// <summary>
/// The RSA Keysize to use
/// </summary>
public int RSAKeySize = 2048;
private byte[] ConfigHash = null; private byte[] ConfigHash = null;
/// <summary> /// <summary>

View File

@ -1530,7 +1530,7 @@ namespace MLAPI.MonoBehaviours.Core
{ {
rsa.PersistKeyInCsp = false; rsa.PersistKeyInCsp = false;
rsa.FromXmlString(NetworkConfig.RSAPrivateKey); rsa.FromXmlString(NetworkConfig.RSAPrivateKey);
publicKeySignature = rsa.SignData(publicKeySignature, new SHA512CryptoServiceProvider()); publicKeySignature = rsa.SignData(publicKey, new SHA512CryptoServiceProvider());
} }
} }
} }
@ -1555,7 +1555,7 @@ namespace MLAPI.MonoBehaviours.Core
if (NetworkConfig.HandleObjectSpawning) if (NetworkConfig.HandleObjectSpawning)
{ {
sizeOfStream += 4; sizeOfStream += 4;
sizeOfStream += 14 * amountOfObjectsToSend; sizeOfStream += 38 * amountOfObjectsToSend;
} }
if (NetworkConfig.EnableEncryption) if (NetworkConfig.EnableEncryption)