From 729414e606fb21515c743ebb687c799e1e9780bb Mon Sep 17 00:00:00 2001 From: matejcik Date: Tue, 1 Jun 2021 15:07:02 +0200 Subject: [PATCH] fix(core): exclude get/set U2F counter from BITCOIN_ONLY --- core/src/apps/workflow_handlers.py | 9 +++++---- tests/device_tests/test_u2f_counter.py | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/src/apps/workflow_handlers.py b/core/src/apps/workflow_handlers.py index 26d685573..9aa4234aa 100644 --- a/core/src/apps/workflow_handlers.py +++ b/core/src/apps/workflow_handlers.py @@ -46,10 +46,6 @@ def find_message_handler_module(msg_type: int) -> str: return "apps.management.apply_flags" elif msg_type == MessageType.ChangePin: return "apps.management.change_pin" - elif msg_type == MessageType.SetU2FCounter: - return "apps.management.set_u2f_counter" - elif msg_type == MessageType.GetNextU2FCounter: - return "apps.management.get_next_u2f_counter" elif msg_type == MessageType.SdProtect: return "apps.management.sd_protect" elif msg_type == MessageType.ChangeWipeCode: @@ -87,6 +83,11 @@ def find_message_handler_module(msg_type: int) -> str: if False: raise RuntimeError + elif msg_type == MessageType.SetU2FCounter: + return "apps.management.set_u2f_counter" + elif msg_type == MessageType.GetNextU2FCounter: + return "apps.management.get_next_u2f_counter" + # webauthn elif msg_type == MessageType.WebAuthnListResidentCredentials: return "apps.webauthn.list_resident_credentials" diff --git a/tests/device_tests/test_u2f_counter.py b/tests/device_tests/test_u2f_counter.py index 46bca968d..9d054c1cf 100644 --- a/tests/device_tests/test_u2f_counter.py +++ b/tests/device_tests/test_u2f_counter.py @@ -14,9 +14,12 @@ # You should have received a copy of the License along with this library. # If not, see . +import pytest + from trezorlib import fido +@pytest.mark.altcoin def test_u2f_counter(client): assert fido.get_next_counter(client) == 0 assert fido.get_next_counter(client) == 1