diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto index d79601e9e..3b9a420e9 100644 --- a/common/protob/messages-management.proto +++ b/common/protob/messages-management.proto @@ -18,8 +18,9 @@ enum BackupType { * Level of safety checks for unsafe actions like spending from invalid path namespace or setting high transaction fee. */ enum SafetyCheckLevel { - Strict = 0; // disallow unsafe actions - Prompt = 1; // ask user before unsafe action + Strict = 0; // disallow unsafe actions, this is the default + PromptAlways = 1; // ask user before unsafe action + PromptTemporarily = 2; // like PromptAlways but reverts to Strict after reboot } /** @@ -98,7 +99,7 @@ message Features { optional bool wipe_code_protection = 34; // is wipe code protection enabled optional bytes session_id = 35; optional bool passphrase_always_on_device = 36; // device enforces passphrase entry on Trezor - optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement + optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement } /** diff --git a/core/src/trezor/messages/ApplySettings.py b/core/src/trezor/messages/ApplySettings.py index b268cc89a..882d3162d 100644 --- a/core/src/trezor/messages/ApplySettings.py +++ b/core/src/trezor/messages/ApplySettings.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 - EnumTypeSafetyCheckLevel = Literal[0, 1] + EnumTypeSafetyCheckLevel = Literal[0, 1, 2] except ImportError: pass @@ -44,5 +44,5 @@ class ApplySettings(p.MessageType): 6: ('auto_lock_delay_ms', p.UVarintType, 0), 7: ('display_rotation', p.UVarintType, 0), 8: ('passphrase_always_on_device', p.BoolType, 0), - 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0), + 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0), } diff --git a/core/src/trezor/messages/Features.py b/core/src/trezor/messages/Features.py index c7f890152..63e21bcf5 100644 --- a/core/src/trezor/messages/Features.py +++ b/core/src/trezor/messages/Features.py @@ -8,7 +8,7 @@ if __debug__: from typing_extensions import Literal # noqa: F401 EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] EnumTypeBackupType = Literal[0, 1, 2] - EnumTypeSafetyCheckLevel = Literal[0, 1] + EnumTypeSafetyCheckLevel = Literal[0, 1, 2] except ImportError: pass @@ -127,5 +127,5 @@ class Features(p.MessageType): 34: ('wipe_code_protection', p.BoolType, 0), 35: ('session_id', p.BytesType, 0), 36: ('passphrase_always_on_device', p.BoolType, 0), - 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0), + 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0), } diff --git a/core/src/trezor/messages/SafetyCheckLevel.py b/core/src/trezor/messages/SafetyCheckLevel.py index 51b55fa69..fec329fb6 100644 --- a/core/src/trezor/messages/SafetyCheckLevel.py +++ b/core/src/trezor/messages/SafetyCheckLevel.py @@ -4,4 +4,5 @@ if False: from typing_extensions import Literal Strict = 0 # type: Literal[0] -Prompt = 1 # type: Literal[1] +PromptAlways = 1 # type: Literal[1] +PromptTemporarily = 2 # type: Literal[2] diff --git a/python/src/trezorlib/messages/ApplySettings.py b/python/src/trezorlib/messages/ApplySettings.py index 62f26cdff..f2118f9df 100644 --- a/python/src/trezorlib/messages/ApplySettings.py +++ b/python/src/trezorlib/messages/ApplySettings.py @@ -6,7 +6,7 @@ if __debug__: try: from typing import Dict, List # noqa: F401 from typing_extensions import Literal # noqa: F401 - EnumTypeSafetyCheckLevel = Literal[0, 1] + EnumTypeSafetyCheckLevel = Literal[0, 1, 2] except ImportError: pass @@ -44,5 +44,5 @@ class ApplySettings(p.MessageType): 6: ('auto_lock_delay_ms', p.UVarintType, 0), 7: ('display_rotation', p.UVarintType, 0), 8: ('passphrase_always_on_device', p.BoolType, 0), - 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0), + 9: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0), } diff --git a/python/src/trezorlib/messages/Features.py b/python/src/trezorlib/messages/Features.py index 821f8c2b5..b6a32e304 100644 --- a/python/src/trezorlib/messages/Features.py +++ b/python/src/trezorlib/messages/Features.py @@ -8,7 +8,7 @@ if __debug__: from typing_extensions import Literal # noqa: F401 EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17] EnumTypeBackupType = Literal[0, 1, 2] - EnumTypeSafetyCheckLevel = Literal[0, 1] + EnumTypeSafetyCheckLevel = Literal[0, 1, 2] except ImportError: pass @@ -127,5 +127,5 @@ class Features(p.MessageType): 34: ('wipe_code_protection', p.BoolType, 0), 35: ('session_id', p.BytesType, 0), 36: ('passphrase_always_on_device', p.BoolType, 0), - 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1)), 0), + 37: ('safety_checks', p.EnumType("SafetyCheckLevel", (0, 1, 2)), 0), } diff --git a/python/src/trezorlib/messages/SafetyCheckLevel.py b/python/src/trezorlib/messages/SafetyCheckLevel.py index 51b55fa69..fec329fb6 100644 --- a/python/src/trezorlib/messages/SafetyCheckLevel.py +++ b/python/src/trezorlib/messages/SafetyCheckLevel.py @@ -4,4 +4,5 @@ if False: from typing_extensions import Literal Strict = 0 # type: Literal[0] -Prompt = 1 # type: Literal[1] +PromptAlways = 1 # type: Literal[1] +PromptTemporarily = 2 # type: Literal[2]