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

Expose security levels #56601

Closed
wants to merge 4 commits into from
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
Prev Previous commit
Next Next commit
squash: address comments
Signed-off-by: Michael Dawson <midawson@redhat.com>
mhdawson committed Jan 27, 2025
commit 0b49c32a3b3288794ba2ea7f86afaa46861ba0a4
7 changes: 7 additions & 0 deletions test/parallel/test-crypto-sec-level.js
Original file line number Diff line number Diff line change
@@ -7,5 +7,12 @@ if (!common.hasCrypto)

const assert = require('assert');

// OpenSSL has a set of security levels which affect what algorithms
// are available by default. Different OpenSSL veresions have different
// default security levels and we use this value to adjust what a test
// expects based on the security level. You can read more in
// https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_security_level/#default-callback-behaviour
// This test simply validates that we can get some value for the secLevel
// when needed by tests.
const secLevel = require('internal/crypto/util').getOpenSSLSecLevel();
assert.ok(secLevel >= 0 && secLevel <= 5);
5 changes: 5 additions & 0 deletions test/parallel/test-tls-dhe.js
Original file line number Diff line number Diff line change
@@ -27,10 +27,15 @@
}

const {
hasOpenSSL,

Check failure on line 30 in test/parallel/test-tls-dhe.js

GitHub Actions / lint-js-and-md

'hasOpenSSL' is assigned a value but never used
opensslCli,
} = require('../common/crypto');

// OpenSSL has a set of security levels which affect what algorithms
// are available by default. Different OpenSSL veresions have different
// default security levels and we use this value to adjust what a test
// expects based on the security level. You can read more in
// https://docs.openssl.org/1.1.1/man3/SSL_CTX_set_security_level/#default-callback-behaviour
const secLevel = require('internal/crypto/util').getOpenSSLSecLevel();

if (!opensslCli) {