1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-07-03 21:32:33 +00:00

core: enable debuglink+webauth together in the emulator firmware

This commit is contained in:
Pavol Rusnak 2019-09-09 17:59:49 +02:00
parent d9e9fa6ceb
commit 898c421752
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 34 additions and 32 deletions

View File

@ -47,8 +47,8 @@ def _boot_default() -> None:
if __debug__: if __debug__:
import apps.debug import apps.debug
else:
if not utils.BITCOIN_ONLY: if not utils.BITCOIN_ONLY:
if not __debug__ or utils.EMULATOR:
import apps.webauthn import apps.webauthn
# boot applications # boot applications
@ -68,8 +68,8 @@ def _boot_default() -> None:
apps.binance.boot() apps.binance.boot()
if __debug__: if __debug__:
apps.debug.boot() apps.debug.boot()
else:
if not utils.BITCOIN_ONLY: if not utils.BITCOIN_ONLY:
if not __debug__ or utils.EMULATOR:
apps.webauthn.boot(usb.iface_webauthn) apps.webauthn.boot(usb.iface_webauthn)
# run main event loop and specify which screen is the default # run main event loop and specify which screen is the default

View File

@ -1,4 +1,4 @@
from trezor import io from trezor import io, utils
from apps.common.storage.device import get_device_id from apps.common.storage.device import get_device_id
@ -28,12 +28,13 @@ if __debug__:
ep_out=0x03, ep_out=0x03,
ep_cmd=0x84, ep_cmd=0x84,
) )
else: if not utils.BITCOIN_ONLY:
if not __debug__ or utils.EMULATOR:
# interface used for FIDO/U2F and FIDO2/WebAuthn HID transport # interface used for FIDO/U2F and FIDO2/WebAuthn HID transport
iface_webauthn = io.HID( iface_webauthn = io.HID(
iface_num=1, iface_num=4 if __debug__ else 1,
ep_in=0x82, ep_in=0x85 if __debug__ else 0x82,
ep_out=0x02, ep_out=0x04 if __debug__ else 0x02,
report_desc=bytes([ report_desc=bytes([
0x06, 0xd0, 0xf1, # USAGE_PAGE (FIDO Alliance) 0x06, 0xd0, 0xf1, # USAGE_PAGE (FIDO Alliance)
0x09, 0x01, # USAGE (U2F HID Authenticator Device) 0x09, 0x01, # USAGE (U2F HID Authenticator Device)
@ -67,5 +68,6 @@ bus.add(iface_wire)
if __debug__: if __debug__:
bus.add(iface_debug) bus.add(iface_debug)
bus.add(iface_vcp) bus.add(iface_vcp)
else: if not utils.BITCOIN_ONLY:
if not __debug__ or utils.EMULATOR:
bus.add(iface_webauthn) bus.add(iface_webauthn)