aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2020-12-18 21:51:05 +0100
committerPapoteur <papoteur@mageia.org>2020-12-18 21:51:05 +0100
commitcec3757ea13d0b11a21adc7254f0ee0de645cce4 (patch)
tree074d129512ca1690007203eb6c35bf36bfa6a52d
parentaa582a3371dce09816aefc9285e9b4cbc0c827fe (diff)
downloadisodumper-cec3757ea13d0b11a21adc7254f0ee0de645cce4.tar
isodumper-cec3757ea13d0b11a21adc7254f0ee0de645cce4.tar.gz
isodumper-cec3757ea13d0b11a21adc7254f0ee0de645cce4.tar.bz2
isodumper-cec3757ea13d0b11a21adc7254f0ee0de645cce4.tar.xz
isodumper-cec3757ea13d0b11a21adc7254f0ee0de645cce4.zip
Verify also detached signatures
-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))