- // release the Keychain lock before checking item integrity to avoid deadlock
-
- try {
- // If the Item's attribute hash does not match, skip the item
- if(!tempItem->checkIntegrity()) {
- secdebugfunc("integrity", "item has no integrity, skipping");
- continue;
- }
- } catch(CssmError cssme) {
- if (mDeleteInvalidRecords) {
- // This is an invalid record for some reason; delete it and restart the loop
- const char* errStr = cssmErrorString(cssme.error);
- secdebugfunc("integrity", "deleting corrupt record because: %d %s", (int) cssme.error, errStr);
-
- deleteInvalidRecord(uniqueId);
- // if deleteInvalidRecord doesn't throw, we want to restart the loop
- continue;
- } else {
- throw;
- }
- }