rely on the cache directly after unlock and inject in the cache on keychain changes

This commit is contained in:
Armin Schrenk
2025-01-15 10:02:21 +01:00
parent e422c7ce4b
commit c888b52ebb
2 changed files with 2 additions and 2 deletions

View File

@@ -101,7 +101,7 @@ public class KeychainManager implements KeychainAccessProvider {
}
private void setPassphraseStored(String key, boolean value) {
BooleanProperty property = passphraseStoredProperties.getIfPresent(key);
BooleanProperty property = passphraseStoredProperties.get(key, _ -> new SimpleBooleanProperty(value));
if (property != null) {
if (Platform.isFxApplicationThread()) {
property.set(value);

View File

@@ -113,7 +113,7 @@ public class MasterkeyFileLoadingStrategy implements KeyLoadingStrategy {
private void savePasswordToSystemkeychain(Passphrase passphrase) {
try {
if (keychain.isSupported() && !keychain.isPassphraseStored(vault.getId())) {
if (keychain.isSupported() && !keychain.getPassphraseStoredProperty(vault.getId()).getValue()) {
keychain.storePassphrase(vault.getId(), vault.getDisplayName(), passphrase);
}
} catch (KeychainAccessException e) {