Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
test: add OpenSSL 3.0 checks to test-crypto-keygen
Currently test-crypto-keygen.js fails when dynamically linking against
OpenSSL 3.0 which the following error:
=== debug test-crypto-keygen ===
Path: parallel/test-crypto-keygen
node:assert:901
    throw newErr;
    ^
AssertionError [ERR_ASSERTION]: ifError got unwanted exception:
error:05000072:dsa routines::bad ffc parameters
at DsaKeyPairGenJob.<anonymous>
  (/nodejs/openssl/test/common/index.js:342:12)
at DsaKeyPairGenJob.<anonymous> (/openssl/test/common/index.js:379:15)
at DsaKeyPairGenJob.job.ondone (node:internal/crypto/keygen:77:23)
 {
  generatedMessage: false,
  code: 'ERR_ASSERTION',
  actual: [Error: error:05000072:dsa routines::bad ffc parameters],
  expected: null,
  operator: 'ifError'
}
Command: node /nodejs/openssl/test/parallel/test-crypto-keygen.js

This commit adds a check and adjusts the modulus length when linking
against OpenSSL 3.0.
  • Loading branch information
danbev committed Mar 22, 2021
commit 5b6adb5b74f8b445d2dee729440606b0cd8dbbdf
6 changes: 3 additions & 3 deletions test/parallel/test-crypto-keygen.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,20 +389,20 @@ const sec1EncExp = (cipher) => getRegExpForPEM('EC PRIVATE KEY', cipher);
{
// Test async DSA key object generation.
generateKeyPair('dsa', {
modulusLength: 512,
modulusLength: common.hasOpenSSL3 ? 2048 : 512,
divisorLength: 256
}, common.mustSucceed((publicKey, privateKey) => {
assert.strictEqual(publicKey.type, 'public');
assert.strictEqual(publicKey.asymmetricKeyType, 'dsa');
assert.deepStrictEqual(publicKey.asymmetricKeyDetails, {
modulusLength: 512,
modulusLength: common.hasOpenSSL3 ? 2048 : 512,
divisorLength: 256
});

assert.strictEqual(privateKey.type, 'private');
assert.strictEqual(privateKey.asymmetricKeyType, 'dsa');
assert.deepStrictEqual(privateKey.asymmetricKeyDetails, {
modulusLength: 512,
modulusLength: common.hasOpenSSL3 ? 2048 : 512,
divisorLength: 256
});
}));
Expand Down