Closed tKe closed 3 years ago
Also reproducible in the sample app (iPhone Simulator running iOS 13.3):
Setting a value in Keychain a second time will result in "INVALID VALUE!" (due to the catch(...) { return false }
) and attempting to remove/clear results in the application crashing.
The culprit appears to be that the update and remove operations set kSecMatchLimit
in a misguided attempt to avoid accidentally touching more than one key. I don't know why, but this gives an error code indicating invalid parameter only after a relaunch. Will publish a fix as version 0.7.2 shortly.
There's still an issue when using clear()
. Will investigate. Should also verify that keys
and size
work since the sample app doesn't use them.
Ok I think all issues are fixed now in 0.7.3. Pro-tip don't use kSecMatchLimit
in any keychain function except SecItemCopyMatching()
(this is not documented officially anywhere I could find)
KeychainSettings
fails withKeychain error -50: One or more parameters passed to a function were not valid.
when updating or deleting an existing keychain item.Simplest example to reproduce for me is as follows:
I've reproduced this, with
kotlin 1.4.21
andmultiplatform-settings 0.7.1
NB: It also occurs in KaMPKit when switching
AppleSettings
forKeychainSettings
on the second update of the breed list (when updating the timestamp value)