From 306030011129dbd973ef7cdb6ebe47f7bec801c1 Mon Sep 17 00:00:00 2001 From: Davide Date: Sat, 24 Feb 2024 02:09:39 +0100 Subject: [PATCH] Fix keychain prompt opening after idling After leaving the connection unused for 5 minutes (presumably that's the OS default for new keychains) the keychain locks and prompts the user to unlock, however there is a random password set and it can never be unlocked. To fix this we set the keychain to never lock. --- src/imp/security_framework.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/imp/security_framework.rs b/src/imp/security_framework.rs index 63232b7..1b769eb 100644 --- a/src/imp/security_framework.rs +++ b/src/imp/security_framework.rs @@ -94,10 +94,12 @@ impl Identity { } let dir = TempDir::new().map_err(|_| Error(base::Error::from(errSecIO)))?; - let keychain = keychain::CreateOptions::new() + let mut keychain = keychain::CreateOptions::new() .password(&random_password()?) .create(dir.path().join("identity.keychain"))?; + keychain.set_settings(&KeychainSettings::default())?; + let mut items = SecItems::default(); ImportOptions::new()