From b847d0fa65a7bd4bb8b173ef2f8610512e788129 Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 1 May 2017 22:25:58 +0200 Subject: [bug] encode key before using it in local blobs storage --- client/src/leap/soledad/client/_database/blobs.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) -- cgit v1.2.3