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

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