From a56877bef39b8c6c1f4f137c552e902ab315e6ec Mon Sep 17 00:00:00 2001 From: Jan Pochyla Date: Wed, 7 Jun 2017 12:10:35 +0200 Subject: [PATCH] apps.fido_u2f: remove needless async/await --- src/apps/fido_u2f/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/apps/fido_u2f/__init__.py b/src/apps/fido_u2f/__init__.py index 96e7ffea0..00666b69d 100644 --- a/src/apps/fido_u2f/__init__.py +++ b/src/apps/fido_u2f/__init__.py @@ -319,13 +319,13 @@ def handle_reports(iface: int): req = yield from read_cmd(iface) if req is None: continue - resp = yield from dispatch_cmd(req) + resp = dispatch_cmd(req) send_cmd(resp, iface) except Exception as e: log.exception(__name__, e) -async def dispatch_cmd(req: Cmd) -> Cmd: +def dispatch_cmd(req: Cmd) -> Cmd: if req.cmd == _CMD_MSG: m = req.to_msg() @@ -339,10 +339,10 @@ async def dispatch_cmd(req: Cmd) -> Cmd: if m.ins == _MSG_REGISTER: log.debug(__name__, '_MSG_REGISTER') - return await msg_register(m) + return msg_register(m) elif m.ins == _MSG_AUTHENTICATE: log.debug(__name__, '_MSG_AUTHENTICATE') - return await msg_authenticate(m) + return msg_authenticate(m) elif m.ins == _MSG_VERSION: log.debug(__name__, '_MSG_VERSION') return msg_version(m) @@ -458,7 +458,7 @@ _state = None # state for msg_register and msg_authenticate, None or ConfirmSta _lastreq = None # last received register/authenticate request, None or Req -async def msg_register(req: Msg) -> Cmd: +def msg_register(req: Msg) -> Cmd: global _state global _lastreq @@ -548,7 +548,7 @@ def msg_register_sign(challenge: bytes, app_id: bytes) -> bytes: return buf -async def msg_authenticate(req: Msg) -> Cmd: +def msg_authenticate(req: Msg) -> Cmd: global _state global _lastreq