diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00000.png new file mode 100644 index 000000000..26b8ea430 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00001.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00001.png new file mode 100644 index 000000000..e3301930b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00002.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00002.png new file mode 100644 index 000000000..04889b556 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00003.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00003.png new file mode 100644 index 000000000..81bcfc3cd Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00004.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00004.png new file mode 100644 index 000000000..7ef47f863 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00005.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00005.png new file mode 100644 index 000000000..dd996e273 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00006.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00006.png new file mode 100644 index 000000000..c3d918032 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00006.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png new file mode 100644 index 000000000..a483eb6b9 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_at_the_end/00007.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00000.png new file mode 100644 index 000000000..26b8ea430 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00001.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00001.png new file mode 100644 index 000000000..e3301930b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00002.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00002.png new file mode 100644 index 000000000..04889b556 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00003.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00003.png new file mode 100644 index 000000000..81bcfc3cd Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00004.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00004.png new file mode 100644 index 000000000..7ef47f863 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00005.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00005.png new file mode 100644 index 000000000..a483eb6b9 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_added_inside/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00000.png new file mode 100644 index 000000000..26b8ea430 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00001.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00001.png new file mode 100644 index 000000000..e3301930b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00002.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00002.png new file mode 100644 index 000000000..04889b556 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00003.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00003.png new file mode 100644 index 000000000..81bcfc3cd Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00004.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00004.png new file mode 100644 index 000000000..7ef47f863 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00005.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00005.png new file mode 100644 index 000000000..ff518831a Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00006.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00006.png new file mode 100644 index 000000000..a483eb6b9 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/one_byte_removed_inside/00006.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_magic_bytes/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_magic_bytes/00000.png new file mode 100644 index 000000000..7b1e80c0b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_magic_bytes/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_operation/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_operation/00000.png new file mode 100644 index 000000000..7b1e80c0b Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/unknown_operation/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00000.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00000.png new file mode 100644 index 000000000..3b367afa8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00001.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00001.png new file mode 100644 index 000000000..46aa25f51 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00001.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00002.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00002.png new file mode 100644 index 000000000..908600200 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00002.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00003.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00003.png new file mode 100644 index 000000000..c5bc8284e Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00003.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00004.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00004.png new file mode 100644 index 000000000..b0b2a6940 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00004.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00005.png b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00005.png new file mode 100644 index 000000000..f91c9d9ef Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_parsing_errors/wrong_last_packet/00005.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_too_deep/00000.png b/tests/integration/nano/snapshots/nanox/test_too_deep/00000.png new file mode 100644 index 000000000..21826bc31 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_too_deep/00000.png differ diff --git a/tests/integration/nano/snapshots/nanox/test_too_large/00000.png b/tests/integration/nano/snapshots/nanox/test_too_large/00000.png new file mode 100644 index 000000000..e214d3af8 Binary files /dev/null and b/tests/integration/nano/snapshots/nanox/test_too_large/00000.png differ diff --git a/tests/integration/nano/test_parsing_errors.py b/tests/integration/nano/test_parsing_errors.py index bdacc295b..34acecc05 100644 --- a/tests/integration/nano/test_parsing_errors.py +++ b/tests/integration/nano/test_parsing_errors.py @@ -31,6 +31,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "0100000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316", with_hash=True, + text="INVALID_TAG", path=make_path("unknown_magic_bytes")) app.assert_screen(Screen.Home) @@ -38,6 +39,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "03000000000000000000000000000000000000000000000000000000000000000001016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff02000000020316", with_hash=True, + text="INVALID_TAG", path=make_path("unknown_operation")) app.assert_screen(Screen.Home) @@ -45,6 +47,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e010000000000000000000000000000000000000000ff02000000020316", with_hash=True, + text="INVALID_TAG", path=make_path("one_byte_removed_inside")) app.assert_screen(Screen.Home) @@ -52,6 +55,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e01000000000000000000000000000000000000000000ff0200000002031645", with_hash=True, + text="INVALID_TAG", path=make_path("one_byte_added_at_the_end")) app.assert_screen(Screen.Home) @@ -59,6 +63,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e0100000000000000000000000000000000000000000000ff02000000020316", with_hash=True, + text="INVALID_TAG", path=make_path("one_byte_added_inside")) app.assert_screen(Screen.Home) @@ -66,6 +71,7 @@ def make_path(name: str) -> Path: app.parsing_error_signing(DEFAULT_ACCOUNT, "0300000000000000000000000000000000000000000000000000000000000000006c016e8874874d31c3fbd636e924d5a036a43ec8faa7d0860308362d80d30e0100000000000000000000000000000000000000000000ff02000000020316", with_hash=True, + text="INVALID_TAG", path=make_path("one_byte_added_inside")) app.assert_screen(Screen.Home) diff --git a/tests/integration/nano/test_too_deep.py b/tests/integration/nano/test_too_deep.py index 8c95ccb15..a04ebb458 100644 --- a/tests/integration/nano/test_too_deep.py +++ b/tests/integration/nano/test_too_deep.py @@ -27,6 +27,7 @@ app.parsing_error_signing(DEFAULT_ACCOUNT, "0502000000f702000000f202000000ed02000000e802000000e302000000de02000000d902000000d402000000cf02000000ca02000000c502000000c002000000bb02000000b602000000b102000000ac02000000a702000000a2020000009d02000000980200000093020000008e02000000890200000084020000007f020000007a02000000750200000070020000006b02000000660200000061020000005c02000000570200000052020000004d02000000480200000043020000003e02000000390200000034020000002f020000002a02000000250200000020020000001b020000001602000000", with_hash=True, + text="TOO_DEEP", path=test_name) app.quit() diff --git a/tests/integration/nano/test_too_large.py b/tests/integration/nano/test_too_large.py index 6d7c37fbc..85a1f7438 100644 --- a/tests/integration/nano/test_too_large.py +++ b/tests/integration/nano/test_too_large.py @@ -27,6 +27,7 @@ app.parsing_error_signing(DEFAULT_ACCOUNT, "050092abf8e3d9e5f8cfd9ae8a9fe5f28ea1d5b5abf1af82dae8a4b68df3d1889eb6f988f5e8d31a", with_hash=True, + text="TOO_LARGE", path=test_name) app.quit() diff --git a/tests/integration/nano/utils/app.py b/tests/integration/nano/utils/app.py index 564c85cba..dc6325133 100644 --- a/tests/integration/nano/utils/app.py +++ b/tests/integration/nano/utils/app.py @@ -335,11 +335,15 @@ def parsing_error_signing(self, account: Account, message: Union[str, bytes], with_hash: bool, + text: str, path: Union[str, Path]) -> None: + if self.backend.firmware.device != "nanox": + text = "Parsing error" + self._failing_signing(account, message, with_hash, - "Parsing error", + text, StatusCode.PARSE_ERROR, path)