summaryrefslogtreecommitdiff
path: root/client/src/leap/soledad
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-04-29 13:29:23 -0300
committerdrebs <drebs@leap.se>2014-05-22 18:43:48 -0300
commit8e750af78bd8f9a37d1b095712b66e6ecdb3e102 (patch)
tree91a5691cbfdd81d93a7b2b2a2da4cf3d91699833 /client/src/leap/soledad
parent5cb40a959af827e4eadde1c047664c4f4c0ae01d (diff)
Cleanup and pep8 fix.
Diffstat (limited to 'client/src/leap/soledad')
-rw-r--r--client/src/leap/soledad/client/__init__.py11
-rw-r--r--client/src/leap/soledad/client/shared_db.py4
2 files changed, 7 insertions, 8 deletions
diff --git a/client/src/leap/soledad/client/__init__.py b/client/src/leap/soledad/client/__init__.py
index 46e3cd5f..8881b422 100644
--- a/client/src/leap/soledad/client/__init__.py
+++ b/client/src/leap/soledad/client/__init__.py
@@ -720,8 +720,9 @@ class Soledad(object):
:return: the hash
:rtype: str
"""
- return sha256('%s%s' %
- (self._passphrase_as_string(), self.uuid)).hexdigest()
+ return sha256(
+ '%s%s' %
+ (self._passphrase_as_string(), self.uuid)).hexdigest()
def _get_secrets_from_shared_db(self):
"""
@@ -1211,7 +1212,6 @@ class Soledad(object):
"""
soledad_assert(self.STORAGE_SECRETS_KEY in data)
# check mac of the recovery document
- #mac_auth = False # XXX ?
mac = None
if MAC_KEY in data:
soledad_assert(data[MAC_KEY] is not None)
@@ -1234,7 +1234,6 @@ class Soledad(object):
if mac != data[MAC_KEY]:
raise WrongMac('Could not authenticate recovery document\'s '
'contents.')
- #mac_auth = True # XXX ?
# include secrets in the secret pool.
secrets = 0
for secret_id, secret_data in data[self.STORAGE_SECRETS_KEY].items():
@@ -1296,9 +1295,9 @@ class Soledad(object):
return self._passphrase.encode('utf-8')
-#-----------------------------------------------------------------------------
+# ----------------------------------------------------------------------------
# Monkey patching u1db to be able to provide a custom SSL cert
-#-----------------------------------------------------------------------------
+# ----------------------------------------------------------------------------
# We need a more reasonable timeout (in seconds)
SOLEDAD_TIMEOUT = 120
diff --git a/client/src/leap/soledad/client/shared_db.py b/client/src/leap/soledad/client/shared_db.py
index 0753cbb5..52e51c6f 100644
--- a/client/src/leap/soledad/client/shared_db.py
+++ b/client/src/leap/soledad/client/shared_db.py
@@ -30,9 +30,9 @@ from leap.soledad.common import SHARED_DB_LOCK_DOC_ID_PREFIX
from leap.soledad.client.auth import TokenBasedAuth
-#-----------------------------------------------------------------------------
+# ----------------------------------------------------------------------------
# Soledad shared database
-#-----------------------------------------------------------------------------
+# ----------------------------------------------------------------------------
class NoTokenForAuth(Exception):
"""