aboutsummaryrefslogtreecommitdiffstats
path: root/backend/raw_write.py
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-12-18 21:51:05 +0100
committerPapoteur <papoteur@mageia.org>2020-12-18 22:08:50 +0100
commita5ff14b2e46f5270d06f970152d1c9e1fc40cee7 (patch)
treed6d3a259dd04e1901c7160466ba3701bbb2c7ca3 /backend/raw_write.py
parent13d33efae28b8828cc37e6bdfc5c30981f6d1ea2 (diff)
downloadisodumper-a5ff14b2e46f5270d06f970152d1c9e1fc40cee7.tar
isodumper-a5ff14b2e46f5270d06f970152d1c9e1fc40cee7.tar.gz
isodumper-a5ff14b2e46f5270d06f970152d1c9e1fc40cee7.tar.bz2
isodumper-a5ff14b2e46f5270d06f970152d1c9e1fc40cee7.tar.xz
isodumper-a5ff14b2e46f5270d06f970152d1c9e1fc40cee7.zip
Verify also detached signatures
Diffstat (limited to 'backend/raw_write.py')
-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))