1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-24 15:28:10 +00:00

common, core: Add wipe_code_protection to the Features message.

This commit is contained in:
Andrew Kozlik 2019-10-29 16:38:12 +01:00
parent a3b608d8dd
commit 1bc8226a50
4 changed files with 8 additions and 0 deletions

View File

@ -87,6 +87,7 @@ message Features {
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
optional bool sd_protection = 33; // is SD Protect enabled
optional bool wipe_code_protection = 34; // is wipe code protection enabled
}
/**

View File

@ -70,6 +70,7 @@ def get_features() -> Features:
]
f.sd_card_present = io.SDCard().present()
f.sd_protection = storage.sd_salt.is_enabled()
f.wipe_code_protection = config.has_wipe_code()
return f

View File

@ -49,6 +49,7 @@ class Features(p.MessageType):
backup_type: EnumTypeBackupType = None,
sd_card_present: bool = None,
sd_protection: bool = None,
wipe_code_protection: bool = None,
) -> None:
self.vendor = vendor
self.major_version = major_version
@ -82,6 +83,7 @@ class Features(p.MessageType):
self.backup_type = backup_type
self.sd_card_present = sd_card_present
self.sd_protection = sd_protection
self.wipe_code_protection = wipe_code_protection
@classmethod
def get_fields(cls) -> Dict:
@ -118,4 +120,5 @@ class Features(p.MessageType):
31: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0),
32: ('sd_card_present', p.BoolType, 0),
33: ('sd_protection', p.BoolType, 0),
34: ('wipe_code_protection', p.BoolType, 0),
}

View File

@ -49,6 +49,7 @@ class Features(p.MessageType):
backup_type: EnumTypeBackupType = None,
sd_card_present: bool = None,
sd_protection: bool = None,
wipe_code_protection: bool = None,
) -> None:
self.vendor = vendor
self.major_version = major_version
@ -82,6 +83,7 @@ class Features(p.MessageType):
self.backup_type = backup_type
self.sd_card_present = sd_card_present
self.sd_protection = sd_protection
self.wipe_code_protection = wipe_code_protection
@classmethod
def get_fields(cls) -> Dict:
@ -118,4 +120,5 @@ class Features(p.MessageType):
31: ('backup_type', p.EnumType("BackupType", (0, 1, 2)), 0),
32: ('sd_card_present', p.BoolType, 0),
33: ('sd_protection', p.BoolType, 0),
34: ('wipe_code_protection', p.BoolType, 0),
}