-
Notifications
You must be signed in to change notification settings - Fork 926
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move Ethereum Ledger integration in untrusted iframe #14373
Conversation
ce4e043
to
a04e699
Compare
'm/44\'/60\'/0\'/0/0', 'domainSeparatorHex', 'hashStructMessageHex')) | ||
.resolves.toStrictEqual({ success: false, error: 'some error', code: 'Error' }) | ||
}) | ||
// class MockApp { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we removing this file before merge?
components/brave_wallet_ui/common/hardware/ledgerjs/eth_ledger_bridge_keyring_new.test.ts
Outdated
Show resolved
Hide resolved
components/brave_wallet_ui/common/hardware/ledgerjs/ledger_bridge_keyring.test.ts
Outdated
Show resolved
Hide resolved
A Storybook has been deployed to preview UI for the latest push |
aefca33
to
62967c1
Compare
components/brave_wallet_ui/common/hardware/ledgerjs/ledger_bridge_keyring.ts
Show resolved
Hide resolved
A Storybook has been deployed to preview UI for the latest push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
few nits spotted, but overall this looks good to me
components/brave_wallet_ui/common/hardware/ledgerjs/eth-ledger-untrusted-transport.ts
Show resolved
Hide resolved
components/brave_wallet_ui/common/hardware/ledgerjs/eth_ledger_bridge_keyring.ts
Show resolved
Hide resolved
components/brave_wallet_ui/common/hardware/ledgerjs/eth_ledger_bridge_keyring.ts
Show resolved
Hide resolved
components/brave_wallet_ui/common/hardware/ledgerjs/ledger_bridge_keyring.ts
Show resolved
Hide resolved
62967c1
to
985d946
Compare
A Storybook has been deployed to preview UI for the latest push |
A Storybook has been deployed to preview UI for the latest push |
90742e6
to
be6bc41
Compare
A Storybook has been deployed to preview UI for the latest push |
components/brave_wallet_ui/common/hardware/ledgerjs/ledger-messages.ts
Outdated
Show resolved
Hide resolved
be6bc41
to
49f9a58
Compare
A Storybook has been deployed to preview UI for the latest push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Frontend ++
A Storybook has been deployed to preview UI for the latest push |
...ts/brave_wallet_ui/components/shared/authorize-hardware-device/authorize-hardware-device.tsx
Show resolved
Hide resolved
This change isolates the ledgerjs libraries required to interact with the Ethereum app on Ledger devices to an iFrame in a chrome untrusted context. It reuses the framework established in the Ledger Solana Ethereum refactor, but generalizes some code such that it can be reused for both Solana and Ethereum. For example: * Shared logic in SolanaLedgerBridgeKeyring class has been moved to a new parent class that LedgerBridgeKeyring that both SolanaLedgerBridgeKeyring and EthereumLedgerBridgeKeyring that both inherit from * Solana specific logic was moved out of LedgerUntrustedMessagingTransport and into a new child class, SolanaLedgerUntrustedMessagingTransport. Similarly, Ethereum specific logic is now in a new child class, EthereumLedgerUntrustedMessagingTransport that inherits from LedgerUntrustedMessagingTransport. * Common message types were kept in ledger-messages.ts, but Solana and Ethereum specific message types were separated into their own sol-ledger-messages.ts and eth-ledger-messages.ts modules respectively.
5e588d9
to
144d32b
Compare
A Storybook has been deployed to preview UI for the latest push |
Resolves brave/brave-browser#24275
Security Review: https://github.com/brave/security/issues/969
This changes isolates the js libraries required to interact with the Ethereum app on Ledger devices to an iFrame in a chrome untrusted context. This uses the same framework used in the Solana hardware as #14096, but generalizes some code such that it can be reused for both Solana and Ethereum. For example:
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
The test plan is very similar to the test plan for the parallel Solana untrusted refactor, except instead of testing Solana Ledger functions, we test the Ethereum ones.
(await navigator.hid.getDevices()).forEach((d) => d.forget())
in the js console to forget devices which have already been granted permissions, then refresh the page(await navigator.hid.getDevices()).forEach((d) => d.forget())
to forget any device which already has permissions on the panel (need to be quick since this closes not long after the panel closes)