Pass the name of the vault on storing a passphrase

This commit is contained in:
Ralph Plawetzki
2021-10-04 19:45:26 +02:00
parent ac1ff5fb79
commit 54a005a5c9
3 changed files with 8 additions and 2 deletions

View File

@@ -49,6 +49,12 @@ public class KeychainManager implements KeychainAccessProvider {
setPassphraseStored(key, true);
}
@Override
public void storePassphrase(String key, String displayName, CharSequence passphrase) throws KeychainAccessException {
getKeychainOrFail().storePassphrase(key, displayName, passphrase);
setPassphraseStored(key, true);
}
@Override
public char[] loadPassphrase(String key) throws KeychainAccessException {
char[] passphrase = getKeychainOrFail().loadPassphrase(key);

View File

@@ -47,7 +47,7 @@ class MasterkeyFileLoadingFinisher {
private void savePasswordToSystemkeychain() {
if (keychain.isSupported()) {
try {
keychain.storePassphrase(vault.getId(), CharBuffer.wrap(enteredPassword.get()));
keychain.storePassphrase(vault.getId(), vault.getDisplayName(), CharBuffer.wrap(enteredPassword.get()));
} catch (KeychainAccessException e) {
LOG.error("Failed to store passphrase in system keychain.", e);
}