Skip to content
Snippets Groups Projects
Commit 287081b1 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

[fix] Login: Fix default Scrypt params

parent ed30f2ed
No related branches found
No related tags found
No related merge requests found
...@@ -369,9 +369,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -369,9 +369,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
var seed = that.scrypt.crypto_scrypt( var seed = that.scrypt.crypto_scrypt(
that.util.encode_utf8(password), that.util.encode_utf8(password),
that.util.encode_utf8(salt), that.util.encode_utf8(salt),
scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N, scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r, scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p, scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
that.constants.SEED_LENGTH); that.constants.SEED_LENGTH);
var signKeypair = that.nacl.crypto_sign_seed_keypair(seed); var signKeypair = that.nacl.crypto_sign_seed_keypair(seed);
var boxKeypair = that.nacl.crypto_box_seed_keypair(seed); var boxKeypair = that.nacl.crypto_box_seed_keypair(seed);
...@@ -393,9 +393,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -393,9 +393,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
var seed = that.scrypt.crypto_scrypt( var seed = that.scrypt.crypto_scrypt(
that.util.encode_utf8(password), that.util.encode_utf8(password),
that.util.encode_utf8(salt), that.util.encode_utf8(salt),
scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N, scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r, scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p, scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
that.constants.SEED_LENGTH); that.constants.SEED_LENGTH);
var signKeypair = that.nacl.crypto_sign_seed_keypair(seed); var signKeypair = that.nacl.crypto_sign_seed_keypair(seed);
resolve(signKeypair.signPk); resolve(signKeypair.signPk);
...@@ -551,9 +551,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -551,9 +551,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
that.nacl.crypto_pwhash_scryptsalsa208sha256_ll( that.nacl.crypto_pwhash_scryptsalsa208sha256_ll(
that.nacl.from_string(password), that.nacl.from_string(password),
that.nacl.from_string(salt), that.nacl.from_string(salt),
scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N, scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r, scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p, scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
that.constants.SEED_LENGTH, that.constants.SEED_LENGTH,
function (err, seed) { function (err, seed) {
if (err) { deferred.reject(err); return;} if (err) { deferred.reject(err); return;}
...@@ -590,9 +590,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services']) ...@@ -590,9 +590,9 @@ angular.module('cesium.crypto.services', ['cesium.utils.services'])
that.nacl.crypto_pwhash_scryptsalsa208sha256_ll( that.nacl.crypto_pwhash_scryptsalsa208sha256_ll(
that.nacl.from_string(password), that.nacl.from_string(password),
that.nacl.from_string(salt), that.nacl.from_string(salt),
scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.SIMPLE.N, scryptParams && scryptParams.N || that.constants.SCRYPT_PARAMS.DEFAULT.N,
scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.SIMPLE.r, scryptParams && scryptParams.r || that.constants.SCRYPT_PARAMS.DEFAULT.r,
scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.SIMPLE.p, scryptParams && scryptParams.p || that.constants.SCRYPT_PARAMS.DEFAULT.p,
that.constants.SEED_LENGTH, that.constants.SEED_LENGTH,
function (err, seed) { function (err, seed) {
if (err) { deferred.reject(err); return;} if (err) { deferred.reject(err); return;}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment