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
- PolySpatial “Trying to set shader on a Material Variant.” error is printed in the console when entering Play Mode
- Error “Shader error in 'YSCloudCover': call to 'tex3D' is ambiguous at Assets/YSCloudCoverText.shader(606) (on d3d11)“ is present when compiling tex3D shader with DXC
- Placeholder asset is not loaded with Advertisement Legacy sample when using the latest version of the package
- Addressables content build fails but the Player build is successful when building a development build
- Out-of-bounds memory access with multiple CanvasRenderers under a Canvas when using Mesh API
Add comment