mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
core/webauthn: Fix user input timeout bug.
This commit is contained in:
parent
a2fed79f7e
commit
5401f88d52
@ -919,19 +919,20 @@ class DialogManager:
|
|||||||
if state.keepalive_status() is not None:
|
if state.keepalive_status() is not None:
|
||||||
self.keepalive = self.keepalive_loop()
|
self.keepalive = self.keepalive_loop()
|
||||||
loop.schedule(self.keepalive)
|
loop.schedule(self.keepalive)
|
||||||
else:
|
|
||||||
self.keepalive = None
|
|
||||||
self.workflow = self.dialog_workflow()
|
self.workflow = self.dialog_workflow()
|
||||||
loop.schedule(self.workflow)
|
loop.schedule(self.workflow)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def keepalive_loop(self) -> None:
|
async def keepalive_loop(self) -> None:
|
||||||
if not isinstance(self.state, Fido2State):
|
try:
|
||||||
return
|
if not isinstance(self.state, Fido2State):
|
||||||
while utime.ticks_ms() < self.deadline:
|
return
|
||||||
cmd = cmd_keepalive(self.state.cid, self.state.keepalive_status())
|
while utime.ticks_ms() < self.deadline:
|
||||||
await send_cmd(cmd, self.iface)
|
cmd = cmd_keepalive(self.state.cid, self.state.keepalive_status())
|
||||||
await loop.sleep(_KEEPALIVE_INTERVAL_MS * 1000)
|
await send_cmd(cmd, self.iface)
|
||||||
|
await loop.sleep(_KEEPALIVE_INTERVAL_MS * 1000)
|
||||||
|
finally:
|
||||||
|
self.keepalive = None
|
||||||
|
|
||||||
self.result = _RESULT_TIMEOUT
|
self.result = _RESULT_TIMEOUT
|
||||||
self.reset()
|
self.reset()
|
||||||
@ -949,7 +950,6 @@ class DialogManager:
|
|||||||
finally:
|
finally:
|
||||||
if self.keepalive is not None:
|
if self.keepalive is not None:
|
||||||
loop.close(self.keepalive)
|
loop.close(self.keepalive)
|
||||||
self.keepalive = None
|
|
||||||
|
|
||||||
if self.result == _RESULT_CONFIRM:
|
if self.result == _RESULT_CONFIRM:
|
||||||
await self.state.on_confirm()
|
await self.state.on_confirm()
|
||||||
|
Loading…
Reference in New Issue
Block a user