summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--changes/bug_3759-fix-keyring-imports1
-rw-r--r--pkg/requirements.pip3
-rw-r--r--src/leap/bitmask/app.py25
-rw-r--r--src/leap/bitmask/util/keyring_helpers.py19
4 files changed, 42 insertions, 6 deletions
diff --git a/changes/bug_3759-fix-keyring-imports b/changes/bug_3759-fix-keyring-imports
new file mode 100644
index 00000000..ed489633
--- /dev/null
+++ b/changes/bug_3759-fix-keyring-imports
@@ -0,0 +1 @@
+ o Fix keyring imports so we do not get import errors. Closes: #3759
diff --git a/pkg/requirements.pip b/pkg/requirements.pip
index 081f3ba9..ce93b2ef 100644
--- a/pkg/requirements.pip
+++ b/pkg/requirements.pip
@@ -16,8 +16,7 @@ twisted
qt4reactor
python-gnupg
python-daemon # this should not be needed for Windows.
-
-keyring<=2.9 # See #3759
+keyring
leap.common>=0.3.2
leap.soledad.client>=0.3.0
diff --git a/src/leap/bitmask/app.py b/src/leap/bitmask/app.py
index 8c839edc..dae6b357 100644
--- a/src/leap/bitmask/app.py
+++ b/src/leap/bitmask/app.py
@@ -14,6 +14,31 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# M:::::::MMMMMMMMMM~:::::::::::::::::::::::::::::::::::::~MMMMMMMMMM~:::::::M
+# M:::::MMM$$$$$77$MMMMN~:::::::::::::::::::::::::::::~NMMMM$77$$$$$MMM::::::M
+# M:::~MMZ$$$$$777777I8MMMM~:::::::::::::::::::::::~MMMMDI777777$$$$$$MM:::::M
+# M:::MMZ$$$$$777777IIIIIZMMMM:::::::::::::::::::MMNMZIIIII777777$$$$$$MM::::M
+# M::DMN$$$$$777777IIIIIII??7DDNM+:::::::::::=MDDD7???IIIIII777777$$$$$DMN:::M
+# M::MM$$$$$7777777IIIIIII????+?88OOMMMMMMMOO88???????IIIIIII777777$$$$$MM:::M
+# M::MM$$$$$777777IIIIIIII??????++++7ZZ$$ZI+++++??????IIIIIIII777777$$$$MM~::M
+# M:~MM$$$$77777Z8OIIIIIIII??????++++++++++++++??????IIIIIIIO8Z77777$$$$NM+::M
+# M::MM$$$777MMMMMMMMMMMZ?II???????+++++++++???????III$MMMMMMMMMMM7777$$DM$::M
+# M:~MM$$77MMMI~::::::$MMMM$?I????????????????????I$MMMMZ~::::::+MMM77$$MM~::M
+# M::MM$7777MM::::::::::::MMMMI?????????????????IMMMM:::::::::::~MM7777$MM:::M
+# M::MM777777MM~:::::::::::::MMMD?I?????????IIDMMM,:::::::::::::MM777777MM:::M
+# M::DMD7777IIMM$::::::::::::?MMM?I??????????IMMM$::::::::::::7MM7I77778MN:::M
+# M:::MM777IIIIMMMN~:::::::MMMM?II???+++++????IIMMMM::::::::MMMMIIII777MM::::M
+# M:::ZMM7IIIIIIIOMMMMMMMMMMZ?III???++++++++??III?$MMMMMMMMMMO?IIIIII7MMO::::M
+# M::::MMDIIIIIIIIII?IIIII?IIIII???+++===++++??IIIIIIII?II?IIIIIIIIII7MM:::::M
+# M:::::MM7IIIIIIIIIIIIIIIIIIIII??+++IZ$$I+++??IIIIIIIIIIIIIIIIIIIII7MM::::::M
+# M::::::MMOIIIIIIIIIIIIIIIIIIII?D888MMMMM8O8D?IIIIIIIIIIIIIIIIIIII$MM:::::::M
+# M:::::::MMM?IIIIIIIIIIIIIIII7MNMD:::::::::OMNM$IIIIIIIIIIIIIIII?MMM::::::::M
+# M::::::::NMMI?IIIIIIIIIII?OMMM:::::::::::::::MMMO?IIIIIIIIIIIIIMMN:::::::::M
+# M::::::::::MMMIIIIIIIII?8MMM:::::::::::::::::::MMM8IIIIIIIIIIMMM:::::::::::M
+# M:::::::::::~NMMM7???7MMMM:::::::::::::::::::::::NMMMI??I7MMMM:::::::::::::M
+# M::::::::::::::7MMMMMMM+:::::::::::::::::::::::::::?MMMMMMMZ:::::::::::::::M
+# (thanks to: http://www.glassgiant.com/ascii/)
import logging
import signal
diff --git a/src/leap/bitmask/util/keyring_helpers.py b/src/leap/bitmask/util/keyring_helpers.py
index 8f354f28..4b3eb57f 100644
--- a/src/leap/bitmask/util/keyring_helpers.py
+++ b/src/leap/bitmask/util/keyring_helpers.py
@@ -14,16 +14,21 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
"""
Keyring helpers.
"""
+import logging
import keyring
+from keyring.backends.file import EncryptedKeyring, PlaintextKeyring
+
+logger = logging.getLogger(__name__)
+
+
OBSOLETE_KEYRINGS = [
- keyring.backends.file.EncryptedKeyring,
- keyring.backends.file.PlaintextKeyring
+ EncryptedKeyring,
+ PlaintextKeyring
]
@@ -34,4 +39,10 @@ def has_keyring():
:rtype: bool
"""
kr = keyring.get_keyring()
- return kr is not None and kr.__class__ not in OBSOLETE_KEYRINGS
+ klass = kr.__class__
+ logger.debug("Selected keyring: %s" % (klass,))
+
+ canuse = kr is not None and klass not in OBSOLETE_KEYRINGS
+ if not canuse:
+ logger.debug("Not using this keyring since it is obsolete")
+ return canuse