diff options
author | Papoteur <papoteur@mageialinux-online.org> | 2016-12-18 13:46:39 +0100 |
---|---|---|
committer | Papoteur <papoteur@mageialinux-online.org> | 2016-12-18 13:46:39 +0100 |
commit | 908f95f2726663b1cb012eb9d63aa9b154ce5767 (patch) | |
tree | c8613c10be1ff439085969d5cce649b97812ea35 /mageiaSync/mageiaSyncExt.py | |
parent | e2fa703a83bb6a0137358c2bbd776441dd145b31 (diff) | |
download | MageiaSync-908f95f2726663b1cb012eb9d63aa9b154ce5767.tar MageiaSync-908f95f2726663b1cb012eb9d63aa9b154ce5767.tar.gz MageiaSync-908f95f2726663b1cb012eb9d63aa9b154ce5767.tar.bz2 MageiaSync-908f95f2726663b1cb012eb9d63aa9b154ce5767.tar.xz MageiaSync-908f95f2726663b1cb012eb9d63aa9b154ce5767.zip |
Change the logic on checking the signing
If signed and checking fails, not perform the sum, say failed.
Add messages on standard ouput
Diffstat (limited to 'mageiaSync/mageiaSyncExt.py')
-rw-r--r-- | mageiaSync/mageiaSyncExt.py | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/mageiaSync/mageiaSyncExt.py b/mageiaSync/mageiaSyncExt.py index 4abbee6..23c5d3b 100644 --- a/mageiaSync/mageiaSyncExt.py +++ b/mageiaSync/mageiaSyncExt.py @@ -37,8 +37,19 @@ class checkThread(QThread): verified = gpg.verify_file(g) if verified.valid: checkvalue=64 + print('Valid signature') + else: + print('Invalid signature for %s'%self.name+'.'+sumType) + print(verified.key_status) + return 0 except: print('Signature file %s not found'%sig_file) + checkvalue = 32 + try: + fs=open(self.destination+'/'+self.path+'/'+self.name+'.'+sumType,'r') + except: + # reference file not found + return checkvalue try: with open(self.destination+'/'+self.path+'/'+self.name, 'rb') as f: while True: @@ -48,11 +59,6 @@ class checkThread(QThread): sumcalc=hashfunc.hexdigest() except: return checkvalue - try: - fs=open(self.destination+'/'+self.path+'/'+self.name+'.'+sumType,'r') - except: - # reference file not found - return checkvalue sumcheck=(fs.readline()).split()[0] if sumcalc==sumcheck: checkvalue += 128 |