From d53fb8b1ed1149653db57a02339e2ac00bec608c Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 13 Jan 2015 17:28:14 -0300 Subject: for #227, nacl -> SoledadCrypto, since its already present --- .../adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'service/pixelated/adapter/soledad') 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 14472693..d2d6f416 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,8 +14,7 @@ # You should have received a copy of the GNU Affero General Public License # along with Pixelated. If not, see . from pixelated.adapter.soledad.soledad_facade_mixin import SoledadDbFacadeMixin -import nacl.secret -import nacl.utils +import os import base64 @@ -26,7 +25,7 @@ class SoledadSearchIndexMasterkeyRetrievalMixin(SoledadDbFacadeMixin, object): index_key_doc = result[0] if result else None if not index_key_doc: - new_index_key = nacl.utils.random(nacl.secret.SecretBox.KEY_SIZE) + new_index_key = os.urandom(32) self.create_doc(dict(type='index_key', value=base64.encodestring(new_index_key))) return new_index_key return base64.decodestring(index_key_doc.content['value']) -- cgit v1.2.3