~exprez135/cryptomator-libre

c13449c6ad8a85501b49e0ee4b0e3b752046c3f9 — Sebastian Stenzel 1 year, 6 months ago f720352
fixes #1214
M main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java => main/keychain/src/main/java/org/cryptomator/keychain/KeychainAccessStrategy.java +1 -1
@@ 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.

M main/keychain/src/main/java/org/cryptomator/keychain/MacSystemKeychainAccess.java => main/keychain/src/main/java/org/cryptomator/keychain/MacSystemKeychainAccess.java +4 -2
@@ 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);
		}
	}

}

M main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java => main/keychain/src/main/java/org/cryptomator/keychain/WindowsProtectedKeychainAccess.java +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