|
@@ -2,7 +2,7 @@ package org.cryptomator.ui.changepassword;
|
|
|
|
|
|
import org.cryptomator.common.keychain.KeychainManager;
|
|
|
import org.cryptomator.common.vaults.Vault;
|
|
|
-import org.cryptomator.cryptofs.common.MasterkeyBackupHelper;
|
|
|
+import org.cryptomator.cryptofs.common.BackupHelper;
|
|
|
import org.cryptomator.cryptolib.api.CryptoException;
|
|
|
import org.cryptomator.cryptolib.api.InvalidPassphraseException;
|
|
|
import org.cryptomator.cryptolib.common.MasterkeyFileAccess;
|
|
@@ -83,7 +83,7 @@ public class ChangePasswordController implements FxController {
|
|
|
Path masterkeyPath = vault.getPath().resolve(MASTERKEY_FILENAME);
|
|
|
byte[] oldMasterkeyBytes = Files.readAllBytes(masterkeyPath);
|
|
|
byte[] newMasterkeyBytes = masterkeyFileAccess.changePassphrase(oldMasterkeyBytes, oldPassphrase, newPassphrase);
|
|
|
- Path backupKeyPath = vault.getPath().resolve(MASTERKEY_FILENAME + MasterkeyBackupHelper.generateFileIdSuffix(oldMasterkeyBytes) + MASTERKEY_BACKUP_SUFFIX);
|
|
|
+ Path backupKeyPath = vault.getPath().resolve(MASTERKEY_FILENAME + BackupHelper.generateFileIdSuffix(oldMasterkeyBytes) + MASTERKEY_BACKUP_SUFFIX);
|
|
|
Files.move(masterkeyPath, backupKeyPath, StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.ATOMIC_MOVE);
|
|
|
Files.write(masterkeyPath, newMasterkeyBytes, StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE);
|
|
|
LOG.info("Successfully changed password for {}", vault.getDisplayName());
|