mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 09:57:02 +01:00
Reject eth_getEncryptionPublicKey for ledger hw wallets (#10326)
Fixes #10111 Determine if the msgParams/address for the newRequestEncryptionPublicKey is a ledger keyring via getKeyringForAccount and return a promise rejection.
This commit is contained in:
parent
469ccd20b3
commit
23bab62008
@ -1643,6 +1643,13 @@ export default class MetamaskController extends EventEmitter {
|
||||
* Passed back to the requesting Dapp.
|
||||
*/
|
||||
async newRequestEncryptionPublicKey(msgParams, req) {
|
||||
const address = msgParams
|
||||
const keyring = await this.keyringController.getKeyringForAccount(address)
|
||||
if (keyring.type === 'Ledger Hardware') {
|
||||
return new Promise((_, reject) => {
|
||||
reject(new Error('Ledger does not support eth_getEncryptionPublicKey.'))
|
||||
})
|
||||
}
|
||||
const promise = this.encryptionPublicKeyManager.addUnapprovedMessageAsync(
|
||||
msgParams,
|
||||
req,
|
||||
|
Loading…
Reference in New Issue
Block a user