SecItemUpdate fails randomly with errSecItemNotFound

Originator:MastahYeti
Number:rdar://37037268 Date Originated:1/30/2018
Status: Resolved:
Product:macOS + SDK Product Version:macOS 10.13.2 (17C88)
Classification:Bug Reproducible:Always
 
Summary:

Trying to update a key's `kSecAttrApplicationTag` using `SecItemUpdate()` fails randomly with `errSecItemNotFound`. After generating a keypair, `SecItemUpdate()` will succeed a few times. Continuing to call `SecItemUpdate()` will result in many failures intermixed with sporadic successes.

Steps to Reproduce:

This bug was originally encountered by users of http://github.com/github/softu2f. I extracted a simpler reproduction case in https://github.com/mastahyeti/keychaintest.

Expected Results:

`SecItemUpdate()` will succeed.

Actual Results:

`SecItemUpdate()` fails randomly with `errSecItemNotFound` errors.

Version/Build:

 macOS 10.13.2 (17C88)

Configuration:

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!