1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-15 20:19:23 +00:00

Added feature check

This commit is contained in:
slush0 2015-01-28 05:31:30 +01:00
parent 83e8655ece
commit bb4d21ba65

View File

@ -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)