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
- var VisionOSEDRHeadromm has a comma instead of a dot when building with Metal Rendering App Mode and local OS localization is set to German
- IAP Catalog remove product “x” and add product “+” buttons are not consistent with other remove and add buttons in the Editor
- Performance issues in Play Mode when quickly hovering the mouse cursor over Hierarchy GameObjects
- Frame Debugger displays incorrect output when FidelityFX Super Resolution or Spatial-Temporal Upscaler is used with Temporal Anti-aliasing or Subpixel Morphological Anti-aliasing
- Crash with “Fatal Error! The file ‘MemoryStream’ is corrupted!” when adding a large number in Font Character Rects Size field
Add comment