mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-01 04:12:37 +00:00
src: disable u2f in debug builds
This commit is contained in:
parent
e888b6b967
commit
e93ef0c296
41
src/main.py
41
src/main.py
@ -18,6 +18,20 @@ usb_wire = io.WebUSB(
|
|||||||
ep_out=0x01,
|
ep_out=0x01,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if __debug__:
|
||||||
|
usb_debug = io.WebUSB(
|
||||||
|
iface_num=1,
|
||||||
|
ep_in=0x82,
|
||||||
|
ep_out=0x02,
|
||||||
|
)
|
||||||
|
usb_vcp = io.VCP(
|
||||||
|
iface_num=2,
|
||||||
|
data_iface_num=3,
|
||||||
|
ep_in=0x83,
|
||||||
|
ep_out=0x03,
|
||||||
|
ep_cmd=0x84,
|
||||||
|
)
|
||||||
|
else:
|
||||||
usb_u2f = io.HID(
|
usb_u2f = io.HID(
|
||||||
iface_num=1,
|
iface_num=1,
|
||||||
ep_in=0x82,
|
ep_in=0x82,
|
||||||
@ -42,20 +56,6 @@ usb_u2f = io.HID(
|
|||||||
]),
|
]),
|
||||||
)
|
)
|
||||||
|
|
||||||
if __debug__:
|
|
||||||
usb_debug = io.WebUSB(
|
|
||||||
iface_num=2,
|
|
||||||
ep_in=0x85,
|
|
||||||
ep_out=0x05,
|
|
||||||
)
|
|
||||||
usb_vcp = io.VCP(
|
|
||||||
iface_num=3,
|
|
||||||
data_iface_num=4,
|
|
||||||
ep_in=0x83,
|
|
||||||
ep_out=0x03,
|
|
||||||
ep_cmd=0x84,
|
|
||||||
)
|
|
||||||
|
|
||||||
usb = io.USB(
|
usb = io.USB(
|
||||||
vendor_id=0x1209,
|
vendor_id=0x1209,
|
||||||
product_id=0x53C1,
|
product_id=0x53C1,
|
||||||
@ -67,27 +67,30 @@ usb = io.USB(
|
|||||||
)
|
)
|
||||||
|
|
||||||
usb.add(usb_wire)
|
usb.add(usb_wire)
|
||||||
usb.add(usb_u2f)
|
|
||||||
if __debug__:
|
if __debug__:
|
||||||
usb.add(usb_debug)
|
usb.add(usb_debug)
|
||||||
usb.add(usb_vcp)
|
usb.add(usb_vcp)
|
||||||
|
else:
|
||||||
|
usb.add(usb_u2f)
|
||||||
|
|
||||||
# load applications
|
# load applications
|
||||||
if __debug__:
|
|
||||||
from apps import debug
|
|
||||||
from apps import homescreen
|
from apps import homescreen
|
||||||
from apps import management
|
from apps import management
|
||||||
from apps import wallet
|
from apps import wallet
|
||||||
from apps import ethereum
|
from apps import ethereum
|
||||||
|
if __debug__:
|
||||||
|
from apps import debug
|
||||||
|
else:
|
||||||
from apps import fido_u2f
|
from apps import fido_u2f
|
||||||
|
|
||||||
# boot applications
|
# boot applications
|
||||||
if __debug__:
|
|
||||||
debug.boot()
|
|
||||||
homescreen.boot()
|
homescreen.boot()
|
||||||
management.boot()
|
management.boot()
|
||||||
wallet.boot()
|
wallet.boot()
|
||||||
ethereum.boot()
|
ethereum.boot()
|
||||||
|
if __debug__:
|
||||||
|
debug.boot()
|
||||||
|
else:
|
||||||
fido_u2f.boot(usb_u2f)
|
fido_u2f.boot(usb_u2f)
|
||||||
|
|
||||||
# initialize the wire codec and start the USB
|
# initialize the wire codec and start the USB
|
||||||
|
Loading…
Reference in New Issue
Block a user