mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-01-20 20:31:06 +00:00
src/apps/fido_u2f: implement bogus app_id screen
This commit is contained in:
parent
df10f5df3f
commit
7dc207a8df
@ -435,7 +435,7 @@ class ConfirmContent(ui.Widget):
|
|||||||
header = 'U2F Authenticate'
|
header = 'U2F Authenticate'
|
||||||
ui.header(header, ui.ICON_DEFAULT, ui.GREEN, ui.BG, ui.GREEN)
|
ui.header(header, ui.ICON_DEFAULT, ui.GREEN, ui.BG, ui.GREEN)
|
||||||
ui.display.image((ui.WIDTH - 64) // 2, 64, self.app_icon)
|
ui.display.image((ui.WIDTH - 64) // 2, 64, self.app_icon)
|
||||||
ui.display.text_center(ui.WIDTH // 2, 176, self.app_name, ui.MONO, ui.FG, ui.BG)
|
ui.display.text_center(ui.WIDTH // 2, 168, self.app_name, ui.MONO, ui.FG, ui.BG)
|
||||||
|
|
||||||
|
|
||||||
_CONFIRM_STATE_TIMEOUT_MS = const(10 * 1000)
|
_CONFIRM_STATE_TIMEOUT_MS = const(10 * 1000)
|
||||||
@ -472,10 +472,21 @@ class ConfirmState:
|
|||||||
@ui.layout
|
@ui.layout
|
||||||
async def confirm_layout(self) -> None:
|
async def confirm_layout(self) -> None:
|
||||||
from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED
|
from trezor.ui.confirm import HoldToConfirmDialog, CONFIRMED
|
||||||
|
from trezor.ui.text import Text
|
||||||
|
|
||||||
|
if bytes(self.app_id) == _BOGUS_APPID:
|
||||||
|
text = Text(
|
||||||
|
'U2F mismatch', ui.ICON_WRONG,
|
||||||
|
'Another U2F device',
|
||||||
|
'was used to register',
|
||||||
|
'in this application.',
|
||||||
|
icon_color=ui.RED)
|
||||||
|
text.render()
|
||||||
|
await loop.sleep(3 * 1000 * 1000)
|
||||||
|
return True
|
||||||
|
|
||||||
content = ConfirmContent(self.action, self.app_id)
|
content = ConfirmContent(self.action, self.app_id)
|
||||||
dialog = HoldToConfirmDialog(content)
|
dialog = HoldToConfirmDialog(content)
|
||||||
|
|
||||||
return await dialog == CONFIRMED
|
return await dialog == CONFIRMED
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user