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

Unable to run codeceptjs with nodejs version 18.8.0 on a FIPS mode enabled kernel system. #3973

Closed
nghiado opened this issue Nov 3, 2023 · 1 comment · Fixed by #3975 or #4038
Closed

Comments

@nghiado
Copy link

nghiado commented Nov 3, 2023

What are you trying to achieve?

Run CodeceptJS with NodeJS 18.18.0 on a FIPS mode enabled kernel system.

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

12:26:14  > ./node_modules/.bin/codeceptjs run --verbose --steps --reporter mocha-multi --grep @setup|@ftux
12:26:14  
12:26:15  Error: error:0308010C:digital envelope routines::unsupported
12:26:15      at new Hash (node:internal/crypto/hash:69:19)
12:26:15      at Object.createHash (node:crypto:133:10)
12:26:15      at module.exports.genTestId (/usr/src/app/node_modules/codeceptjs/lib/utils.js:14:28)
12:26:15      at /usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:50:22
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:427:14)
12:26:15      at /usr/src/app/node_modules/mocha/lib/suite.js:429:11
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:428:15)
12:26:15      at mocha.loadFiles (/usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:49:21)
12:26:15  
12:26:15  error:0308010C:digital envelope routines::unsupported
12:26:15  
12:26:15  Error: 
12:26:15      at new Hash (node:internal/crypto/hash:69:19)
12:26:15      at Object.createHash (node:crypto:133:10)
12:26:15      at module.exports.genTestId (/usr/src/app/node_modules/codeceptjs/lib/utils.js:14:28)
12:26:15      at /usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:50:22
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:427:14)
12:26:15      at /usr/src/app/node_modules/mocha/lib/suite.js:429:11
12:26:15      at Array.forEach (<anonymous>)
12:26:15      at Suite.eachTest (/usr/src/app/node_modules/mocha/lib/suite.js:428:15)
12:26:15      at mocha.loadFiles (/usr/src/app/node_modules/codeceptjs/lib/mochaFactory.js:49:21)
12:26:15  [Pipeline] echo

Details

  • CodeceptJS version: 3.4.1
  • NodeJS Version: 18.18.0
  • Operating System: Linux (amd64/amazonlinux:2023)
  • Puppeteer 18.0.0

NodeJS 18.18.0 include a FIPS related change that seems likely to be the cause of this issues: https://github.com/nodejs/node/pull/48392/files
https://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V18.md#18.18.0

the change in NodeJS 18.18.0 appears to essentially enable fips support in nodejs, and it then exposes codeceptjs attempting to use md5: https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/utils.js#L14

[utils.js](https://github.com/codeceptjs/CodeceptJS/blob/3.x/lib/utils.js)
  return require('crypto').createHash('md5').update(test.fullTitle()).digest('base64')

replacing md5 with sha256 does appear to allow this to run, so we need some help to update codeceptjs library utils.js to allow running codecepjs on a FIPS mode enabled kernel system.

@nartz
Copy link

nartz commented Nov 28, 2023

Do any of these other references to md5 also need to be patched? https://github.com/search?q=repo%3Acodeceptjs%2FCodeceptJS%20%27md5%27&type=code

@kobenguyent kobenguyent mentioned this issue Nov 29, 2023
5 tasks
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 a pull request may close this issue.

2 participants