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(-) (limited to 'lib') 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