mirror of
https://github.com/cockpit-project/cockpit.git
synced 2026-11-03 21:49:50 -09:00
webpack: Avoid md4 hash for OpenSSL 3 compatibility
Fedora-36/CentOS/RHEL 9 switched to OpenSSL 3, which does not support the `md4` hash any more. webpack hardcodes that in a lot of places, so monkey-patch `crypto.createHash()` to substitute sha256 for md4. Hack to work around https://github.com/webpack/webpack/issues/13572 Cherry-picked from https://github.com/cockpit-project/starter-kit/commit/3220617fec508 This is solved in current webpack 5 versions, but we don't want to update this old stable branch to that.
This commit is contained in:
parent
6ecc2e73f6
commit
561c30cd31
1 changed files with 5 additions and 0 deletions
|
|
@ -255,6 +255,11 @@ var externals = {
|
|||
* Implementation
|
||||
*/
|
||||
|
||||
// HACK: OpenSSL 3 does not support md4 any more, but webpack hardcodes it all over the place: https://github.com/webpack/webpack/issues/13572
|
||||
const crypto = require("crypto");
|
||||
const crypto_orig_createHash = crypto.createHash;
|
||||
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);
|
||||
|
||||
var webpack = require("webpack");
|
||||
var copy = require("copy-webpack-plugin");
|
||||
var html = require('html-webpack-plugin');
|
||||
|
|
|
|||
Loading…
Reference in a new issue