From 1e0a23c1333b820dfb95fb0b71f987cc8c7e677a Mon Sep 17 00:00:00 2001 From: matejcik Date: Wed, 5 May 2021 12:27:21 +0200 Subject: [PATCH] fix(core/paths): make sure containers are copied along with the numbers they contain --- ci/test-hw.yml | 2 +- core/src/apps/common/paths.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ci/test-hw.yml b/ci/test-hw.yml index 923741751..34f42c309 100644 --- a/ci/test-hw.yml +++ b/ci/test-hw.yml @@ -22,7 +22,7 @@ hardware core regular device test: - core fw regular debug build variables: PYTEST_TIMEOUT: "1200" - TESTS_SKIP: "-k 'not 15_of_15 and not signtx_bgold and not send_bch_multisig_change'" + TESTS_SKIP: "-k 'not 15_of_15'" script: - cd ci/hardware_tests - set -a diff --git a/core/src/apps/common/paths.py b/core/src/apps/common/paths.py index a953561e9..e69d429c0 100644 --- a/core/src/apps/common/paths.py +++ b/core/src/apps/common/paths.py @@ -108,12 +108,14 @@ class PathSchema: @staticmethod def _copy_container(container: Container[int]) -> Container[int]: + # On hardware, hardened indices do not fit into smallint. + # The n+0 operation ensures that a new instance of a longint is created. if isinstance(container, Interval): - return Interval(container.min, container.max) + return Interval(container.min + 0, container.max + 0) if isinstance(container, set): - return set(container) + return set(i + 0 for i in container) if isinstance(container, tuple): - return container[:] + return tuple(i + 0 for i in container) raise RuntimeError("Unsupported container for copy") def __init__(