summaryrefslogtreecommitdiff
path: root/backends
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-02-19 20:32:36 -0300
committerdrebs <drebs@leap.se>2013-02-19 20:32:36 -0300
commit92bd7132c22b422039d2c1cfac42bec30e317d5d (patch)
tree18d1eb56a1f6f9728467eecd75dfba68eeb6d51d /backends
parent7f69a12085ed5958dd48b764a52203d23b66e669 (diff)
Fix encrypted document content transmission in sync.
Diffstat (limited to 'backends')
-rw-r--r--backends/leap_backend.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/backends/leap_backend.py b/backends/leap_backend.py
index f7b1becc..9a2f6a20 100644
--- a/backends/leap_backend.py
+++ b/backends/leap_backend.py
@@ -188,12 +188,13 @@ class LeapSyncTarget(HTTPSyncTarget):
for doc, gen, trans_id in docs_by_generations:
if doc.syncable:
# encrypt and verify before sending to server.
- enc_json = doc.get_encrypted_json()
+ enc_json = json.loads(
+ doc.get_encrypted_json())['_encrypted_json']
if not self._soledad.is_encrypted_sym(enc_json):
raise DocumentNotEncrypted(
"Could not encrypt document before sync.")
size += prepare(id=doc.doc_id, rev=doc.rev,
- content=enc_json,
+ content=doc.get_encrypted_json(),
gen=gen, trans_id=trans_id)
entries.append('\r\n]')
size += len(entries[-1])