mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-22 18:00:18 +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.
|
* Passed back to the requesting Dapp.
|
||||||
*/
|
*/
|
||||||
async newRequestEncryptionPublicKey(msgParams, req) {
|
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(
|
const promise = this.encryptionPublicKeyManager.addUnapprovedMessageAsync(
|
||||||
msgParams,
|
msgParams,
|
||||||
req,
|
req,
|
||||||
|
Loading…
Reference in New Issue
Block a user