aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbackend/raw_write.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py
index 30b658c..1c1e216 100755
--- a/backend/raw_write.py
+++ b/backend/raw_write.py
@@ -145,12 +145,20 @@ class Dumper(object):
self.sum_check_searched = True
with open(sig_file, 'rb') as g:
self.signature_found = True
- verified = gpg.verify_file(g)
+ verified = gpg.verify_file(g, close_file=False)
if verified:
self.signature_checked = True
logging.debug("signature checked")
+ g.close()
else:
- self.signature_checked = False
+ g.seek(0)
+ verified = gpg.verify_file(g, self.source_file)
+ if verified:
+ self.signature_checked = True
+ logging.debug("Detached signature is OK")
+ else:
+ self.signature_checked = False
+ logging.debug("Signature is false")
except:
self.signature_found = False
logging.info(_("Signature file {} not found\n").format(sig_file))