Only migrate if possible (do not stop after first failure)
This commit is contained in:
parent
53c003b17a
commit
149edc1cbc
1 changed files with 8 additions and 12 deletions
|
|
@ -187,18 +187,14 @@ public class PasswordStore {
|
||||||
}
|
}
|
||||||
|
|
||||||
private func importExistingKeysIntoKeychain() {
|
private func importExistingKeysIntoKeychain() {
|
||||||
do {
|
try? KeyFileManager(keyType: PgpKey.PUBLIC, keyPath: Globals.pgpPublicKeyPath).importKeyAndDeleteFile()
|
||||||
try KeyFileManager(keyType: PgpKey.PUBLIC, keyPath: Globals.pgpPublicKeyPath).importKeyAndDeleteFile()
|
try? KeyFileManager(keyType: PgpKey.PRIVATE, keyPath: Globals.pgpPrivateKeyPath).importKeyAndDeleteFile()
|
||||||
try KeyFileManager(keyType: PgpKey.PRIVATE, keyPath: Globals.pgpPrivateKeyPath).importKeyAndDeleteFile()
|
try? KeyFileManager(keyType: SshKey.PRIVATE, keyPath: Globals.gitSSHPrivateKeyPath).importKeyAndDeleteFile()
|
||||||
try KeyFileManager(keyType: SshKey.PRIVATE, keyPath: Globals.gitSSHPrivateKeyPath).importKeyAndDeleteFile()
|
SharedDefaults.remove(.pgpPublicKeyArmor)
|
||||||
SharedDefaults.remove(.pgpPublicKeyArmor)
|
SharedDefaults.remove(.pgpPrivateKeyArmor)
|
||||||
SharedDefaults.remove(.pgpPrivateKeyArmor)
|
SharedDefaults.remove(.gitSSHPrivateKeyArmor)
|
||||||
SharedDefaults.remove(.gitSSHPrivateKeyArmor)
|
SharedDefaults[.pgpKeySource] = "file"
|
||||||
SharedDefaults[.pgpKeySource] = "file"
|
SharedDefaults[.gitSSHKeySource] = "file"
|
||||||
SharedDefaults[.gitSSHKeySource] = "file"
|
|
||||||
} catch {
|
|
||||||
print("MigrationError".localize(error))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public func initGitSSHKey(with armorKey: String) throws {
|
public func initGitSSHKey(with armorKey: String) throws {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue