Search Issue Tracker
Fixed in 5.0.1
Votes
4
Found in
5.0.0f4
Issue ID
677985
Regression
Yes
IL2CPP: RSACryptoServiceProvider doesn't work
-e: The RSACryptoServiceProvider class seems broken on the IL2CPP backend.
-repro:
--open attached project
--build&run TestScene for iOS with IL2CPP
--NOTICE exceptions being loggedin xcode (see below) and test not working
--work fine with Mono
-test:
public static void SimpleTest()
{
RSACryptoServiceProvider rsa = new RSACryptoServiceProvider(1024);
RSAParameters publicKey = rsa.ExportParameters(false);
string name = "SimpleTest";
byte[] unencrypted = Encoding.UTF8.GetBytes(name);
RSACryptoServiceProvider remoteRSA = new RSACryptoServiceProvider();
remoteRSA.ImportParameters(publicKey);
byte[] encrypted = remoteRSA.Encrypt(unencrypted, false);
byte[] decryptedPacket = rsa.Decrypt(encrypted, false);
name = Encoding.UTF8.GetString(decryptedPacket);
Debug.Log("Decrypted message = " + name);
}
-errors:
2015-03-06 12:24:05.470 dark[2126:1187099] -> registered mono modules 0x100f32d60
-> applicationDidFinishLaunching()
-> applicationDidBecomeActive()
Requesting Resolution: 2048x1536
Init: screen size 2048x1536
Initializing Metal device caps
Initialize engine version: 5.0.0f4 (5b98b70ebeb9)
CryptographicException: PKCS1 decoding error.
at System.Security.Cryptography.HashAlgorithm.ComputeHash (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0
at System.Security.Cryptography.RSAPKCS1KeyExchangeDeformatter.SetKey (System.Security.Cryptography.AsymmetricAlgorithm key) [0x00000] in <filename unknown>:0
at System.Globalization.GregorianCalendar.GetYear (DateTime time) [0x00000] in <filename unknown>:0
at System.Security.Cryptography.RSACryptoServiceProvider.Decrypt (System.Byte[] rgb, Boolean fOAEP) [0x00000] in <filename unknown>:0
at RSATest.SimplerTest () [0x00000] in <filename unknown>:0
at RSATest.Start () [0x00000] in <filename unknown>:0
at Replacements.MSCompatUnicodeTable.get_IsReady () [0x00000] in <filename unknown>:0
Replacements.MSCompatUnicodeTable:get_IsReady()
(Filename: currently not available on il2cpp Line: -1)
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Mono Windows Builds don't produce full log callstacks when generating logs
- AssetBundles fail to load when running in Built Players for Mobile Devices
- UI elements with text gets bigger and grey when Player window is moved to another screen with different resolution
- System name accepts multiline text but crops it on confirmation, duplicates input, and shrinks the field when empty
- UI element scale and position are wrong in project build when DRS is changed with HDR and Software Dynamic Resolution enabled
Add comment