You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crypto: Resolve FIPS test failures and API issues #3760
The issue of FIPS-compliant encryption in Node.js has been brought up before and support for compiling with FIPS-compliant OpenSSL was added. The FIPS build instructions have recently been modified to insure compliance with FIPS 140-2 requirements.
However, running the Node.js test suite (“tools/test.py --verbose”) with the FIPS-compliant OpenSSL crypto module produces a large number of test failures. These failures are a significant roadblock to adoption of Node.js in real life applications requiring FIPS compliance, because it is unclear to prospective users if Node.js can actually work correctly in this mode.
I have spent some time debugging the test failures and have produced a series of pull requests to address them. These pull requests are split up under several “themes” below.
@Fishrock123 That's what I did at first, but I was afraid that some of the commits might be more controversial than others and I did not want to bog down all the trivial changes.
I can, of course, put them together in one PR if you'd prefer.
Thanks for your great work to have FIPS compliance in Node.
Before putting comments to each PR, I have two comments on overall PRs in genral.
The changes to add hasFipsCrypto are included in different commits of several PRs so that it causes conflicts in merging. I think it is better to be separated commit to easy to be cherry picked.
Checking for -fips in the version string is not a good way to detect FIPS mode, neither is OPENSSL_FIPS. See #3077. Can you instead use process.config.variables.openssl_fips and NODE_FIPS_MODE ?
All the linter errors are fixed, sorry about that - I completely forgot to run it, won't happen again!
I've also changed the code to use NODE_FIPS_MODE. I split out the common.js change into a separate commit that is shared by the PRs and changed its implementation to match @Nibbler999's suggestion.
Activity
Fishrock123 commentedon Nov 11, 2015
@nodejs/crypto
Fishrock123 commentedon Nov 11, 2015
@stefanmb heya, could those PRs just be done as separate commits in less (one?) pull request(s)? That would help a lot! :)
stefanmb commentedon Nov 11, 2015
@Fishrock123 That's what I did at first, but I was afraid that some of the commits might be more controversial than others and I did not want to bog down all the trivial changes.
I can, of course, put them together in one PR if you'd prefer.
bnoordhuis commentedon Nov 11, 2015
I think it's fine, maybe something for next time.
stefanmb commentedon Nov 11, 2015
@indutny @shigeki
indutny commentedon Nov 11, 2015
Reviewed, thanks for these! Please let me know when you'll fix the nits ;)
shigeki commentedon Nov 12, 2015
Thanks for your great work to have FIPS compliance in Node.
Before putting comments to each PR, I have two comments on overall PRs in genral.
hasFipsCryptoare included in different commits of several PRs so that it causes conflicts in merging. I think it is better to be separated commit to easy to be cherry picked.make jslintNibbler999 commentedon Nov 12, 2015
Checking for -fips in the version string is not a good way to detect FIPS mode, neither is OPENSSL_FIPS. See #3077. Can you instead use process.config.variables.openssl_fips and NODE_FIPS_MODE ?
shigeki commentedon Nov 13, 2015
@Nibbler999 Thanks. I did not know it and was surprised at even OPENSSL_FIPS not working.
@stefanmb We have to change all OPENSSL_FIPS into NODE_FIPS_MODE.
stefanmb commentedon Nov 13, 2015
@shigeki @Nibbler999 @indutny
All the linter errors are fixed, sorry about that - I completely forgot to run it, won't happen again!
I've also changed the code to use NODE_FIPS_MODE. I split out the common.js change into a separate commit that is shared by the PRs and changed its implementation to match @Nibbler999's suggestion.
Thank you everyone for your suggestions!
mhdawson commentedon Nov 23, 2015
All PR's have landed. Next step is to add build to CI that build/test in FIPs mode, opened this issue to track that: nodejs/build#264