SecItemUpdate fails randomly with errSecItemNotFound

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

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 I extracted a simpler reproduction case in

Expected Results:

`SecItemUpdate()` will succeed.

Actual Results:

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


 macOS 10.13.2 (17C88)



Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at 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!