Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
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
28 changes: 18 additions & 10 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,24 +206,22 @@ on your Linux distribution.

#### OpenSSL asm support

OpenSSL-1.1.1 requires the following assembler version for use of asm
OpenSSL requires the following assembler version for use of asm
support on x86\_64 and ia32.

For use of AVX-512,

* gas (GNU assembler) version 2.26 or higher
* nasm version 2.11.8 or higher in Windows

AVX-512 is disabled for Skylake-X by OpenSSL-1.1.1.

For use of AVX2,

* gas (GNU assembler) version 2.23 or higher
* Xcode version 5.0 or higher
* llvm version 3.3 or higher
* nasm version 2.10 or higher in Windows

Please refer to <https://docs.openssl.org/1.1.1/man3/OPENSSL_ia32cap/> for details.
Please refer to <https://docs.openssl.org/master/man3/OPENSSL_ia32cap/> for details.

If compiling without one of the above, use `configure` with the
`--openssl-no-asm` flag. Otherwise, `configure` will fail.
Expand Down Expand Up @@ -1044,14 +1042,20 @@ using the following configure option:

## Building Node.js with FIPS-compliant OpenSSL

Node.js supports FIPS when statically or dynamically linked with OpenSSL 3 via
[OpenSSL's provider model](https://docs.openssl.org/3.0/man7/crypto/#OPENSSL-PROVIDERS).
It is not necessary to rebuild Node.js to enable support for FIPS.
Node.js can use an OpenSSL FIPS provider via
[OpenSSL's provider model](https://docs.openssl.org/master/man7/crypto/#openssl-providers),
whether OpenSSL is linked statically or dynamically. It is not necessary to
rebuild Node.js to do so; the provider and the OpenSSL configuration that
activates it are supplied at runtime.

Node.js does not build a FIPS provider. OpenSSL requires that a FIPS provider
be built from a release that carries a FIPS certificate, so a provider built
as part of the Node.js build would have no validation status.

When using OpenSSL 1.1.1, Node.js must be built against a FIPS-capable OpenSSL.
`./configure --openssl-is-fips` only records that the OpenSSL being linked is
FIPS capable, and requires `--shared-openssl`.

See [FIPS mode](doc/api/crypto.md#fips-mode) for more information on how to
enable FIPS support in Node.js.
See [FIPS mode](doc/api/crypto.md#fips-mode) for how to configure it.

## Building Node.js with Temporal support

Expand Down Expand Up @@ -1135,6 +1139,10 @@ A number of `configure` options are provided to support this use case.
provide the ability to set the path to an external JavaScript file
for the dependency to be used at runtime.

When building with `--shared-openssl`, Node.js requires OpenSSL 3.0 or later.
Support for building against OpenSSL 1.x was removed in Node.js 27.0.0, and
`configure` fails if an older version is detected.

It is the responsibility of any distribution
shipping with these options to:

Expand Down
18 changes: 13 additions & 5 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,8 @@
action='store_true',
dest='openssl_is_fips',
default=None,
help='specifies that the OpenSSL library is FIPS compatible')
help='specifies that the shared OpenSSL library is FIPS capable '
'(requires --shared-openssl)')

parser.add_argument('--openssl-use-def-ca-store',
action='store_true',
Expand Down Expand Up @@ -2244,7 +2245,6 @@ def configure_openssl(o):
variables['node_shared_ngtcp2'] = b(options.shared_ngtcp2)
variables['node_shared_nghttp3'] = b(options.shared_nghttp3)
variables['openssl_is_fips'] = b(options.openssl_is_fips)
variables['node_fipsinstall'] = b(False)

if options.openssl_no_asm:
variables['openssl_no_asm'] = 1
Expand Down Expand Up @@ -2299,17 +2299,25 @@ def without_ssl_error(option):
if options.openssl_no_asm and options.shared_openssl:
error('--openssl-no-asm is incompatible with --shared-openssl')

if options.openssl_is_fips and not options.shared_openssl:
error('--openssl-is-fips is only available with --shared-openssl')

if options.openssl_is_fips:
o['defines'] += ['OPENSSL_FIPS']

if options.openssl_is_fips and not options.shared_openssl:
variables['node_fipsinstall'] = b(True)

configure_library('openssl', o)

o['variables']['openssl_version'] = get_openssl_version(o)
o['variables']['openssl_is_boringssl'] = get_openssl_is_boringssl(o)

# BoringSSL identifies itself as OpenSSL 1.1.1 and is exempt from this check.
# A version of 0 means detection failed, which is already warned about in
# get_openssl_version() and is caught at compile time by ncrypto.h.
openssl_version = o['variables']['openssl_version']
if o['variables']['openssl_is_boringssl'] == 'false' and \
0 < openssl_version < 0x30000000:
error('OpenSSL 1.x is no longer supported, v3.0.0 or later is required.')

def configure_lief(o):
if options.without_lief:
if options.shared_lief:
Expand Down
106 changes: 0 additions & 106 deletions deps/ncrypto/engine.cc

This file was deleted.

Loading