I've encountered strange crash while using SecKeyCreateRandomKey on iOS 13.4 and 13.5 simulators.
I've used that to generate a private key that will stored in Secure Enclave. I think the crash happen on this attribute (needed to store the key to the Secure Enclave).
kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave,
I've tried enabling Swift Error Breakpoint, Exception Breakpoint, Symbolic Breakpoint, activating address sanitizer and zombie objects but I don't still get any useful information.
This is the repo to reproduce the crash (Make sure you choose iOS 13 simulators) https://github.com/jeffersonsetiawan/SecureEnclaveCrash/
Thank you.
It work on ios 15 simulator
OK, then my answer is “Don’t do that.” (-:
Normally I’d suggest that you file a bug against the simulator but that’s not going to get any traction for the iOS 13 simulator.
If the crash is causing you grief — perhaps you rely on the simulator for iOS 13 compatibility testing — add code to your app that, in the simulator build only, disables the Secure Enclave code when running on older versions of iOS.
Share and Enjoy
—
Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"