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

core/shamir: send boolean flag in Features that Recovery is in progress

This commit is contained in:
Tomas Susanka 2019-07-26 16:37:57 +02:00
parent 5bd8ad321e
commit a8c9a4ddc4
4 changed files with 8 additions and 0 deletions

View File

@ -57,6 +57,7 @@ message Features {
optional bytes fw_vendor_keys = 26; // reported firmware vendor keys (their hash)
optional bool unfinished_backup = 27; // report unfinished backup (equals to Storage.unfinished_backup)
optional bool no_backup = 28; // report no backup (equals to Storage.no_backup)
optional bool recovery_mode = 29; // is recovery mode in progress
}
/**

View File

@ -35,6 +35,7 @@ def get_features() -> Features:
f.unfinished_backup = storage.device.unfinished_backup()
f.no_backup = storage.device.no_backup()
f.flags = storage.device.get_flags()
f.recovery_mode = storage.recovery.is_in_progress()
return f

View File

@ -41,6 +41,7 @@ class Features(p.MessageType):
fw_vendor_keys: bytes = None,
unfinished_backup: bool = None,
no_backup: bool = None,
recovery_mode: bool = None,
) -> None:
self.vendor = vendor
self.major_version = major_version
@ -69,6 +70,7 @@ class Features(p.MessageType):
self.fw_vendor_keys = fw_vendor_keys
self.unfinished_backup = unfinished_backup
self.no_backup = no_backup
self.recovery_mode = recovery_mode
@classmethod
def get_fields(cls) -> Dict:
@ -100,4 +102,5 @@ class Features(p.MessageType):
26: ('fw_vendor_keys', p.BytesType, 0),
27: ('unfinished_backup', p.BoolType, 0),
28: ('no_backup', p.BoolType, 0),
29: ('recovery_mode', p.BoolType, 0),
}

View File

@ -41,6 +41,7 @@ class Features(p.MessageType):
fw_vendor_keys: bytes = None,
unfinished_backup: bool = None,
no_backup: bool = None,
recovery_mode: bool = None,
) -> None:
self.vendor = vendor
self.major_version = major_version
@ -69,6 +70,7 @@ class Features(p.MessageType):
self.fw_vendor_keys = fw_vendor_keys
self.unfinished_backup = unfinished_backup
self.no_backup = no_backup
self.recovery_mode = recovery_mode
@classmethod
def get_fields(cls) -> Dict:
@ -100,4 +102,5 @@ class Features(p.MessageType):
26: ('fw_vendor_keys', p.BytesType, 0),
27: ('unfinished_backup', p.BoolType, 0),
28: ('no_backup', p.BoolType, 0),
29: ('recovery_mode', p.BoolType, 0),
}