Skip to content

Commit 7f9b06e

Browse files
authored
accounts/usbwallet: fix version check in SignTypedMessage (#33113)
The version check incorrectly used `&&` instead of `||`, causing versions like v1.0.x through v1.4.x to be allowed when they should be rejected. These versions don't support EIP-712 signing which was introduced in firmware v1.5.0.
1 parent 6420ee3 commit 7f9b06e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accounts/usbwallet/ledger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func (w *ledgerDriver) SignTypedMessage(path accounts.DerivationPath, domainHash
184184
return nil, accounts.ErrWalletClosed
185185
}
186186
// Ensure the wallet is capable of signing the given transaction
187-
if w.version[0] < 1 && w.version[1] < 5 {
187+
if w.version[0] < 1 || (w.version[0] == 1 && w.version[1] < 5) {
188188
//lint:ignore ST1005 brand name displayed on the console
189189
return nil, fmt.Errorf("Ledger version >= 1.5.0 required for EIP-712 signing (found version v%d.%d.%d)", w.version[0], w.version[1], w.version[2])
190190
}

0 commit comments

Comments
 (0)