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

src/main: report device_id as usb serial number

This commit is contained in:
Pavol Rusnak 2018-02-07 14:59:09 +01:00
parent a25af7d22a
commit 39576eb2a7
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 5 additions and 3 deletions

View File

@ -16,10 +16,10 @@ _NEEDS_BACKUP = const(0x07) # 0x01 or empty
def get_device_id() -> str:
dev_id = config.get(_APP, _DEVICE_ID).decode()
dev_id = config.get(_APP, _DEVICE_ID, True).decode() # public
if not dev_id:
dev_id = new_device_id()
config.set(_APP, _DEVICE_ID, dev_id.encode())
config.set(_APP, _DEVICE_ID, dev_id.encode(), True) # public
return dev_id

View File

@ -6,6 +6,8 @@ from trezor import loop
from trezor import wire
from trezor import workflow
from apps.common.storage import get_device_id
log.level = log.DEBUG
# initialize the USB stack
@ -60,7 +62,7 @@ usb = io.USB(
release_num=0x0200,
manufacturer="SatoshiLabs",
product="TREZOR",
serial_number="44DD6B2C788D760538A78ECA",
serial_number=get_device_id(),
interface="TREZOR Interface",
)