Skip to content

Commit 93e47d4

Browse files
Merge pull request #364 from LedgerHQ/apr/bugfix/eip712_latency_weakness
Fix potential crash with slow APDU transport
2 parents 912c8af + 7ea69d1 commit 93e47d4

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ jobs:
209209
cd tests/ragger
210210
python3 -m venv ./venv
211211
. ./venv/bin/activate
212-
pip3 install --extra-index-url https://test.pypi.org/simple/ -r requirements.txt speculos
212+
pip3 install --extra-index-url https://test.pypi.org/simple/ -r requirements.txt
213213
# Used for the cache key
214214
echo "py_deps=$(pip freeze | md5sum | cut -d' ' -f1)" >> $GITHUB_ENV
215215
@@ -275,4 +275,4 @@ jobs:
275275
run: |
276276
cd tests/ragger
277277
. ./venv/bin/activate
278-
pytest --path ./elfs --model ${{ matrix.model }}
278+
pytest --path ./elfs --model ${{ matrix.model }} -s -v

src_bagl/ui_flow_signMessage712.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ static void dummy_cb(void) {
1616
ux_flow_prev();
1717
ui_pos = UI_712_POS_REVIEW;
1818
}
19+
} else {
20+
// temporarily disable button clicks, they will be re-enabled as soon as new data
21+
// is received and the page is redrawn with ux_flow_init()
22+
G_ux.stack[0].button_push_callback = NULL;
1923
}
2024
}
2125

tests/ragger/ethereum_client/client.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ethereum_client.eip712 import EIP712FieldType
88
from ethereum_client.response_parser import EthereumRespParser
99
import signal
10+
import time
1011

1112

1213
class EthereumClient:
@@ -92,6 +93,7 @@ def eip712_send_struct_impl_struct_field(self, raw_value: bytes):
9293

9394
def eip712_sign_new(self, bip32):
9495
with self._send(self._cmd_builder.eip712_sign_new(bip32)):
96+
time.sleep(0.5) # tight on timing, needed by the CI otherwise might fail sometimes
9597
if not self._settings[SettingType.VERBOSE_EIP712].value and \
9698
not self._eip712_filtering: # need to skip the message hash
9799
self._client.right_click()

0 commit comments

Comments
 (0)