summaryrefslogtreecommitdiff
path: root/src/leap/soledad/backends
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2012-12-20 11:35:19 -0200
committerdrebs <drebs@leap.se>2012-12-20 11:35:19 -0200
commit7161784fc65698e2603cf53e797dbd13711689e0 (patch)
treeeaa54667917b07f1ec6d16454814ad5086ee6183 /src/leap/soledad/backends
parent4cd81148ec25cd6f1a9498345c7405a4d37a4012 (diff)
Use doc_id with HMAC for symmetric encryption
Diffstat (limited to 'src/leap/soledad/backends')
-rw-r--r--src/leap/soledad/backends/leap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/soledad/backends/leap.py b/src/leap/soledad/backends/leap.py
index c019ed3f..9fbd49fe 100644
--- a/src/leap/soledad/backends/leap.py
+++ b/src/leap/soledad/backends/leap.py
@@ -37,7 +37,7 @@ class LeapDocument(Document):
"""
if not self._soledad:
raise NoSoledadInstance()
- ciphertext = self._soledad.encrypt_symmetric(self.get_json())
+ ciphertext = self._soledad.encrypt_symmetric(self.doc_id, self.get_json())
return json.dumps({'_encrypted_json' : ciphertext})
def set_encrypted_json(self, encrypted_json):
@@ -47,7 +47,7 @@ class LeapDocument(Document):
if not self._soledad:
raise NoSoledadInstance()
ciphertext = json.loads(encrypted_json)['_encrypted_json']
- plaintext = self._soledad.decrypt_symmetric(ciphertext)
+ plaintext = self._soledad.decrypt_symmetric(self.doc_id, ciphertext)
return self.set_json(plaintext)