1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-23 23:08:14 +00:00

core/cbor: fix string conversion to work with bytearrays

This commit is contained in:
Pavol Rusnak 2019-06-01 11:49:27 +02:00
parent 31506d81e9
commit 1ee5068128
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D

View File

@ -139,7 +139,7 @@ def _cbor_decode(cbor):
return (data[0:ln], data[ln:])
elif fb_type == _CBOR_TEXT_STRING:
ln, data = _read_length(cbor[1:], fb_aux)
return (data[0:ln].decode(), data[ln:])
return (bytes(data[0:ln]).decode(), data[ln:])
elif fb_type == _CBOR_ARRAY:
if fb_aux == _CBOR_VAR_FOLLOWS:
res = []