summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2018-01-24 19:03:11 +0100
committerMichał Górny <mgorny@gentoo.org>2018-01-24 19:03:11 +0100
commitdcfafb4fe13dff9939bf1c09b948b4267f6bd518 (patch)
tree5fee7450a85f4f639404f3599529d3acad560334
parent3206c146831546f4e2b71c102bf2adaba00a9582 (diff)
downloadgemato-dcfafb4fe13dff9939bf1c09b948b4267f6bd518.tar.gz
openpgp: Refactor status processing not to stop on GOODSIG
-rw-r--r--gemato/openpgp.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/gemato/openpgp.py b/gemato/openpgp.py
index 6fa500a..051cfc1 100644
--- a/gemato/openpgp.py
+++ b/gemato/openpgp.py
@@ -63,15 +63,18 @@ class OpenPGPSystemEnvironment(object):
if exitst != 0:
raise gemato.exceptions.OpenPGPVerificationFailure(err.decode('utf8'))
+ is_good = False
+
# process the output of gpg to find the exact result
for l in out.splitlines():
if l.startswith(b'[GNUPG:] GOODSIG'):
- break
+ is_good = True
elif l.startswith(b'[GNUPG:] EXPKEYSIG'):
raise gemato.exceptions.OpenPGPExpiredKeyFailure(err.decode('utf8'))
elif l.startswith(b'[GNUPG:] REVKEYSIG'):
raise gemato.exceptions.OpenPGPRevokedKeyFailure(err.decode('utf8'))
- else:
+
+ if not is_good:
raise gemato.exceptions.OpenPGPUnknownSigFailure(err.decode('utf8'))
def clear_sign_file(self, f, outf, keyid=None):