Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use xxhash64 hash function to fix OpenSSL 3 error #264

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

eagletmt
Copy link
Contributor

@eagletmt eagletmt commented Aug 2, 2023

Webpack 5 uses md4 hash function as default, but OpenSSL 3 doesn't support the legacy hash function and results in ERR_OSSL_EVP_UNSUPPORTED error.

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:144:18)
    at BulkUpdateDecorator.update (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:838:17)
    at handleParseResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:903:10)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:994:4
    at processResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:717:11)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:777:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Webpack added a new function xxhash64 and it will be used as default in future.
https://webpack.js.org/configuration/output/#outputhashfunction
So I chose this hash function.

Webpack 5 uses `md4` hash function as default, but OpenSSL 3 doesn't
support the legacy hash function and results in ERR_OSSL_EVP_UNSUPPORTED
error.

```
Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:130:10)
    at BulkUpdateDecorator.hashFactory (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:144:18)
    at BulkUpdateDecorator.update (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/util/createHash.js:46:50)
    at RawSource.updateHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/node_modules/webpack-sources/lib/RawSource.js:64:8)
    at NormalModule._initBuildHash (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:838:17)
    at handleParseResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:903:10)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:994:4
    at processResult (/build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:717:11)
    at /build/bdash/src/bdash-1.16.2/node_modules/webpack/lib/NormalModule.js:777:5 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
```

Webpack added a new function `xxhash64` and it will be used as default
in future.
https://webpack.js.org/configuration/output/#outputhashfunction
So I chose this hash function.
Copy link
Collaborator

@morishin morishin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!👍

@morishin morishin merged commit b3d9db5 into bdash-app:master Aug 4, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants