From 287081b12eb312a1b099d27f70a4e2396098de31 Mon Sep 17 00:00:00 2001
From: blavenie <benoit.lavenier@e-is.pro>
Date: Fri, 7 Jul 2017 21:34:29 +0200
Subject: [PATCH] [fix] Login: Fix default Scrypt params

---
 www/js/services/crypto-services.js | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/www/js/services/crypto-services.js b/www/js/services/crypto-services.js
index a0795d778..4ab376709 100644
--- a/www/js/services/crypto-services.js
+++ b/www/js/services/crypto-services.js
@@ -369,9 +369,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
           var seed = that.scrypt.crypto_scrypt(
             that.util.encode_utf8(password),
             that.util.encode_utf8(salt),
-            scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N,
-            scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r,
-            scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p,
+            scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
+            scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
+            scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
             that.constants.SEED_LENGTH);
           var signKeypair = that.nacl.crypto_sign_seed_keypair(seed);
           var boxKeypair = that.nacl.crypto_box_seed_keypair(seed);
@@ -393,9 +393,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
             var seed = that.scrypt.crypto_scrypt(
               that.util.encode_utf8(password),
               that.util.encode_utf8(salt),
-              scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N,
-              scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r,
-              scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p,
+              scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
+              scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
+              scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
               that.constants.SEED_LENGTH);
             var signKeypair = that.nacl.crypto_sign_seed_keypair(seed);
             resolve(signKeypair.signPk);
@@ -551,9 +551,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
         that.nacl.crypto_pwhash_scryptsalsa208sha256_ll(
           that.nacl.from_string(password),
           that.nacl.from_string(salt),
-          scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N,
-          scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r,
-          scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p,
+          scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
+          scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
+          scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
           that.constants.SEED_LENGTH,
           function (err, seed) {
             if (err) { deferred.reject(err); return;}
@@ -590,9 +590,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
         that.nacl.crypto_pwhash_scryptsalsa208sha256_ll(
           that.nacl.from_string(password),
           that.nacl.from_string(salt),
-          scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N,
-          scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r,
-          scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p,
+          scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
+          scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
+          scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
           that.constants.SEED_LENGTH,
           function (err, seed) {
             if (err) { deferred.reject(err); return;}
-- 
GitLab