summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-07-24 17:58:56 -0300
committerTomás Touceda <chiiph@leap.se>2014-07-25 11:38:49 -0300
commitdbfcb48a5d4d3aee80ed8dd7b20e61994ddbb667 (patch)
treeda90508f7004d3ce3df4b435b227dc680afb5500 /src
parent3a99419a4e55dd7675e5d57961bf42f2725251f1 (diff)
Disable user/pass remembering temporarily.
Set the keyring to None in order to simulate an always unavailable keyring, that way we avoid the possibility of the user running into the existing keyring issues. See https://leap.se/code/issues/4190 Update comparisons to do a proper comparison with `None`. Fix login widget 'enabled' changer in order to change the 'remember' widget *only* if we have an usable keyring.
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/gui/login.py3
-rw-r--r--src/leap/bitmask/util/keyring_helpers.py10
2 files changed, 9 insertions, 4 deletions
diff --git a/src/leap/bitmask/gui/login.py b/src/leap/bitmask/gui/login.py
index f66e71d9..baf29c23 100644
--- a/src/leap/bitmask/gui/login.py
+++ b/src/leap/bitmask/gui/login.py
@@ -216,7 +216,8 @@ class LoginWidget(QtGui.QWidget):
"""
self.ui.lnUser.setEnabled(enabled)
self.ui.lnPassword.setEnabled(enabled)
- self.ui.chkRemember.setEnabled(enabled)
+ if has_keyring():
+ self.ui.chkRemember.setEnabled(enabled)
self.ui.cmbProviders.setEnabled(enabled)
self._set_cancel(not enabled)
diff --git a/src/leap/bitmask/util/keyring_helpers.py b/src/leap/bitmask/util/keyring_helpers.py
index ee2d7a1c..0512d988 100644
--- a/src/leap/bitmask/util/keyring_helpers.py
+++ b/src/leap/bitmask/util/keyring_helpers.py
@@ -34,6 +34,10 @@ except Exception:
# dbus socket, or stuff like that.
keyring = None
+# XXX remember password disabled right now!
+# see: https://leap.se/code/issues/4190
+keyring = None
+
logger = logging.getLogger(__name__)
@@ -46,7 +50,7 @@ def _get_keyring_with_fallback():
This is a workaround for the cases in which the keyring module chooses
an insecure keyring by default (ie, inside a virtualenv).
"""
- if not keyring:
+ if keyring is None:
return None
kr = keyring.get_keyring()
if not canuse(kr):
@@ -67,7 +71,7 @@ def has_keyring():
:rtype: bool
"""
- if not keyring:
+ if keyring is None:
return False
kr = _get_keyring_with_fallback()
return canuse(kr)
@@ -79,7 +83,7 @@ def get_keyring():
:rtype: keyringBackend or None
"""
- if not keyring:
+ if keyring is None:
return False
kr = _get_keyring_with_fallback()
return kr if canuse(kr) else None