1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-17 15:46:33 +09:00

Fix workaround for the Unity Web Player.

It pass the unit tests.
This fix can have the problem described here:

- http://stackoverflow.com/questions/957388/why-are-rijndaelmanaged-and-aescryptoserviceprovider-returning-different-results/4863924#4863924
This commit is contained in:
Andrés Leone
2015-03-22 03:48:13 +01:00
parent 5df02daefd
commit f2e70ecd5d

View File

@@ -7,18 +7,30 @@ namespace Lidgren.Network
public class NetAESEncryption : NetCryptoProviderBase public class NetAESEncryption : NetCryptoProviderBase
{ {
public NetAESEncryption(NetPeer peer) public NetAESEncryption(NetPeer peer)
#if UNITY_WEBPLAYER
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider()) : base(peer, new AesCryptoServiceProvider())
#endif
{ {
} }
public NetAESEncryption(NetPeer peer, string key) public NetAESEncryption(NetPeer peer, string key)
#if UNITY_WEBPLAYER
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider()) : base(peer, new AesCryptoServiceProvider())
#endif
{ {
SetKey(key); SetKey(key);
} }
public NetAESEncryption(NetPeer peer, byte[] data, int offset, int count) public NetAESEncryption(NetPeer peer, byte[] data, int offset, int count)
#if UNITY_WEBPLAYER
: base(peer, new RijndaelManaged())
#else
: base(peer, new AesCryptoServiceProvider()) : base(peer, new AesCryptoServiceProvider())
#endif
{ {
SetKey(data, offset, count); SetKey(data, offset, count);
} }