using @mlink/scrypt for node 10 compatibility

This commit is contained in:
azivner 2018-09-05 15:14:20 +02:00
parent bc669c7b81
commit 46f37f7426
3 changed files with 25 additions and 17 deletions

34
package-lock.json generated
View file

@ -502,6 +502,22 @@
}
}
},
"@mlink/scrypt": {
"version": "6.1.2",
"resolved": "https://registry.npmjs.org/@mlink/scrypt/-/scrypt-6.1.2.tgz",
"integrity": "sha512-7w1QoOih2eW0d0Lj5SK9mFV/8OhtZqYnT0IQiY/iCEcjdGAAt145YAAiq21iVV+H0Xe62fnF6VbZPMO3+qrSAQ==",
"requires": {
"bindings": "1.3.0",
"nan": "2.11.0"
},
"dependencies": {
"nan": {
"version": "2.11.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.11.0.tgz",
"integrity": "sha512-F4miItu2rGnV2ySkXOQoA8FKz/SR2Q2sWP0sbTxNxz/tuokeC8WxOhPMcwi0qIyGtVn/rrSeLbvVkznqCdwYnw=="
}
}
},
"@mrmlnc/readdir-enhanced": {
"version": "2.2.1",
"resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
@ -1908,6 +1924,11 @@
"chainsaw": "0.1.0"
}
},
"bindings": {
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/bindings/-/bindings-1.3.0.tgz",
"integrity": "sha512-DpLh5EzMR2kzvX1KIlVC0VkC3iZtHKTgdtZ0a3pglBZdaQFjt5S9g9xd1lE+YvXyfd6mtCeRnrUfOLYiTMlNSw=="
},
"bl": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
@ -8953,11 +8974,6 @@
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
"dev": true
},
"nan": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz",
"integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY="
},
"nanomatch": {
"version": "1.2.9",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz",
@ -11272,14 +11288,6 @@
"resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw=="
},
"scrypt": {
"version": "6.0.3",
"resolved": "https://registry.npmjs.org/scrypt/-/scrypt-6.0.3.tgz",
"integrity": "sha1-BOAUpWgrU/pQwtXM4WfXGcBthw0=",
"requires": {
"nan": "2.7.0"
}
},
"seek-bzip": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz",

View file

@ -60,7 +60,6 @@
"request-promise": "4.2.2",
"rimraf": "2.6.2",
"sanitize-filename": "1.6.1",
"scrypt": "6.0.3",
"serve-favicon": "2.5.0",
"session-file-store": "1.2.0",
"simple-node-logger": "0.93.37",
@ -69,7 +68,8 @@
"turndown": "^5.0.1",
"unescape": "1.0.1",
"ws": "6.0.0",
"xml2js": "0.4.19"
"xml2js": "0.4.19",
"@mlink/scrypt": "6.1.2"
},
"devDependencies": {
"electron": "2.0.7",

View file

@ -1,7 +1,7 @@
"use strict";
const optionService = require('./options');
const scrypt = require('scrypt');
const scrypt = require('@mlink/scrypt');
async function getVerificationHash(password) {
const salt = await optionService.getOption('passwordVerificationSalt');
@ -17,7 +17,7 @@ async function getPasswordDerivedKey(password) {
async function getScryptHash(password, salt) {
const hashed = scrypt.hashSync(password,
{N: 16384, r:8, p:1},
{N: 14, r:8, p:1},
32,
salt);