1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

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

This commit is contained in:
ryanml 2020-07-24 15:47:40 -07:00 committed by GitHub
parent df8eb494fe
commit b4663eb78b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View File

@ -478,6 +478,7 @@ export default class MetamaskController extends EventEmitter {
// vault management
submitPassword: nodeify(this.submitPassword, this),
verifyPassword: nodeify(this.verifyPassword, this),
// network management
setProviderType: nodeify(networkController.setProviderType, networkController),
@ -808,6 +809,15 @@ export default class MetamaskController extends EventEmitter {
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
* @property {string} name - The account nickname.

View File

@ -98,7 +98,7 @@
"eth-json-rpc-filters": "^4.1.1",
"eth-json-rpc-infura": "^4.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-phishing-detect": "^1.1.4",
"eth-query": "^2.1.2",

View File

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

View File

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