From 580f14adb8a07b11769e7391c24755b5ace1cdc6 Mon Sep 17 00:00:00 2001 From: James Denton Date: Tue, 20 May 2025 19:37:14 +0000 Subject: [PATCH] Monkey patch createHash function as workaround for hardcoded md4 hash This patch modifies createHash at runtime to workaround hardcoded hashing algorithms (md4) in various Javascript modules that are no longer supported by default in OpenSSL included in Ubuntu 24.04 and possibly other operating systems. Allows for successful "yarn run build". Change-Id: I91a7ccb0a106256a0cbd40291b486c05502d9e05 --- config/webpack.common.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/config/webpack.common.js b/config/webpack.common.js index ca3b39f1..16bcb736 100644 --- a/config/webpack.common.js +++ b/config/webpack.common.js @@ -22,6 +22,11 @@ const { getGlobalVariables, getCustomStyleVariables } = require('./utils'); const root = (path) => resolve(__dirname, `../${path}`); const version = moment().unix(); +// (jamesdenton) Remove once libs no longer hardcode the hashing algorithm +const crypto = require("crypto"); +const crypto_orig_createHash = crypto.createHash; +crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "md5" : algorithm); + module.exports = { module: { rules: [