|
|
@ -122,6 +122,7 @@ module.exports = class KeyringController extends EventEmitter { |
|
|
|
return this.loadKey(password) |
|
|
|
return this.loadKey(password) |
|
|
|
.then((derivedKey) => { |
|
|
|
.then((derivedKey) => { |
|
|
|
key = derivedKey |
|
|
|
key = derivedKey |
|
|
|
|
|
|
|
this.key = key |
|
|
|
return this.idStoreMigrator.oldSeedForPassword(password) |
|
|
|
return this.idStoreMigrator.oldSeedForPassword(password) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then((serialized) => { |
|
|
|
.then((serialized) => { |
|
|
@ -144,10 +145,13 @@ module.exports = class KeyringController extends EventEmitter { |
|
|
|
const salt = this.encryptor.generateSalt() |
|
|
|
const salt = this.encryptor.generateSalt() |
|
|
|
configManager.setSalt(salt) |
|
|
|
configManager.setSalt(salt) |
|
|
|
|
|
|
|
|
|
|
|
return new Promise((res, rej) => { |
|
|
|
return this.migrateAndGetKey(password) |
|
|
|
this.createFirstKeyTree(password, (err, state) => { |
|
|
|
.then((key) => { |
|
|
|
if (err) return rej(err) |
|
|
|
return new Promise((res, rej) => { |
|
|
|
res(configManager.getVault()) |
|
|
|
this.createFirstKeyTree(password, (err, state) => { |
|
|
|
|
|
|
|
if (err) return rej(err) |
|
|
|
|
|
|
|
res(configManager.getVault()) |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
.then((encryptedString) => { |
|
|
|
.then((encryptedString) => { |
|
|
|