-
Notifications
You must be signed in to change notification settings - Fork 219
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating Objects from Pre Catalina unexpected results #213
Comments
Hi @gregcotten! Thank you for the report! This is extremely useful information. The fact that you needed to add a Keychain Sharing entitlement in order to read from that simple Valet setup is not the intended expectation of this library. However, I have reproduced the issue locally. My test application setup has the keychain entitlement (because that's how I test The reason we added I think this means that we need to add to the README that macOS applications should enable the Keychain Sharing entitlement, whether or not they actually need keychain sharing. This is unfortunate, but I think the
I think this is somewhat expected, bear with me as I explain. Apple has two different keychain implementations on macOS. The legacy macOS implementation, and the ported iOS implementation. Prior to macOS Catalina, there was some ambiguous overlap in how these keychains worked. In macOS Catalina, Apple required app developers to be explicit regarding which keychain was being used: if you don't use From what you've told me, I think the "iCloud" keychain displayed in Keychain Access.app shows items in the ported iOS implementation. Your Now that we're explicitly opting into the ported iOS implementation with
According to Apple's documentation on sharing keychain items between applications, it seems that Apple will automatically add a Hopefully that explanation helps! I'm going to keep this issue open until I land a PR adding documentation to our README that mentions the Keychain Sharing entitlement requirement. Again, thank you for reporting in detail what you were seeing. Happy to answer whatever questions you may have. |
Thanks so much for the explanation! This all makes sense now. I guess the only lingering weirdness is |
The duplication is unfortunate, but I can't remove the old key without potentially leading some applications to have data loss. Imagine the following scenario:
If Applications that use keychain access group sharing would have a similar problem if a customer updated one app in the keychain access group that uses Valet but didn't update the others. Leaving the "login" item in the keychain doesn't have any user-facing negative affects, though I fully understand it is confusing for a developer trying to inspect their own keychain. If you're interested in creating a fork that deletes the old data, you can change the Valet/Sources/Valet/Valet.swift Lines 251 to 261 in 72ec12a
|
I've updated the release notes for 3.2.8 to include a note that the keychain sharing entitlement must be enabled to use Valet on macOS. |
Looks good to me! |
Hi there! I have a macOS 10.15 non-sanboxed, hardened-runtime app without the Keychain Sharing entitlement enabled.
I have a very simple valet setup
I have recently upgraded to Valet 3.2.8. Please note this issue below did not occur before the
kSecUseDataProtectionKeychain = true
update.On 10.14 and before, writing to this keychain puts a "application password" in the "login" keychain.
In Catalina, however, writing to this keychain results in a "Missing Entitlement" error. I know this isn't a Valet-specific issue. I go ahead and add the Keychain Sharing entitlement as I read somewhere that that could fix the issue - lo and behold I'm able to write to the keychain!
However, It's not writing to the "login" keychain but instead the "iCloud" keychain and seems to be using the default Keychain Access Group identifier ($teamID).($appIdentifier) as the access group instead of granting the app access directly. This is all a bit weird, and also
migrateObjectsFromPreCatalina()
does not perform an in-place adjustment but instead creates a duplicate keychain item because it now is an "iCloud" item and not a "login" item.Any insight here is much appreciated!
The text was updated successfully, but these errors were encountered: