diff --git a/libagent/gpg/agent.py b/libagent/gpg/agent.py index 92bb2d7..0079fe4 100644 --- a/libagent/gpg/agent.py +++ b/libagent/gpg/agent.py @@ -92,7 +92,7 @@ class Handler(object): b'OPTION': lambda _, args: self.handle_option(*args), b'SETKEYDESC': None, b'NOP': None, - b'GETINFO': lambda conn, _: keyring.sendline(conn, b'D ' + self.version), + b'GETINFO': self.handle_getinfo, b'AGENT_ID': lambda conn, _: keyring.sendline(conn, b'D TREZOR'), # "Fake" agent ID b'SIGKEY': lambda _, args: self.set_key(*args), b'SETKEY': lambda _, args: self.set_key(*args), @@ -115,6 +115,10 @@ class Handler(object): self.options.append(opt) log.debug('options: %s', self.options) + def handle_getinfo(self, conn, _args): + """Handle some of the GETINFO messages.""" + keyring.sendline(conn, b'D ' + self.version) + def handle_scd(self, conn, args): """No support for smart-card device protocol.""" reply = {