I am building a MAC app using crypto token. I have previously done this successfully for iPhone.
In iPhone we found if something crashed on the token session while performing a sign (meaning the function wasn't able to return a value) the token or the keychain freezes and stopped returning keychain items at the query for keychain items it will return status 0. The only way to solve this was to reboot the iphone.
In Mac something similar is happening, a crash at internet connection level made the extension get stuck and now event after restarting the mac it does not allow connection
this query let query: [String:Any] = [kSecAttrAccessGroup as String: kSecAttrAccessGroupToken, kSecAttrKeyClass as String : kSecAttrKeyClassPrivate,kSecClass as String : kSecClassIdentity, kSecReturnAttributes as String : kCFBooleanTrue as Any, kSecReturnRef as String: kCFBooleanTrue as Any, kSecMatchLimit as String: kSecMatchLimitAll, kSecReturnPersistentRef as String: kCFBooleanTrue as Any]
let status = SecItemCopyMatching(query as CFDictionary, &item) print("Status: (status.description)")
This generates:
Unable to connect to com.intereidas.dniMac.mac.TKExt:DniMac even after retries.
Status: 0
Found items: 0
This does not get fixed after mac restart, how can we make the token extension work again?