1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-03 03:50:58 +00:00

fix(legacy): Ensure user is warned about non-standard paths.

This commit is contained in:
Andrew Kozlik 2021-11-19 00:37:39 +01:00 committed by Martin Milata
parent de6fab3c1e
commit 38134732dc
2 changed files with 9 additions and 0 deletions

View File

@ -0,0 +1 @@
Ensure that the user is always warned about non-standard paths.

View File

@ -702,6 +702,14 @@ static bool derive_node(TxInputType *tinput) {
if (!coin_path_check(coin, tinput->script_type, tinput->address_n_count, if (!coin_path_check(coin, tinput->script_type, tinput->address_n_count,
tinput->address_n, tinput->has_multisig, tinput->address_n, tinput->has_multisig,
CoinPathCheckLevel_BASIC)) { CoinPathCheckLevel_BASIC)) {
if (is_replacement) {
fsm_sendFailure(
FailureType_Failure_ProcessError,
_("Non-standard paths not allowed in replacement transactions."));
layoutHome();
return false;
}
if (config_getSafetyCheckLevel() == SafetyCheckLevel_Strict) { if (config_getSafetyCheckLevel() == SafetyCheckLevel_Strict) {
fsm_sendFailure(FailureType_Failure_DataError, _("Forbidden key path")); fsm_sendFailure(FailureType_Failure_DataError, _("Forbidden key path"));
signing_abort(); signing_abort();