diff options
author | Dan Finlay <dan@danfinlay.com> | 2016-12-01 11:34:17 +0800 |
---|---|---|
committer | Dan Finlay <dan@danfinlay.com> | 2016-12-01 11:36:24 +0800 |
commit | 1880cda9b95f3274d56e1f4abc513d1d7ddd59c2 (patch) | |
tree | 5db1151d5b09c6f82a4a02a85ff3ae5fea8018dd /app/scripts/lib | |
parent | 049e351c9d78dc13a81ba962b04ef96694b13682 (diff) | |
download | tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar.gz tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar.bz2 tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar.lz tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar.xz tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.tar.zst tangerine-wallet-browser-1880cda9b95f3274d56e1f4abc513d1d7ddd59c2.zip |
Fix vault encrypting & unlocking bug
This is only a bug in dev, but was committed yesterday.
Sometimes the `encrypt` method was being passed values other than the password as the encryption key, leading to un-unlockable vaults.
To find this, and avoid it for all time hereafter, I added several more steps to our oft-neglected integration test suite, which now fully initializes a vault, locks it, and unlocks it again, to make sure all of those steps definitely work always.
Diffstat (limited to 'app/scripts/lib')
-rw-r--r-- | app/scripts/lib/config-manager.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/app/scripts/lib/config-manager.js b/app/scripts/lib/config-manager.js index 8e63265d2..59cc2b63c 100644 --- a/app/scripts/lib/config-manager.js +++ b/app/scripts/lib/config-manager.js @@ -3,6 +3,7 @@ const MetamaskConfig = require('../config.js') const migrations = require('./migrations') const rp = require('request-promise') const ethUtil = require('ethereumjs-util') +const normalize = require('./sig-util').normalize const TESTNET_RPC = MetamaskConfig.network.testnet const MAINNET_RPC = MetamaskConfig.network.mainnet @@ -273,13 +274,13 @@ ConfigManager.prototype.getWalletNicknames = function () { } ConfigManager.prototype.nicknameForWallet = function (account) { - const address = ethUtil.addHexPrefix(account.toLowerCase()) + const address = normalize(account) const nicknames = this.getWalletNicknames() return nicknames[address] } ConfigManager.prototype.setNicknameForWallet = function (account, nickname) { - const address = ethUtil.addHexPrefix(account.toLowerCase()) + const address = normalize(account) const nicknames = this.getWalletNicknames() nicknames[address] = nickname var data = this.getData() |