From e54236d05715d952f030524df03b1d8c1f99e60e Mon Sep 17 00:00:00 2001 From: Erik Michelson Date: Mon, 26 Apr 2021 17:05:20 +0200 Subject: Remove unneeded polyfill This polyfill was added because node versions less than 10.5.0 didn't include scrypt support. As we now raised the minimum required version to 12.0.0, this polyfill isn't needed anymore. Signed-off-by: Erik Michelson --- lib/models/user.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/lib/models/user.js b/lib/models/user.js index 26a557a7..383be1a7 100644 --- a/lib/models/user.js +++ b/lib/models/user.js @@ -1,15 +1,6 @@ 'use strict' // external modules const Sequelize = require('sequelize') -const crypto = require('crypto') -if (!crypto.scrypt) { - // polyfill for node.js 8.0, see https://github.com/chrisveness/scrypt-kdf#openssl-implementation - const scryptAsync = require('scrypt-async') - crypto.scrypt = function (password, salt, keylen, options, callback) { - const opt = Object.assign({}, options, { dkLen: keylen }) - scryptAsync(password, salt, opt, (derivedKey) => callback(null, Buffer.from(derivedKey))) - } -} const scrypt = require('scrypt-kdf') // core -- cgit v1.2.3 From 0a1bf3ca1dd8c6558a13d27b389e7e96359a01b9 Mon Sep 17 00:00:00 2001 From: David Mehren Date: Mon, 26 Apr 2021 20:38:53 +0200 Subject: Uninstall scrypt-async Signed-off-by: David Mehren --- package.json | 1 - yarn.lock | 5 ----- 2 files changed, 6 deletions(-) diff --git a/package.json b/package.json index 3fe38654..8496ad13 100644 --- a/package.json +++ b/package.json @@ -115,7 +115,6 @@ "readline-sync": "^1.4.7", "reveal.js": "^3.9.2", "rimraf": "^3.0.2", - "scrypt-async": "^2.0.1", "scrypt-kdf": "^2.0.1", "select2": "^3.5.2-browserify", "sequelize": "^5.21.1", diff --git a/yarn.lock b/yarn.lock index 6f6a95c7..3447585b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9451,11 +9451,6 @@ script-loader@0.7.2: dependencies: raw-loader "~0.5.1" -scrypt-async@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/scrypt-async/-/scrypt-async-2.0.1.tgz#4318dae48a8b7cc3b8fe05f75f4164a7d973d25d" - integrity sha512-wHR032jldwZNy7Tzrfu7RccOgGf8r5hyDMSP2uV6DpLiBUsR8JsDcx/in73o2UGVVrH5ivRFdNsFPcjtl3LErQ== - scrypt-kdf@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/scrypt-kdf/-/scrypt-kdf-2.0.1.tgz#3355224c52d398331b2cbf2b70a7be26b52c53e6" -- cgit v1.2.3