bsc/accounts/usbwallet
James Prestwich 1e3177de22
accounts/usbwallet: mitigate ledger app chunking issue (#26773)
This PR mitigates an issue with Ledger's on-device RLP deserialization, see
https://github.com/LedgerHQ/app-ethereum/issues/409

Ledger's RLP deserialization code does not validate the length of the RLP list received,
and it may prematurely enter the signing flow when a APDU chunk boundary falls immediately
before the EIP-155 chain_id when deserializing a transaction. Since the chain_id is
uninitialized, it is 0 during this signing flow. This may cause the user to accidentally
sign the transaction with chain_id = 0. That signature would be returned from the device 1
packet earlier than expected by the communication loop. The device blocks the
second-to-last packet waiting for the signer flow, and then errors on the successive
packet (which contains the chain_id, zeroed r, and zeroed s)

Since the signature's early arrival causes successive errors during the communication
process, geth does not parse the improper signature produced by the device, and therefore
no improperly-signed transaction can be created. User funds are not at risk.

We mitigate by selecting the highest chunk size that leaves at least 4 bytes in the
final chunk.
2023-03-07 15:20:04 +01:00
..
trezor build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
hub.go accounts/usbwallet: support Ledger Nano S Plus and FTS (#25933) 2022-10-11 09:31:32 +02:00
ledger.go accounts/usbwallet: mitigate ledger app chunking issue (#26773) 2023-03-07 15:20:04 +01:00
trezor.go build: upgrade to go 1.19 (#25726) 2022-09-10 13:25:40 +02:00
wallet.go all: fix some typos (#25551) 2022-08-19 09:00:21 +03:00