summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2017-05-01 22:25:58 +0200
committerdrebs <drebs@leap.se>2017-05-01 22:25:58 +0200
commitb847d0fa65a7bd4bb8b173ef2f8610512e788129 (patch)
tree0148d54d7bbb65b6199b4e2bc41a8af64f1566f4
parenta2a41830f72ae014d3b4dba591c6bfc85ffeb062 (diff)
[bug] encode key before using it in local blobs storage
-rw-r--r--client/src/leap/soledad/client/_database/blobs.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/src/leap/soledad/client/_database/blobs.py b/client/src/leap/soledad/client/_database/blobs.py
index 91914380..de0b2d08 100644
--- a/client/src/leap/soledad/client/_database/blobs.py
+++ b/client/src/leap/soledad/client/_database/blobs.py
@@ -20,6 +20,7 @@ Clientside BlobBackend Storage.
from urlparse import urljoin
+import binascii
import errno
import os
import base64
@@ -297,7 +298,9 @@ class SQLiteBlobBackend(object):
if not key:
raise ValueError('key cannot be None')
backend = 'pysqlcipher.dbapi2'
- opts = sqlcipher.SQLCipherOptions('/tmp/ignored', key)
+ opts = sqlcipher.SQLCipherOptions(
+ '/tmp/ignored', binascii.b2a_hex(key),
+ is_raw_key=True, create=True)
pragmafun = partial(pragmas.set_init_pragmas, opts=opts)
openfun = _sqlcipherInitFactory(pragmafun)