summaryrefslogtreecommitdiff
path: root/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
commitd4e139929f6353d9b587ef201bd693e1502ab9f0 (patch)
tree91acaea49422facae8e689f7fba1f87a643bb520 /backends
parent0799298acb902a7509f889bc01b22f610f8b0207 (diff)
Use doc_id with HMAC for symmetric encryption
Diffstat (limited to 'backends')
-rw-r--r--backends/leap.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/backends/leap.py b/backends/leap.py
index c019ed3f..9fbd49fe 100644
--- a/backends/leap.py
+++ b/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)