From fd8cb0e061d79e95a2d7c32631c86bc1dee33685 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 24 Jul 2020 11:25:26 +0200 Subject: [PATCH] core/keychain: differentiate error message for ed25519 derivation --- core/src/apps/common/keychain.py | 2 +- tests/device_tests/test_msg_stellar_get_address.py | 3 ++- tests/ui_tests/fixtures.json | 1 - 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/apps/common/keychain.py b/core/src/apps/common/keychain.py index b6f9ede3f2..23ebe7a8de 100644 --- a/core/src/apps/common/keychain.py +++ b/core/src/apps/common/keychain.py @@ -103,7 +103,7 @@ class Keychain: def verify_path(self, path: paths.Bip32Path) -> None: if "ed25519" in self.curve and not paths.path_is_hardened(path): - raise FORBIDDEN_KEY_PATH + raise wire.DataError("Non-hardened paths unsupported on Ed25519") if device.unsafe_prompts_allowed(): return diff --git a/tests/device_tests/test_msg_stellar_get_address.py b/tests/device_tests/test_msg_stellar_get_address.py index 9796666892..476ac0f013 100644 --- a/tests/device_tests/test_msg_stellar_get_address.py +++ b/tests/device_tests/test_msg_stellar_get_address.py @@ -44,6 +44,7 @@ class TestMsgStellarGetAddress: ) assert address == "GBAW5XGWORWVFE2XTJYDTLDHXTY2Q2MO73HYCGB3XMFMQ562Q2W2GJQX" + @pytest.mark.skip_ui def test_stellar_get_address_fail(self, client): with pytest.raises(TrezorFailure) as exc: stellar.get_address(client, parse_path("m/0/1")) @@ -53,4 +54,4 @@ class TestMsgStellarGetAddress: assert exc.value.message.endswith("Failed to derive private key") else: assert exc.value.code == proto.FailureType.DataError - assert exc.value.message.endswith("Forbidden key path") + assert exc.value.message == "Non-hardened paths unsupported on Ed25519" diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json index 75305b06b6..f3b8468960 100644 --- a/tests/ui_tests/fixtures.json +++ b/tests/ui_tests/fixtures.json @@ -309,7 +309,6 @@ "test_msg_signtx_zcash.py-test_one_one_fee_sapling": "112df2ad84f4a517623eed893b3be809e0ba43e6139fd70b7f94c12f28cc633c", "test_msg_signtx_zcash.py-test_spend_old_versions": "da64743acaead691ec617cd56886b65453f82a2e3eb78b3f9dc737dbfc4155e6", "test_msg_stellar_get_address.py-test_stellar_get_address": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586", -"test_msg_stellar_get_address.py-test_stellar_get_address_fail": "5a80508a71a9ef64f94762b07636f90e464832f0f4a3102af8fa1a8c69e94586", "test_msg_stellar_get_address.py-test_stellar_get_address_sep": "46a370f6ff6cc90860e2b13eaab201986059227fbf5c841d9c55a21078155aba", "test_msg_stellar_sign_transaction.py::test_manage_data": "3dcb182ce27f4d26429570a3ee09d465d477a68a072687866ea291cf91bf805d", "test_msg_stellar_sign_transaction.py::test_sign_tx_account_merge_op": "36553c2e11b972a1ee7f29c4c218a8cd20883f5a873151ecac7ac332c461d0af",