1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-22 07:28:10 +00:00

common, core: add passphrase entry capability

This commit is contained in:
Tomas Susanka 2019-11-21 09:43:57 +00:00 committed by Pavol Rusnak
parent 90d5cdfd5b
commit eafd57c301
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
6 changed files with 9 additions and 4 deletions

View File

@ -82,6 +82,7 @@ message Features {
Capability_U2F = 14;
Capability_Shamir = 15;
Capability_ShamirGroups = 16;
Capability_PassphraseEntry = 17; // the device is capable of passphrase entry directly on the device
}
optional BackupType backup_type = 31; // type of device backup (BIP-39 / SLIP-39 basic / SLIP-39 advanced)
optional bool sd_card_present = 32; // is SD card present

View File

@ -48,6 +48,7 @@ def get_features() -> Features:
Capability.Crypto,
Capability.Shamir,
Capability.ShamirGroups,
Capability.PassphraseEntry,
]
else:
f.capabilities = [
@ -67,6 +68,7 @@ def get_features() -> Features:
Capability.U2F,
Capability.Shamir,
Capability.ShamirGroups,
Capability.PassphraseEntry,
]
f.sd_card_present = io.SDCard().present()
f.sd_protection = storage.sd_salt.is_enabled()

View File

@ -23,3 +23,4 @@ if not utils.BITCOIN_ONLY:
U2F = 14 # type: Literal[14]
Shamir = 15 # type: Literal[15]
ShamirGroups = 16 # type: Literal[16]
PassphraseEntry = 17 # type: Literal[17]

View File

@ -6,7 +6,7 @@ if __debug__:
try:
from typing import Dict, List # noqa: F401
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]
EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
EnumTypeBackupType = Literal[0, 1, 2]
except ImportError:
pass
@ -118,7 +118,7 @@ class Features(p.MessageType):
27: ('unfinished_backup', p.BoolType, 0),
28: ('no_backup', p.BoolType, 0),
29: ('recovery_mode', p.BoolType, 0),
30: ('capabilities', p.EnumType("Capability", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)), p.FLAG_REPEATED),
30: ('capabilities', p.EnumType("Capability", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)), p.FLAG_REPEATED),
31: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0),
32: ('sd_card_present', p.BoolType, 0),
33: ('sd_protection', p.BoolType, 0),

View File

@ -19,3 +19,4 @@ Tezos = 13 # type: Literal[13]
U2F = 14 # type: Literal[14]
Shamir = 15 # type: Literal[15]
ShamirGroups = 16 # type: Literal[16]
PassphraseEntry = 17 # type: Literal[17]

View File

@ -6,7 +6,7 @@ if __debug__:
try:
from typing import Dict, List # noqa: F401
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]
EnumTypeCapability = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17]
EnumTypeBackupType = Literal[0, 1, 2]
except ImportError:
pass
@ -118,7 +118,7 @@ class Features(p.MessageType):
27: ('unfinished_backup', p.BoolType, 0),
28: ('no_backup', p.BoolType, 0),
29: ('recovery_mode', p.BoolType, 0),
30: ('capabilities', p.EnumType("Capability", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)), p.FLAG_REPEATED),
30: ('capabilities', p.EnumType("Capability", (1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17)), p.FLAG_REPEATED),
31: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0),
32: ('sd_card_present', p.BoolType, 0),
33: ('sd_protection', p.BoolType, 0),