jrendel / SwiftKeychainWrapper

A simple wrapper for the iOS Keychain to allow you to use it in a similar fashion to User Defaults. Written in Swift.
MIT License
1.59k stars 339 forks source link

removeAllKeys does not delete any items that were saved with synchronizable as true #179

Open MujiP opened 1 year ago

MujiP commented 1 year ago

The query dict passed to SecItemDelete in removeAllKeys does not contain any value for the synchronizable attribute, so it actually defaults to false, deleting only those items that are false, and leaving out items that were saved with true. The same also applies with the wipeKeychain method. We should add a value for sync to specify any.

From the documentation on the sync attribute:

If the key is not supplied, or has a value of kCFBooleanFalse, then no synchronizable items are added or returned. Use kSecAttrSynchronizableAny to query for both synchronizable and non-synchronizable results.