mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-15 12:08:59 +00:00
Added feature check
This commit is contained in:
parent
83e8655ece
commit
bb4d21ba65
@ -337,6 +337,7 @@ class DebugLinkMixin(object):
|
|||||||
|
|
||||||
class ProtocolMixin(object):
|
class ProtocolMixin(object):
|
||||||
PRIME_DERIVATION_FLAG = 0x80000000
|
PRIME_DERIVATION_FLAG = 0x80000000
|
||||||
|
VENDORS = ('bitcointrezor.com',)
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(ProtocolMixin, self).__init__(*args, **kwargs)
|
super(ProtocolMixin, self).__init__(*args, **kwargs)
|
||||||
@ -348,6 +349,8 @@ class ProtocolMixin(object):
|
|||||||
|
|
||||||
def init_device(self):
|
def init_device(self):
|
||||||
self.features = expect(proto.Features)(self.call)(proto.Initialize())
|
self.features = expect(proto.Features)(self.call)(proto.Initialize())
|
||||||
|
if str(self.features.vendor) not in self.VENDORS:
|
||||||
|
raise Exception("Unsupported device")
|
||||||
|
|
||||||
def _get_local_entropy(self):
|
def _get_local_entropy(self):
|
||||||
return os.urandom(32)
|
return os.urandom(32)
|
||||||
|
Loading…
Reference in New Issue
Block a user