brave / brave-browser

Brave browser for Android, iOS, Linux, macOS, Windows.
https://brave.com
Mozilla Public License 2.0
17.92k stars 2.35k forks source link

GetAllowedAccounts should handle hardware keyring case too #19616

Closed yrliou closed 3 years ago

yrliou commented 3 years ago

Right now we always get the account list of default keyring in https://github.com/brave/brave-core/blob/master/browser/brave_wallet/brave_wallet_provider_delegate_impl.cc#L168, we should handle hardware keyring case here too, otherwise dapps APIs calling GetAllowedAccounts and CheckAccountAllowed will be checking the from address against the wrong list, hence it will always get auth error.

yrliou commented 3 years ago

Turns out that even it's called GetDefaultKeyringInfo which calls GetAccountInfosForKeyring(kDefaultKeyringId), currently we append hardware accounts there too, so this issue does not exist. Closing as invalid.