mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fixes MetaMask/metamask-extension#8626 - verifies password on requesting seed phrase (#9063)
This commit is contained in:
parent
df8eb494fe
commit
b4663eb78b
@ -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…
Reference in New Issue
Block a user