From fcd56716261ee3308258d4a8196ac49f8171bdc0 Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Tue, 4 Oct 2016 23:11:12 +0300 Subject: [PATCH] Handle keyinfo request (#44) gpg: handle KEYINFO request See https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=agent/command.c;h=9522f898997e95207d59122d056f0f0be03ccecb;hb=6bee88dd067e03e7767ceacf6a849d9ba38cc11d#l1027 for more details. --- trezor_agent/gpg/agent.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/trezor_agent/gpg/agent.py b/trezor_agent/gpg/agent.py index cd6f8be..89e11de 100644 --- a/trezor_agent/gpg/agent.py +++ b/trezor_agent/gpg/agent.py @@ -127,6 +127,12 @@ def handle_connection(conn): elif command == 'PKDECRYPT': sec = pkdecrypt(keygrip, conn) keyring.sendline(conn, b'D ' + sec) + elif command == 'KEYINFO': + keygrip, = args + # Dummy reply (mainly for 'gpg --edit' to succeed). + # For details, see GnuPG agent KEYINFO command help. + fmt = b'S KEYINFO {0} X - - - - - - -' + keyring.sendline(conn, fmt.format(keygrip)) elif command == 'BYE': return else: