Fixes MetaMask/metamask-extension#8626 - verifies password on requesting seed phrase (#9063)

feature/default_network_editable
ryanml 4 years ago committed by Mark Stacey
parent 1747f91bf1
commit 230d43176d
  1. 10
      app/scripts/metamask-controller.js
  2. 2
      package.json
  3. 4
      ui/app/store/actions.js
  4. 8
      yarn.lock

@ -478,6 +478,7 @@ export default class MetamaskController extends EventEmitter {
// vault management // vault management
submitPassword: nodeify(this.submitPassword, this), submitPassword: nodeify(this.submitPassword, this),
verifyPassword: nodeify(this.verifyPassword, this),
// network management // network management
setProviderType: nodeify(networkController.setProviderType, networkController), setProviderType: nodeify(networkController.setProviderType, networkController),
@ -808,6 +809,15 @@ export default class MetamaskController extends EventEmitter {
return this.keyringController.fullUpdate() return this.keyringController.fullUpdate()
} }
/**
* Submits a user's password to check its validity.
*
* @param {string} password The user's password
*/
async verifyPassword (password) {
await this.keyringController.verifyPassword(password)
}
/** /**
* @type Identity * @type Identity
* @property {string} name - The account nickname. * @property {string} name - The account nickname.

@ -98,7 +98,7 @@
"eth-json-rpc-filters": "^4.1.1", "eth-json-rpc-filters": "^4.1.1",
"eth-json-rpc-infura": "^4.0.2", "eth-json-rpc-infura": "^4.0.2",
"eth-json-rpc-middleware": "^5.0.2", "eth-json-rpc-middleware": "^5.0.2",
"eth-keyring-controller": "^6.0.1", "eth-keyring-controller": "^6.1.0",
"eth-method-registry": "^1.2.0", "eth-method-registry": "^1.2.0",
"eth-phishing-detect": "^1.1.4", "eth-phishing-detect": "^1.1.4",
"eth-query": "^2.1.2", "eth-query": "^2.1.2",

@ -168,7 +168,7 @@ export function createNewVault (password) {
export function verifyPassword (password) { export function verifyPassword (password) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
background.submitPassword(password, (error) => { background.verifyPassword(password, (error) => {
if (error) { if (error) {
return reject(error) return reject(error)
} }
@ -193,7 +193,7 @@ export function verifySeedPhrase () {
export function requestRevealSeedWords (password) { export function requestRevealSeedWords (password) {
return async (dispatch) => { return async (dispatch) => {
dispatch(showLoadingIndication()) dispatch(showLoadingIndication())
log.debug(`background.submitPassword`) log.debug(`background.verifyPassword`)
try { try {
await verifyPassword(password) await verifyPassword(password)

@ -10131,10 +10131,10 @@ eth-keyring-controller@^5.3.0, eth-keyring-controller@^5.6.1:
loglevel "^1.5.0" loglevel "^1.5.0"
obs-store "^4.0.3" obs-store "^4.0.3"
eth-keyring-controller@^6.0.1: eth-keyring-controller@^6.1.0:
version "6.0.1" version "6.1.0"
resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.0.1.tgz#6a4cdd5802b0587320c711be6c1752b2a88221aa" resolved "https://registry.yarnpkg.com/eth-keyring-controller/-/eth-keyring-controller-6.1.0.tgz#dc9313d0b793e085dc1badf84dd4f5e3004e127e"
integrity sha512-60j71F1HgLcvwzg7U5R45bA/kgQSUlmiZrsUIIhW4qS7QOYqJn0OQ64enf0ZaxMMPVVcKSfCDersYJiqm/yrlw== integrity sha512-wPxH++98VDBcDv9YkPzxhZC0gF1ixuRbyKR2u/NOT/roBpNQDe4reqyllBRC7jhPehiKnRxzf7r6HEyirRnPxQ==
dependencies: dependencies:
bip39 "^2.4.0" bip39 "^2.4.0"
bluebird "^3.5.0" bluebird "^3.5.0"

Loading…
Cancel
Save