mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-08-20 06:06:02 +00:00
fixes #1214
This commit is contained in:
@@ -29,7 +29,7 @@ interface KeychainAccessStrategy {
|
||||
void deletePassphrase(String key) throws KeychainAccessException;
|
||||
|
||||
/**
|
||||
* Updates a passphrase with a given key.
|
||||
* Updates a passphrase with a given key. Noop, if there is no item for the given key.
|
||||
*
|
||||
* @param key Unique key previously used while {@link #storePassphrase(String, CharSequence) storing a passphrase}.
|
||||
* @param passphrase The secret to be updated in this keychain.
|
||||
|
||||
@@ -49,8 +49,10 @@ class MacSystemKeychainAccess implements KeychainAccessStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePassphrase(String key, CharSequence passphrase) throws KeychainAccessException {
|
||||
storePassphrase(key, passphrase);
|
||||
public void changePassphrase(String key, CharSequence passphrase) {
|
||||
if (keychain().deletePassword(key)) {
|
||||
keychain().storePassword(key, passphrase);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+5
-2
@@ -115,8 +115,11 @@ class WindowsProtectedKeychainAccess implements KeychainAccessStrategy {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void changePassphrase(String key, CharSequence passphrase) throws KeychainAccessException {
|
||||
storePassphrase(key, passphrase);
|
||||
public void changePassphrase(String key, CharSequence passphrase) {
|
||||
loadKeychainEntriesIfNeeded();
|
||||
if (keychainEntries.remove(key) != null) {
|
||||
storePassphrase(key, passphrase);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user