mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-09 15:00:58 +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):
|
def normalize_nfc(txt):
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
if isinstance(txt, unicode):
|
if isinstance(txt, unicode):
|
||||||
return unicodedata.normalize('NFC', txt).encode('utf-8')
|
return unicodedata.normalize('NFC', txt)
|
||||||
if isinstance(txt, str):
|
if isinstance(txt, str):
|
||||||
return unicodedata.normalize('NFC', txt.decode('utf-8')).encode('utf-8')
|
return unicodedata.normalize('NFC', txt.decode('utf-8'))
|
||||||
else:
|
else:
|
||||||
if isinstance(txt, bytes):
|
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):
|
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')
|
raise Exception('unicode/str or bytes/str expected')
|
||||||
|
|
||||||
@ -283,7 +283,7 @@ class DebugLinkMixin(object):
|
|||||||
self.passphrase = normalize_nfc(passphrase)
|
self.passphrase = normalize_nfc(passphrase)
|
||||||
|
|
||||||
def set_mnemonic(self, mnemonic):
|
def set_mnemonic(self, mnemonic):
|
||||||
self.mnemonic = normalize_nfc(mnemonic)
|
self.mnemonic = normalize_nfc(mnemonic).split(' ')
|
||||||
|
|
||||||
def call_raw(self, msg):
|
def call_raw(self, msg):
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ from google.protobuf import descriptor_pb2
|
|||||||
_sym_db = _symbol_database.Default()
|
_sym_db = _symbol_database.Default()
|
||||||
|
|
||||||
|
|
||||||
import types_pb2
|
from . import types_pb2
|
||||||
|
|
||||||
|
|
||||||
DESCRIPTOR = _descriptor.FileDescriptor(
|
DESCRIPTOR = _descriptor.FileDescriptor(
|
||||||
|
@ -49,8 +49,6 @@ class HidTransport(Transport):
|
|||||||
devices[serial_number][0] = path
|
devices[serial_number][0] = path
|
||||||
elif interface_number == 1: # debug link
|
elif interface_number == 1: # debug link
|
||||||
devices[serial_number][1] = path
|
devices[serial_number][1] = path
|
||||||
else:
|
|
||||||
raise Exception("Unknown USB interface number: %d" % interface_number)
|
|
||||||
|
|
||||||
# List of two-tuples (path_normal, path_debuglink)
|
# List of two-tuples (path_normal, path_debuglink)
|
||||||
return list(devices.values())
|
return list(devices.values())
|
||||||
|
Loading…
Reference in New Issue
Block a user