summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2014-12-15 15:55:25 -0200
committerdrebs <drebs@leap.se>2014-12-15 15:55:25 -0200
commita7abb6eb3fe9a0a904bcabd0bf344637e9fd4e62 (patch)
treebeb655c22404192f3d4cbd40141a23f69701945d
parentdafcfac4663d00ee2049b0a245c2ecb84ef2bad5 (diff)
Fix deferred enc/dec params and fallback (#6500).
-rw-r--r--client/changes/bug_6500_fix-deferred-enc-dec1
-rw-r--r--client/src/leap/soledad/client/__init__.py2
-rw-r--r--client/src/leap/soledad/client/sqlcipher.py5
-rw-r--r--client/src/leap/soledad/client/target.py3
4 files changed, 7 insertions, 4 deletions
diff --git a/client/changes/bug_6500_fix-deferred-enc-dec b/client/changes/bug_6500_fix-deferred-enc-dec
new file mode 100644
index 00000000..f3361507
--- /dev/null
+++ b/client/changes/bug_6500_fix-deferred-enc-dec
@@ -0,0 +1 @@
+ o Fix deferred encryption/decryption parameters (#6500).
diff --git a/client/src/leap/soledad/client/__init__.py b/client/src/leap/soledad/client/__init__.py
index c5832249..07255406 100644
--- a/client/src/leap/soledad/client/__init__.py
+++ b/client/src/leap/soledad/client/__init__.py
@@ -224,7 +224,7 @@ class Soledad(object):
def __init__(self, uuid, passphrase, secrets_path, local_db_path,
server_url, cert_file,
- auth_token=None, secret_id=None, defer_encryption=False):
+ auth_token=None, secret_id=None, defer_encryption=True):
"""
Initialize configuration, cryptographic keys and dbs.
diff --git a/client/src/leap/soledad/client/sqlcipher.py b/client/src/leap/soledad/client/sqlcipher.py
index 2df9606e..fded2119 100644
--- a/client/src/leap/soledad/client/sqlcipher.py
+++ b/client/src/leap/soledad/client/sqlcipher.py
@@ -452,6 +452,11 @@ class SQLCipherDatabase(sqlite_backend.SQLitePartialExpandDatabase):
# XXX could mark the critical section here...
try:
+ if defer_decryption and not self.defer_encryption:
+ logger.warning("Can't defer decryption without first having "
+ "created a sync db. Falling back to normal "
+ "syncing mode.")
+ defer_decryption = False
res = syncer.sync(autocreate=autocreate,
defer_decryption=defer_decryption)
diff --git a/client/src/leap/soledad/client/target.py b/client/src/leap/soledad/client/target.py
index 70e4d3a2..1eb84e64 100644
--- a/client/src/leap/soledad/client/target.py
+++ b/client/src/leap/soledad/client/target.py
@@ -28,12 +28,10 @@ import logging
import re
import urllib
import threading
-import urlparse
from collections import defaultdict
from time import sleep
from uuid import uuid4
-from contextlib import contextmanager
import simplejson as json
from taskthread import TimerTask
@@ -44,7 +42,6 @@ from u1db.remote.http_client import _encode_query_parameter, HTTPClientBase
from zope.proxy import ProxyBase
from zope.proxy import sameProxiedObjects, setProxiedObject
-from leap.soledad.common import soledad_assert
from leap.soledad.common.document import SoledadDocument
from leap.soledad.client.auth import TokenBasedAuth
from leap.soledad.client.crypto import is_symmetrically_encrypted