mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-05-19 11:11:28 +00:00
Keychain is locked (#1550)
Fixes #1526 Co-authored-by: Sebastian Stenzel <overheadhunter@users.noreply.github.com> Co-authored-by: Sebastian Stenzel <sebastian.stenzel@gmail.com>
This commit is contained in:
@@ -100,7 +100,7 @@ public class ChangePasswordController implements FxController {
|
||||
}
|
||||
|
||||
private void updatePasswordInSystemkeychain() {
|
||||
if (keychain.isSupported()) {
|
||||
if (keychain.isSupported() && !keychain.isLocked()) {
|
||||
try {
|
||||
keychain.changePassphrase(vault.getId(), newPasswordController.passwordField.getCharacters());
|
||||
LOG.info("Successfully updated password in system keychain for {}", vault.getDisplayName());
|
||||
|
||||
@@ -59,7 +59,7 @@ public abstract class MasterkeyFileLoadingModule {
|
||||
@Named("savedPassword")
|
||||
@KeyLoadingScoped
|
||||
static Optional<char[]> provideStoredPassword(KeychainManager keychain, @KeyLoading Vault vault) {
|
||||
if (!keychain.isSupported()) {
|
||||
if (!keychain.isSupported() || keychain.isLocked()) {
|
||||
return Optional.empty();
|
||||
} else {
|
||||
try {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class VaultDetailLockedController implements FxController {
|
||||
this.vaultOptionsWindow = vaultOptionsWindow;
|
||||
this.keychain = keychain;
|
||||
this.mainWindow = mainWindow;
|
||||
if (keychain.isSupported()) {
|
||||
if (keychain.isSupported() && !keychain.isLocked()) {
|
||||
this.passwordSaved = BooleanExpression.booleanExpression(EasyBind.select(vault).selectObject(v -> keychain.getPassphraseStoredProperty(v.getId())));
|
||||
} else {
|
||||
this.passwordSaved = new SimpleBooleanProperty(false);
|
||||
|
||||
@@ -36,7 +36,7 @@ public class MasterkeyOptionsController implements FxController {
|
||||
this.changePasswordWindow = changePasswordWindow;
|
||||
this.recoveryKeyWindow = recoveryKeyWindow;
|
||||
this.keychain = keychain;
|
||||
if (keychain.isSupported()) {
|
||||
if (keychain.isSupported() && !keychain.isLocked()) {
|
||||
this.passwordSaved = Bindings.createBooleanBinding(this::isPasswordSaved, keychain.getPassphraseStoredProperty(vault.getId()));
|
||||
} else {
|
||||
this.passwordSaved = new SimpleBooleanProperty(false);
|
||||
@@ -74,7 +74,7 @@ public class MasterkeyOptionsController implements FxController {
|
||||
}
|
||||
|
||||
public boolean isPasswordSaved() {
|
||||
if (keychain.isSupported() && vault != null) {
|
||||
if (keychain.isSupported() && !keychain.isLocked() && vault != null) {
|
||||
return keychain.getPassphraseStoredProperty(vault.getId()).get();
|
||||
} else return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user