diff options
Diffstat (limited to 'service/pixelated/adapter')
-rw-r--r-- | service/pixelated/adapter/soledad/soledad_search_key_masterkey_retrieval_mixin.py | 5 |
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']) |