From e4e6f81139364f60409ed412be2d3674738894a5 Mon Sep 17 00:00:00 2001 From: Thomas Leonard Date: Sat, 8 Oct 2011 12:42:08 +0100 Subject: [PATCH] If we get a bad line from GnuPG, log it instead of aborting Also, use no-auto-key-retrieve in case the user has turned that on in their configuration file (bug #3420548). --- zeroinstall/injector/gpg.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zeroinstall/injector/gpg.py b/zeroinstall/injector/gpg.py index 15c5dfa..95cf57f 100644 --- a/zeroinstall/injector/gpg.py +++ b/zeroinstall/injector/gpg.py @@ -258,6 +258,8 @@ def _check_xml_stream(stream): '--batch', # Windows GPG can only cope with "1" here '--status-fd', '1', + # Don't try to download missing keys; we'll do that + '--keyserver-options', 'no-auto-key-retrieve', '--verify', sig_name, '-'], stdin = data, stdout = subprocess.PIPE, @@ -303,7 +305,12 @@ def _get_sigs_from_gpg_status_stream(status_r, child, errors): for line in status_r: assert line.endswith('\n') - assert line.startswith('[GNUPG:] ') + if not line.startswith('[GNUPG:] '): + # The docs says every line starts with this, but if auto-key-retrieve + # is on then they might not. See bug #3420548 + warn("Invalid output from GnuPG: %r", line) + continue + line = line[9:-1] split_line = line.split(' ') code = split_line[0] -- 2.11.4.GIT