fix import wallets and profile form 0.7.2
This commit is contained in:
parent
e614b375e7
commit
b15679c08c
4 changed files with 45 additions and 28 deletions
|
|
@ -198,13 +198,23 @@ Compatibility.importEncryptedWallet = function(identity, cypherText, password, o
|
|||
var crypto = (opts && opts.cryptoUtil) || cryptoUtils;
|
||||
|
||||
var obj = crypto.decrypt(password, cypherText);
|
||||
if (!obj) {
|
||||
// 0.7.3 broken KDF
|
||||
log.debug('Trying legacy encryption 0.7.2...');
|
||||
var passphrase = crypto.kdf(password, 'mjuBtGybi/4=', 100);
|
||||
obj = crypto.decrypt(passphrase, cypherText);
|
||||
}
|
||||
|
||||
if (!obj) {
|
||||
log.info("Could not decrypt, trying legacy..");
|
||||
obj = Compatibility.importLegacy(cypherText, password);
|
||||
if (!obj) {
|
||||
return cb('Could not decrypt', null);
|
||||
}
|
||||
};
|
||||
|
||||
if (!obj) {
|
||||
return cb('Could not decrypt', null);
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
obj = JSON.parse(obj);
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue