Skip to content

Commit

Permalink
Merge pull request #13021 from brave/webpack-hash
Browse files Browse the repository at this point in the history
webpack: Replace md4 hash with 256-bit sha2.
  • Loading branch information
rillian authored Apr 19, 2022
2 parents 992208a + 786995b commit 6adc5b3
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,14 @@ const pathMap = require('./path-map')

const tsConfigPath = path.join(process.env.ROOT_GEN_DIR, 'tsconfig-webpack.json')

// OpenSSL 3 no longer supports the insecure md4 hash, but webpack < 6
// hardcodes it. Work around by substituting a supported algorithm.
// https://github.com/webpack/webpack/issues/13572
// https://github.com/webpack/webpack/issues/14532
const crypto = require("crypto");
const crypto_orig_createHash = crypto.createHash;
crypto.createHash = algorithm => crypto_orig_createHash(algorithm == "md4" ? "sha256" : algorithm);

module.exports = async function (env, argv) {
const isDevMode = argv.mode === 'development'
// Webpack config object
Expand Down

0 comments on commit 6adc5b3

Please sign in to comment.