Do not attempt to fetch private keys from server.
authordrebs <drebs@leap.se>
Fri, 17 May 2013 18:27:06 +0000 (15:27 -0300)
committerdrebs <drebs@leap.se>
Fri, 17 May 2013 18:27:06 +0000 (15:27 -0300)
changes/bug_fix-do-not-attempt-to-fetch-privkeys-from-server [new file with mode: 0644]
src/leap/common/keymanager/__init__.py

diff --git a/changes/bug_fix-do-not-attempt-to-fetch-privkeys-from-server b/changes/bug_fix-do-not-attempt-to-fetch-privkeys-from-server
new file mode 100644 (file)
index 0000000..4c8c0eb
--- /dev/null
@@ -0,0 +1 @@
+  o Fix attempt to fetch private keys from server.
index ab28510..3427f03 100644 (file)
@@ -192,7 +192,9 @@ class KeyManager(object):
         try:
             return self._wrapper_map[ktype].get_key(address, private=private)
         except KeyNotFound:
-            if fetch_remote is False:
+            # we will only try to fetch a key from nickserver if fetch_remote
+            # is True and the key is not private.
+            if fetch_remote is False or private is True:
                 raise
             # fetch keys from server and discard unwanted types.
             keys = filter(lambda k: isinstance(k, ktype),