Blame SOURCES/001-remove-unused-frontend-crypto-and-patch-md4.patch

25018a
diff --git a/package.json b/package.json
25018a
index 9469638..d81424f 100644
25018a
--- a/package.json
25018a
+++ b/package.json
25018a
@@ -61,5 +61,9 @@
25018a
     "d3-scale": "^3.2.1",
25018a
     "d3-selection": "^1.4.1",
25018a
     "d3-transition": "^1.3.2"
25018a
+  },
25018a
+  "resolutions": {
25018a
+    "crypto-browserify": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz",
25018a
+    "http-signature": "https://registry.yarnpkg.com/@favware/skip-dependency/-/skip-dependency-1.1.1.tgz"
25018a
   }
25018a
 }
25018a
diff --git a/webpack.config.js b/webpack.config.js
25018a
index 00e171a..8997a9f 100644
25018a
--- a/webpack.config.js
25018a
+++ b/webpack.config.js
25018a
@@ -8,6 +8,13 @@ const ScriptExtHtmlWebpackPlugin = require('script-ext-html-webpack-plugin')
25018a
 const TerserPlugin = require('terser-webpack-plugin')
25018a
 const packageFile = require('./package.json')
25018a
 
25018a
+// monkey patch crypto module to not use deprecated md4 hash algorithm,
25018a
+// which is removed in OpenSSL 3.0
25018a
+// https://github.com/webpack/webpack/issues/13572#issuecomment-923736472
25018a
+const crypto = require("crypto");
25018a
+const crypto_orig_createHash = crypto.createHash;
25018a
+crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
25018a
+
25018a
 module.exports = [{
25018a
     context: path.join(__dirname, 'src'),
25018a
     entry: {
25018a
@@ -21,6 +28,9 @@ module.exports = [{
25018a
         libraryExport: 'default',
25018a
         libraryTarget: 'umd'
25018a
     },
25018a
+    node: {
25018a
+        crypto: false
25018a
+    },
25018a
     plugins: [
25018a
         new CopyWebpackPlugin([{
25018a
             from: 'flamegraph.css',
25018a
@@ -58,6 +68,9 @@ module.exports = [{
25018a
         library: ['flamegraph', '[name]'],
25018a
         libraryTarget: 'umd'
25018a
     },
25018a
+    node: {
25018a
+        crypto: false
25018a
+    },
25018a
     module: {
25018a
         rules: [{
25018a
             test: /\.js$/,
25018a
@@ -79,6 +92,9 @@ module.exports = [{
25018a
         path: path.resolve(__dirname, 'dist', 'templates'),
25018a
         filename: 'bundle.js'
25018a
     },
25018a
+    node: {
25018a
+        crypto: false
25018a
+    },
25018a
     plugins: [
25018a
         new CleanWebpackPlugin({
25018a
             protectWebpackAssets: false,