Search Unity

[BUG] 4.6.3 il2cpp broke Crypto stuff?

Discussion in 'iOS and tvOS' started by pixelsplit, Feb 20, 2015.

  1. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    173
    Hi there,

    yesterday I downloaded the 4.6.3 release in order to test our game with the Metal API (works quite ok, but still some bugs, but that is another case...).

    After testing around a bit in conjunction with our newest game I noticed a strange output in the XCode console:
    Code (CSharp):
    1. CryptographicException: Bad PKCS7 padding. Invalid length 27.
    2. .....
    3. (Filename: currently not available on il2cpp Line: -1)
    At first I thought that I broke something with our encryption keys or something (we are using our Asset CryptoPlayerPrefs). After fiddling around for 2 hours I said: Ok, well, I can't find a bug - let's go back to 4.6.2p1 (version in that we last built the game) and try if it still happens.

    See there: Somewhere in between 4.6.2p1 and 4.6.3 il2cpp was broken regarding the Crypto functionality - on 4.6.2p1 it works flawlessly!

    I already filled out a bug report [and sent CryptoPlayerPrefs as an example] (#673791), but I wanted to know if anyone else has this issue...

    For us it is a big problem, because we can't iterate on our game until this is fixed properly and furthermore our Asset "CryptoPlayerPrefs" is affected, because it seems to not work on iOS if Version 4.6.3 is used...

    Regards,
    Bennet
     
    Last edited: Feb 20, 2015
    dk4kd likes this.
  2. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    I seem to have similar issue. so they might be related..for me it broke on 4.6.3

     
  3. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    173
    Just a small addition: Just downloaded the latest Unity 5 RC and there it also works fine. Just 4.6.3 is somehow broken.
     
  4. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    yes, you are right..it worked in unity5... although it don't get the same framerate as with 4.x+ OpenGL otherwise I'd be tempted to abandon 4.x =O
     
  5. rairala

    rairala

    Joined:
    Aug 21, 2014
    Posts:
    4
    Can confirm, I also have the same Bad PKCS7 padding issue on 4.6.3 whilst trying to use symmetric decryption. Works fine on Mono.

    Don't have an ios device with me now so I can't test it much further, but I guess something goes wrong during string encoding/decoding, which is one of the usual cases that trigger this error on Mono.
     
    Last edited: Feb 20, 2015
  6. shail

    shail

    Joined:
    Feb 24, 2015
    Posts:
    2

    We also find the same problem in Unity 4.6.3 version, in previous versions it was working fine
     
  7. Santa

    Santa

    Joined:
    Dec 4, 2009
    Posts:
    42
    The same problem. Bad PKCS7 padding issue on 4.6.3 with IL2CPP. Works fine on Mono.
     
  8. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    We had a bug that broke most Crypto functionality in 4.6.3. This will be corrected in 4.6.3p1, which is due out soon. Iv'e confirmed that bug 673791 is corrected in 4.6.3p1. Thanks for submitting it!
     
  9. sfjohansson

    sfjohansson

    Joined:
    Mar 12, 2013
    Posts:
    369
    All good in latest 4.6 but the issue seems to be back in Unity5 release build, what is the time frame for bringing over fixes from the 4.6 patches to unity5?
     
  10. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    The Unity 5 release matches the IL2CPP version from 4.6.3, so these bugs are present there. We're going to update things in the first Unity 5 patch release, which is due out next week.

    We will continue to keep 4.6 and 5.0 patch releases synchronized with respect to IL2CPP after that.
     
    sfjohansson likes this.
  11. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    173
    Is it possible that this (or some sort of similar) problem is back again? Just received a bug report from a CryptoPlayerPrefs user which goes into this direction. Furthermore I noticed a Bad padding error in the Editor Console when I upgraded from 4.6.3pX to 4.6.4. But if it now also occurs in the editor then it is probably not related to IL2CPP and broke at another point in Unity.

    I'll update here if I had time to investigate further on this...
     
  12. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,938
    @zkw

    We have not had any other reports of this being broken recently, so please let us know what you find. Thanks.