From 69f6cbee9493b661000e41202491f7200d164dca Mon Sep 17 00:00:00 2001 From: MeeseeksMachine <39504233+meeseeksmachine@users.noreply.github.com> Date: Fri, 8 Oct 2021 03:18:17 -0700 Subject: [PATCH] Backport PR #6197: Fix crypto handling (#6198) Co-authored-by: Steven Silvester --- webpack.config.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index 83c8a214ca..bdb252ffd3 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -1,4 +1,11 @@ const path = require('path'); +const crypto = require('crypto'); + +// Workaround for loaders using "md4" by default, which is not supported in FIPS-compliant OpenSSL +// See https://github.com/jupyterlab/jupyterlab/issues/11248 +const cryptoOrigCreateHash = crypto.createHash; +crypto.createHash = (algorithm) => + cryptoOrigCreateHash(algorithm == 'md4' ? 'sha256' : algorithm); module.exports = { entry: ['babel-polyfill', '@jupyterlab/apputils/lib/sanitizer'],