summaryrefslogtreecommitdiff
path: root/service/pixelated/adapter
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-01-12 16:23:04 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-01-12 16:23:04 -0300
commit92d19ed855cda44d3fa10777020594d8b345ff18 (patch)
treed65ba282797f0679fd8f26388f2e190ad8a25db4 /service/pixelated/adapter
parent00803b97f39d6b213381f4698c3991d286c6d030 (diff)
card #227, replacing lib for debian compatibility: cryptography -> nacl
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r--service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py b/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py
index 6bc2ca2f..f8fed0aa 100644
--- a/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py
+++ b/service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py
@@ -14,7 +14,8 @@
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.
from pixelated.adapter.soledad.soledad_facade_mixin import SoledadDbFacadeMixin
-from cryptography.fernet import Fernet
+import nacl.secret
+import nacl.utils
class SoledadSearchIndexMasterkeyRetrievalMixin(SoledadDbFacadeMixin, object):
@@ -22,7 +23,7 @@ class SoledadSearchIndexMasterkeyRetrievalMixin(SoledadDbFacadeMixin, object):
def get_index_masterkey(self):
index_key = self.get_search_index_masterkey()
if len(index_key) == 0:
- index_key = Fernet.generate_key()
+ index_key = nacl.utils.random(nacl.secret.SecretBox.KEY_SIZE)
self.create_doc(dict(type='index_key', value=index_key))
return index_key
return str(index_key[0].content['value'])