mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-13 19:18:56 +00:00
Bug fixes
- Ignore u2f interface instead of failing. - Fix set_mnenomic in debug client - Don't encode utf-8 mnenomics to byte arrays.
This commit is contained in:
parent
e51fb2078f
commit
eac9c99e32
@ -91,14 +91,14 @@ class expect(object):
|
||||
def normalize_nfc(txt):
|
||||
if sys.version_info[0] < 3:
|
||||
if isinstance(txt, unicode):
|
||||
return unicodedata.normalize('NFC', txt).encode('utf-8')
|
||||
return unicodedata.normalize('NFC', txt)
|
||||
if isinstance(txt, str):
|
||||
return unicodedata.normalize('NFC', txt.decode('utf-8')).encode('utf-8')
|
||||
return unicodedata.normalize('NFC', txt.decode('utf-8'))
|
||||
else:
|
||||
if isinstance(txt, bytes):
|
||||
return unicodedata.normalize('NFC', txt.decode('utf-8')).encode('utf-8')
|
||||
return unicodedata.normalize('NFC', txt.decode('utf-8'))
|
||||
if isinstance(txt, str):
|
||||
return unicodedata.normalize('NFC', txt).encode('utf-8')
|
||||
return unicodedata.normalize('NFC', txt)
|
||||
|
||||
raise Exception('unicode/str or bytes/str expected')
|
||||
|
||||
@ -283,7 +283,7 @@ class DebugLinkMixin(object):
|
||||
self.passphrase = normalize_nfc(passphrase)
|
||||
|
||||
def set_mnemonic(self, mnemonic):
|
||||
self.mnemonic = normalize_nfc(mnemonic)
|
||||
self.mnemonic = normalize_nfc(mnemonic).split(' ')
|
||||
|
||||
def call_raw(self, msg):
|
||||
|
||||
|
@ -14,7 +14,7 @@ from google.protobuf import descriptor_pb2
|
||||
_sym_db = _symbol_database.Default()
|
||||
|
||||
|
||||
import types_pb2
|
||||
from . import types_pb2
|
||||
|
||||
|
||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||
|
@ -49,8 +49,6 @@ class HidTransport(Transport):
|
||||
devices[serial_number][0] = path
|
||||
elif interface_number == 1: # debug link
|
||||
devices[serial_number][1] = path
|
||||
else:
|
||||
raise Exception("Unknown USB interface number: %d" % interface_number)
|
||||
|
||||
# List of two-tuples (path_normal, path_debuglink)
|
||||
return list(devices.values())
|
||||
|
Loading…
Reference in New Issue
Block a user