mirror of
https://github.com/nodejs/node.git
synced 2026-11-30 11:55:44 -05:00
Use BoringSSL's current RSA and DH validation results instead of maintaining backend-specific prechecks and collapsing key errors. Report negotiated TLS groups and the documented zero security level through BoringSSL's compatibility APIs. Signed-off-by: Filip Skokan <panva.ip@gmail.com> PR-URL: https://github.com/nodejs/node/pull/65423 Backport-PR-URL: https://github.com/nodejs/node/pull/65483 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Tim Perry <pimterry@gmail.com>
23 lines
845 B
JavaScript
23 lines
845 B
JavaScript
// Flags: --expose-internals
|
|
'use strict';
|
|
|
|
const common = require('../common');
|
|
if (!common.hasCrypto)
|
|
common.skip('missing crypto');
|
|
|
|
const assert = require('assert');
|
|
|
|
// OpenSSL has a set of security levels which affect what algorithms
|
|
// are available by default. Different OpenSSL versions 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();
|
|
if (process.features.openssl_is_boringssl) {
|
|
assert.strictEqual(secLevel, 0);
|
|
} else {
|
|
assert.ok(secLevel >= 0 && secLevel <= 5);
|
|
}
|