def app_name(self) -> str:
        from apps.webauthn import knownapps

        app = knownapps.by_rp_id_hash(self.rp_id_hash)
        if app is not None:
            return app.label

        return self.rp_id
Esempio n. 2
0
    def load_icon(self, rp_id_hash: bytes) -> None:
        from trezor import res
        from apps.webauthn import knownapps

        fido_app = knownapps.by_rp_id_hash(rp_id_hash)
        if fido_app is not None and fido_app.icon is not None:
            self.app_icon = res.load(fido_app.icon)
        else:
            self.app_icon = res.load(DEFAULT_ICON)
Esempio n. 3
0
    def app_name(self) -> str:
        from apps.webauthn import knownapps

        app = knownapps.by_rp_id_hash(self.rp_id_hash)
        if app is not None:
            return app.label

        return "%s...%s" % (
            hexlify(self.rp_id_hash[:4]).decode(),
            hexlify(self.rp_id_hash[-4:]).decode(),
        )