From 4b4569fd9a041c0253671460cba4e0c225c27b79 Mon Sep 17 00:00:00 2001 From: Papoteur Date: Tue, 9 Jul 2019 13:51:44 +0200 Subject: Update checking to new signature method for Mageia 7. --- mageiaSync/mageiaSyncExt.py | 7 ++++--- mageiaSync/mageiasync.py | 9 ++++++++- 2 files changed, 12 insertions(+), 4 deletions(-) (limited to 'mageiaSync') diff --git a/mageiaSync/mageiaSyncExt.py b/mageiaSync/mageiaSyncExt.py index 6bdc0bd..88703f3 100644 --- a/mageiaSync/mageiaSyncExt.py +++ b/mageiaSync/mageiaSyncExt.py @@ -31,10 +31,11 @@ class checkThread(QThread): gpg = gnupg.GPG() gpg.encoding = 'utf-8' gpg.recv_keys('pgp.mit.edu', 'EDCA7A90') - sig_file = self.destination+'/'+self.path+'/'+self.name+'.'+sumType+'.gpg' + sum_file = self.destination+'/'+self.path+'/'+self.name+'.'+sumType + sig_file = sum_file +'.gpg' try: with open(sig_file, 'rb') as g: - verified = gpg.verify_file(g) + verified = gpg.verify_file(g,sum_file) if verified.valid: checkvalue=64 print('Valid signature') @@ -46,7 +47,7 @@ class checkThread(QThread): print('Signature file %s not found'%sig_file) checkvalue = 32 try: - fs=open(self.destination+'/'+self.path+'/'+self.name+'.'+sumType,'r') + fs=open(sum_file,'r') except: # reference file not found return checkvalue diff --git a/mageiaSync/mageiasync.py b/mageiaSync/mageiasync.py index 64674e2..743cac8 100644 --- a/mageiaSync/mageiasync.py +++ b/mageiaSync/mageiasync.py @@ -273,10 +273,14 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow): else: val=self.tr("Failed") row=check + if row >= 64: + verified=True + row -= 64 if row >=32: signed=False row-=32 if not signed: + print("Row: ", row) self.lvMessage("Signature for %s.md5 not found"%self.model.data(self.model.index(row,1))) if verified: # we add an icon for the GPG key @@ -299,6 +303,9 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow): else: val=self.tr("Failed") row=check + if row >= 64: + verified=True + row -= 64 if row >=32: signed=False row-=32 @@ -308,7 +315,7 @@ class IsosViewer(QMainWindow, mageiaSyncUI.Ui_mainWindow): if verified: # we add an icon for the GPG key self.lvMessage("Sha512 signature OK") - self.model.setData(self.model.index(row, 4, QtCore.QModelIndex()),QIcon("preflight-verifier"),1) + self.model.setData(self.model.index(row, 3, QtCore.QModelIndex()),QIcon("preflight-verifier"),1) self.model.setData(self.model.index(row, 3, QtCore.QModelIndex()), val) def sizeUpdate(self,signal,isoSize): -- cgit v1.2.1