-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
test: fixtures key/certs cause failures when openssl security level > 1 #27862
Comments
I think at least some of the tests check that things like 1024 bits RSA still work. Your proposal would invalidate those and I don't think that's something we'll accept, you'd have to float a downstream patch for them. Everything else is fair game though. |
It looks like you could add |
#27962 landed so I think this can be closed out now? Please reopen if I'm mistaken. |
#27962 unfortunately does not solve this issue because it only brings the test certs under a makefile -- it doesn't change their generation parameters to be secure enough. Changing those generation parameters should be simpler now with #27962, and I'm still interested in working on this issue, but I don't have a prediction for when I can. |
No problem, I'll reopen. |
I compiled 12.13.0 from source code on a fresh install of Debian 10.1 with all OS updates applied. When running
CipherString sets a SECLEVEL of 2:
Kernel details:
If I can help resolve this, please get in touch with me. I'm a software developer, but not a node.js developer and I have no qualifications in C++ development, nor in openssl security contexts. I'm commenting mainly to document this issue occurs in Debian 10.1. I recently compiled 12.13.0 under Ubuntu 18.04.3 LTS and did not get similar errors from 'make test-only'. |
node tests use old and unrecommended crypto, on purpose, they are still supported even if not recommended. Could you try with |
I have the same problem with versions 12.13.1 and 13.2.0 on Debian. |
@andriy-simonov Yes, that's a valid way to test - it tests openssl in its default configuration (what 99% of all deployments probably use.) |
I'm running into this issue right now when building / testing on crostini (pixelbook). If this testing issue is widespread on mdoern versions of ubuntu (which have that security setting) should we perhaps consider changing some of the internals of what we do with make so that folks on linux can build / test without having to dig up this thread / set env vars? |
Could do so, but it could go awry, making things work for test, but then when people actually try it they don't work. Fwiw, I run ubuntu 19.10, and haven't run into any issues related to this. Maybe I will when I update to 20.10, but I'm not going to update to a 1 day old OS. :-) |
@sam-github If you mean 20.04, I upgraded yesterday and things work okay. :-) |
We've seen this on the CI on freshly installed Debian 10 and Fedora 34, which both set security level 2 and Node.js is picking up their |
In Debian testing, the latest openssl sets the default required security level to 2 in
/etc/ssl/openssl.cnf
(link). This requires (among other things, described here) that certs/keys be at least of a certain length depending on cipher.Some of the keys under
test/fixtures/
don't satisfy seclevel 2, and cause tests to fail when node's openssl reads thatopenssl.cnf
.Here's the output of
python tools/test.py -J -p tap --logfile=test.log
. 180 tests fail due to errors likeERR_SSL_EE_KEY_TOO_SMALL
.The issue can be avoided by changing the line
CipherString = DEFAULT@SECLEVEL=2
toCipherString = DEFAULT@SECLEVEL=1
in/etc/ssl/openssl.cnf
. However beware that this is globally reducing the required security on your machine.I figure that this issue can be solved by regenerating the troublesome keys/certs with a greater size -- probably 2048 bits for RSA/DSA/DH and 256 for ECC. I've been looking into this, and I would be happy to take a crack at it! The changes would be similar to #3759, and I think that it would also be good to move the certs under
test/fixtures/
to be undertest/fixtures/keys/
and generate them in the Makefile.The text was updated successfully, but these errors were encountered: