[Pkg-privacy-commits] [torbrowser-launcher] 07/48: Refine import success conditions

Roger Shimizu rosh at moszumanska.debian.org
Mon Sep 4 16:42:31 UTC 2017


This is an automated email from the git hooks/post-receive script.

rosh pushed a commit to branch debian/sid
in repository torbrowser-launcher.

commit 89a3c5d4dfcc4065b64ba3bf03ceac3afa48ac3f
Author: Kajisav <dan at dephekt.net>
Date:   Sat Mar 4 04:22:01 2017 -0600

    Refine import success conditions
---
 torbrowser_launcher/common.py | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py
index 45fd042..5fe5d2b 100644
--- a/torbrowser_launcher/common.py
+++ b/torbrowser_launcher/common.py
@@ -196,16 +196,19 @@ class Common:
             # change home directory of current gpg context to torbrowser's gpg home
             c.set_engine_info(gpg.constants.protocol.OpenPGP, home_dir=self.paths['gnupg_homedir'])
             
-            # try to gpg import key data
+            # store import keyfile full path
             impkey = self.paths['signing_keys'][key]
+            # check the keyfile exists before importing
             if os.path.isfile(impkey):
                 c.op_import(gpg.Data(file=impkey))
             else:
                 print _("Signing key not found")
         
-            # store import results, if any then return result
+            # store import results, if any
             result = c.op_import_result()
-            if result:
+            # if op_import_results returned results and the expected fingerprint
+            # is matched in the results, return true. Otherwise return false.
+            if (result and self.fingerprints[key] in result.imports[0].fpr):
                 return True
             else:
                 return False

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list