From 4ba04fcbfd74f9b214c6dd25d82dad5a87cf8465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Stan=C4=9Bk?= Date: Wed, 13 Jul 2022 14:30:43 +0200 Subject: [PATCH] Disable unsupported OpenSSL features MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Disable no-certificate PSK authentication There is no obvious way to reimplement it using only OpenSSL 1.0 public APIs. - Disable queries for standard cipher name OpenSSL 1.0 does not record said names. - Remove ClientHello getters The disabled functions internally use `SSL_client_hello_get0_ext`/`SSL_client_hello_get0_ciphers`, which are not available on legacy OpenSSL. There may be another way to get to the same data, but nothing jumps out in the OpenSSL 1.0.2 documentation. - Remove TLSv1.3 CLI options - Remove usage of OPENSSL_secure_{malloc,clear_free} Unsupported in OpenSSL 1.0. The expected semantics is the same as using the regular versions, so the possibility of using the secure heap was simply removed. - Revert "src,deps,build,test: add OpenSSL config appname" This reverts commit 8e8aef836cb9807c9fe5ca350f1e7febdb40c3a7. Signed-off-by: Jan Staněk --- BUILDING.md | 14 ------ configure.py | 8 ---- doc/api/cli.md | 18 -------- doc/api/tls.md | 15 +++---- src/env.h | 11 ++++- src/node.cc | 43 ------------------- src/node_crypto.cc | 8 +++- src/node_crypto_common.cc | 12 ++++++ src/node_crypto_common.h | 6 +++ src/node_options.cc | 10 ++++- test/fixtures/openssl_fips_disabled.cnf | 2 +- test/fixtures/openssl_fips_enabled.cnf | 2 +- .../test-tls-cli-max-version-1.3.js | 0 .../test-tls-cli-min-max-conflict.js | 0 .../test-tls-cli-min-version-1.3.js | 0 test/parallel/test-crypto-fips.js | 2 +- 16 files changed, 53 insertions(+), 98 deletions(-) rename test/{parallel => known_issues}/test-tls-cli-max-version-1.3.js (100%) rename test/{parallel => known_issues}/test-tls-cli-min-max-conflict.js (100%) rename test/{parallel => known_issues}/test-tls-cli-min-version-1.3.js (100%) diff --git a/BUILDING.md b/BUILDING.md index 0ae3c09d99..5d2459eb76 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -52,7 +52,6 @@ file a new issue. * [Build with a specific ICU](#build-with-a-specific-icu) * [Unix/macOS](#unixmacos-3) * [Windows](#windows-4) -* [Configuring OpenSSL config appname](#configure-openssl-appname) * [Building Node.js with FIPS-compliant OpenSSL](#building-nodejs-with-fips-compliant-openssl) * [Building Node.js with external core modules](#building-nodejs-with-external-core-modules) * [Unix/macOS](#unixmacos-4) @@ -767,19 +766,6 @@ as `deps/icu` (You'll have: `deps/icu/source/...`) > .\vcbuild full-icu ``` -### Configure OpenSSL appname - -Node.js can use an OpenSSL configuration file by specifying the environment -variable `OPENSSL_CONF`, or using the command line option `--openssl-conf`, and -if none of those are specified will default to reading the default OpenSSL -configuration file `openssl.cnf`. Node.js will only read a section that is by -default named `nodejs_conf`, but this name can be overridden using the following -configure option: - -```console -$ ./configure --openssl-conf-name= -``` - ## Building Node.js with FIPS-compliant OpenSSL The current version of Node.js does not support FIPS. diff --git a/configure.py b/configure.py index 892e1d4202..2ea4eb69f5 100755 --- a/configure.py +++ b/configure.py @@ -176,12 +176,6 @@ parser.add_option("--link-module", "e.g. /root/x/y.js will be referenced via require('root/x/y'). " "Can be used multiple times") -parser.add_option("--openssl-conf-name", - action="store", - dest="openssl_conf_name", - default='nodejs_conf', - help="The OpenSSL config appname (config section name) used by Node.js") - parser.add_option('--openssl-default-cipher-list', action='store', dest='openssl_default_cipher_list', @@ -1343,8 +1337,6 @@ def configure_openssl(o): if options.openssl_no_asm: variables['openssl_no_asm'] = 1 - o['defines'] += ['NODE_OPENSSL_CONF_NAME=' + options.openssl_conf_name] - if options.without_ssl: def without_ssl_error(option): error('--without-ssl is incompatible with %s' % option) diff --git a/doc/api/cli.md b/doc/api/cli.md index ff5dff244e..61bac086bf 100644 --- a/doc/api/cli.md +++ b/doc/api/cli.md @@ -902,14 +902,6 @@ added: Set [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.2'. Use to disable support for TLSv1.3. -### `--tls-max-v1.3` - - -Set default [`tls.DEFAULT_MAX_VERSION`][] to 'TLSv1.3'. Use to enable support -for TLSv1.3. - ### `--tls-min-v1.0` - -Set default [`tls.DEFAULT_MIN_VERSION`][] to 'TLSv1.3'. Use to disable support -for TLSv1.2, which is not as secure as TLSv1.3. - ### `--trace-atomics-wait`