diff options
author | Papoteur <papoteur@mageia.org> | 2020-12-23 18:30:18 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageia.org> | 2020-12-23 18:30:18 +0100 |
commit | 59b94d431df1c7efc733cdd49bbc4b44a0153418 (patch) | |
tree | e7f4bd9ad04c3b8920fe5fd11b62ab8c5cdd740a /backend | |
parent | 0481230a0c998c553845354d2407232b46649741 (diff) | |
parent | 80de1c22c863634cd8dafbf2eb8416d60d2579de (diff) | |
download | isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.gz isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.bz2 isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.tar.xz isodumper-59b94d431df1c7efc733cdd49bbc4b44a0153418.zip |
Merge branch 'master' into topic/newgui
Diffstat (limited to 'backend')
-rwxr-xr-x | backend/raw_write.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/raw_write.py b/backend/raw_write.py index 154b2ad..fefa9b1 100755 --- a/backend/raw_write.py +++ b/backend/raw_write.py @@ -119,14 +119,15 @@ class Dumper(object): return ifc.close() self._progress = 100 - self.finished.set() self.return_state = True self.return_message = _("Writing terminated") logging.debug(self.return_message) + self.finished.set() return def _get_sum(self, source): self.return_state = False + self.signature_checked = FalseS logging.debug("Starting getting sum") # Check if the sum file has a valid signature gpg = gnupg.GPG() @@ -174,7 +175,6 @@ class Dumper(object): def _check_write(self, target, source): logging.debug("Start checking") - self.return_state = False self.return_message = "" b = os.path.getsize(source) # Compute the sum from the written device @@ -198,30 +198,32 @@ class Dumper(object): sha512func.update(block) sha512sumcalc=sha512func.hexdigest().upper() f.close() + self.return_state = True if self.signature_found and not self.signature_checked: #, keep the pourcent, this is the place for source file name self.return_message = _('Invalid signature for %s')%self.source_file + self.return_state = False if (self.sum_check == "") : # Can't get stored sum self.return_message += _('SHA3 sum: {}').format(sha512sumcalc) # compare the sums elif (sha512sumcalc == self.sum_check) : - if self.signature_checked: + if self.signature_checked and self.signature_found: #, keep the bracket, this is the place for sum type self.return_message +="\n" + _("The {} sum check is OK and the sum is signed").format(self.sum_type) else : if self.signature_found: self.return_message +="\n" + _("The signature of the sum is false !").format(self.sum_type) + self.return_state = False else: #, keep the bracket, this is the place for sum type self.return_message +="\n" + _("The {} sum check is OK but the signature can't be found").format(self.sum_type) else: self.return_message +="\n" + _("/!\\The computed and stored sums don't match") + self.return_state = False #except: #pass self._progress = 100 - logging.info(self.return_message) - self.return_state = True self.finished.set() def udev_wait(self, operation): |