test: fix invalid modulesLength during DSA keygen#23732
test: fix invalid modulesLength during DSA keygen#23732AdamMajer wants to merge 1 commit intonodejs:masterfrom
Conversation
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. Refs: nodejs#23430
|
Thanks @AdamMajer. Other than this, did the tests pass on FIPS? |
|
So far I've only run it with OpenSSL that has fips option enabled, but not on system running in FIPS mode. Having said that, all crypto related tests pass. |
| // Test async DSA key generation. | ||
| generateKeyPair('dsa', { | ||
| modulusLength: 256, | ||
| modulusLength: 512, |
There was a problem hiding this comment.
Looks good to me.
(UPDATE: Previous suggestion removed because I'm not actually sure it's correct and I don't have the ability to test it. It adds complexity anyway, so whatevs.)
There was a problem hiding this comment.
IIUC, openssl just internally increases 256 to 512 (when not FIPs), so always using 512 is no slower and more clear.
|
Resume Build CI: https://ci.nodejs.org/job/node-test-pull-request/17979/ ✔️ |
|
Landed in a88ca52. |
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. PR-URL: #23732 Refs: #23430 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. PR-URL: #23732 Refs: #23430 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. PR-URL: #23732 Refs: #23430 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. PR-URL: #23732 Refs: #23430 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
During key generation, the default dsa_builtin_paramgen will reset modulusLength to 512. But in dsa_builtin_paramgen2 this does not happen, leading to lockup in FIPS mode. PR-URL: #23732 Refs: #23430 Reviewed-By: Sam Roberts <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Tobias Nießen <[email protected]>
In #23430, key sizes were reduced to speed up the test. Unfortunately this resulted in invalid DSA key generation parameters.
In standard build of OpenSSL, key generation uses dsa_builtin_paramgen and that will reset modulusLength to 512. But in dsa_builtin_paramgen2, used in FIPS, this does not happen, leading to an infinite loop and test failure.
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes