SecKeyRef tmpprivatekeyref = [KeyInterface lookupPrivateKeyRef];
OSStatus signStatus = SecKeyRawSign(tmpprivatekeyref,
kSecPaddingNone,
[digest bytes],
[digest length],
[signature mutableBytes],
&signatureLength);
if tmpprivatekeyref is nil then on older versions of the OS signStatus used to return success or failure, on OS 15 it is crashing with the error mentioned in the post's heading. This is the bug. Why tmpprivatekeyref is nil you ask? because we store device id in a keychain to uniquely identify a device, so when an app gets transferred from one iphone to another keychain gets replicated even if we set thisiphoneonly flag (not through icloud), but the privatekey reference for SecKeyRef doesn'te get transferred to the new iphone. I have mentioned this before as well, but apple keeps insisting on providing a sample code, how can i provide a sample code for an issue that occurs when an app is transferred from one device to another?
Topic:
Privacy & Security
SubTopic:
General
Tags: