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": { "@mrmlnc/readdir-enhanced": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz",
@ -1908,6 +1924,11 @@
"chainsaw": "0.1.0" "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": { "bl": {
"version": "1.2.2", "version": "1.2.2",
"resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz", "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
@ -8953,11 +8974,6 @@
"integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
"dev": true "dev": true
}, },
"nan": {
"version": "2.7.0",
"resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz",
"integrity": "sha1-2Vv3IeyHfgjbJ27T/G63j5CDrUY="
},
"nanomatch": { "nanomatch": {
"version": "1.2.9", "version": "1.2.9",
"resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", "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", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz",
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" "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": { "seek-bzip": {
"version": "1.0.5", "version": "1.0.5",
"resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz", "resolved": "https://registry.npmjs.org/seek-bzip/-/seek-bzip-1.0.5.tgz",

View file

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

View file

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