From bb4d21ba65baa5a75bae020a18b486a0927b276e Mon Sep 17 00:00:00 2001 From: slush0 Date: Wed, 28 Jan 2015 05:31:30 +0100 Subject: [PATCH] Added feature check --- trezorlib/client.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trezorlib/client.py b/trezorlib/client.py index 2d62db6..dbb4c54 100644 --- a/trezorlib/client.py +++ b/trezorlib/client.py @@ -337,6 +337,7 @@ class DebugLinkMixin(object): class ProtocolMixin(object): PRIME_DERIVATION_FLAG = 0x80000000 + VENDORS = ('bitcointrezor.com',) def __init__(self, *args, **kwargs): super(ProtocolMixin, self).__init__(*args, **kwargs) @@ -348,6 +349,8 @@ class ProtocolMixin(object): def init_device(self): 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): return os.urandom(32)