mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-22 22:38:08 +00:00
core/webauthn: Don't log an exception when a relying party is not listed in knownapps.
This commit is contained in:
parent
5bdd523b91
commit
c463069895
@ -1,4 +1,4 @@
|
|||||||
from trezor import log, ui
|
from trezor import ui
|
||||||
from trezor.ui.text import text_center_trim_left, text_center_trim_right
|
from trezor.ui.text import text_center_trim_left, text_center_trim_right
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
@ -22,14 +22,21 @@ class ConfirmInfo:
|
|||||||
from trezor import res
|
from trezor import res
|
||||||
from apps.webauthn.knownapps import knownapps
|
from apps.webauthn.knownapps import knownapps
|
||||||
|
|
||||||
try:
|
app_name = knownapps.get(rp_id_hash, {}).get(
|
||||||
namepart = knownapps[rp_id_hash]["label"].lower().replace(" ", "_")
|
"label", None
|
||||||
icon = res.load("apps/webauthn/res/icon_%s.toif" % namepart)
|
) # type: Optional[str]
|
||||||
except Exception as e:
|
if app_name is not None:
|
||||||
icon = res.load("apps/webauthn/res/icon_webauthn.toif")
|
resource = "apps/webauthn/res/icon_%s.toif" % app_name.lower().replace(
|
||||||
if __debug__:
|
" ", "_"
|
||||||
log.exception(__name__, e)
|
)
|
||||||
self.app_icon = icon
|
try:
|
||||||
|
self.app_icon = res.load(resource)
|
||||||
|
except Exception:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
return
|
||||||
|
|
||||||
|
self.app_icon = res.load("apps/webauthn/res/icon_webauthn.toif")
|
||||||
|
|
||||||
|
|
||||||
class ConfirmContent(ui.Component):
|
class ConfirmContent(ui.Component):
|
||||||
|
Loading…
Reference in New Issue
Block a user