Skip to content
Snippets Groups Projects
Verified Commit b847d0fa authored by drebs's avatar drebs
Browse files

[bug] encode key before using it in local blobs storage

parent a2a41830
Branches
Tags
No related merge requests found
Pipeline #
...@@ -20,6 +20,7 @@ Clientside BlobBackend Storage. ...@@ -20,6 +20,7 @@ Clientside BlobBackend Storage.
from urlparse import urljoin from urlparse import urljoin
import binascii
import errno import errno
import os import os
import base64 import base64
...@@ -297,7 +298,9 @@ class SQLiteBlobBackend(object): ...@@ -297,7 +298,9 @@ class SQLiteBlobBackend(object):
if not key: if not key:
raise ValueError('key cannot be None') raise ValueError('key cannot be None')
backend = 'pysqlcipher.dbapi2' 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) pragmafun = partial(pragmas.set_init_pragmas, opts=opts)
openfun = _sqlcipherInitFactory(pragmafun) openfun = _sqlcipherInitFactory(pragmafun)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment