By pressing "Use protected key" returns -26276 (AAPLKeychainTestsViewController.m @ 288 function -> SecItemCopyMatching)
By pressing "Delete protected key" reutrns -4 (AAPLKeychainTestsViewController.m @ 326 function -> SecItemDelete)
By pressing "Add protected key" returns success, but deletion and usage is not possible.
I found here: errSecInternal = -26276, /* An internal error occured in the Security framework. */
So in this case I can not access new added key.
I did post this issue to Apple team, but no answer for more than 1 month.
I would repost the question on the security list. That said, from my distant memory, those keys are likely marked with ACLs that prevent them from getting backed up, so you're encountering the equivalent of a dangling pointer in the keychain. If you re-add an item with matching name or whatever, it replaces that item, and it should work from that point on.
However, if deleting it and using it fails after re-adding the item, something very strange is going on, in which case I would file a bug. They'll probably ask you to install a configuration profile that enables a crapton of debugging, reproduce the error, and send them logs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With