summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-11-24 11:57:08 +0100
committerRuben Pollan <meskio@sindominio.net>2017-12-03 20:43:30 +0100
commit95f8a39c2185d9cc3af4e6ed600aea98c13d1949 (patch)
tree56f32930c381ded6326c9f78d839fad4b6be56c0
parent0454dc3545693a8c6325f4864d89154c514b3bcb (diff)
[feat] supplying gpgbinary when building gpg key from dict
-rw-r--r--src/leap/bitmask/keymanager/keys.py6
-rw-r--r--src/leap/bitmask/keymanager/openpgp.py7
2 files changed, 10 insertions, 3 deletions
diff --git a/src/leap/bitmask/keymanager/keys.py b/src/leap/bitmask/keymanager/keys.py
index 7e8d8ead..6aca0320 100644
--- a/src/leap/bitmask/keymanager/keys.py
+++ b/src/leap/bitmask/keymanager/keys.py
@@ -49,7 +49,7 @@ def is_address(address):
return bool(re.match('[\w.-]+@[\w.-]+', address))
-def build_key_from_dict(key, active=None):
+def build_key_from_dict(key, active=None, gpgbinary=None):
"""
Build an OpenPGPKey key based on info in C{kdict}.
@@ -57,6 +57,9 @@ def build_key_from_dict(key, active=None):
:type key: dict
:param active: Dictionary with active data.
:type active: dict
+ :param gpgbinary: Name for GnuPG binary executable.
+ :type gpgbinary: C{str}
+
:return: An instance of the key.
:rtype: C{kClass}
"""
@@ -94,6 +97,7 @@ def build_key_from_dict(key, active=None):
validation=validation,
encr_used=encr_used,
sign_used=sign_used,
+ gpgbinary=gpgbinary,
)
diff --git a/src/leap/bitmask/keymanager/openpgp.py b/src/leap/bitmask/keymanager/openpgp.py
index 593536eb..d82f8e52 100644
--- a/src/leap/bitmask/keymanager/openpgp.py
+++ b/src/leap/bitmask/keymanager/openpgp.py
@@ -332,10 +332,13 @@ class OpenPGPScheme(object):
else:
key = yield self._repair_key_docs(fp_keys)
key.content[HAS_ACTIVE] = True
- keys.append(build_key_from_dict(key.content, active.content))
+ keys.append(build_key_from_dict(key.content, active.content,
+ gpgbinary=self._gpgbinary))
unactive_keys = filter(lambda k: HAS_ACTIVE not in k.content, key_docs)
- keys += map(lambda k: build_key_from_dict(k.content), unactive_keys)
+ keys += map(lambda k: build_key_from_dict(k.content,
+ gpgbinary=self._gpgbinary),
+ unactive_keys)
defer.returnValue(keys)
def parse_key(self, key_data, address=None):