From b2942035a330fee99a12e9ac09861c91c7c30a2f Mon Sep 17 00:00:00 2001 From: Roman Zeyde Date: Thu, 20 Oct 2016 19:22:07 +0300 Subject: [PATCH] gpg: skip "progress" status messages --- trezor_agent/gpg/keyring.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/trezor_agent/gpg/keyring.py b/trezor_agent/gpg/keyring.py index 77cd110..22c35b4 100644 --- a/trezor_agent/gpg/keyring.py +++ b/trezor_agent/gpg/keyring.py @@ -158,7 +158,12 @@ def sign_digest(sock, keygrip, digest, sp=subprocess, environ=None): assert communicate(sock, 'SETKEYDESC ' 'Sign+a+new+TREZOR-based+subkey') == b'OK' assert communicate(sock, 'PKSIGN') == b'OK' - line = recvline(sock).strip() + while True: + line = recvline(sock).strip() + if line.startswith(b'S PROGRESS'): + continue + else: + break line = unescape(line) log.debug('unescaped: %r', line) prefix, sig = line.split(b' ', 1)