Skip to content

deps: update openssl to quictls/openssl 3.0.0+quic - #38512

Closed
danbev wants to merge 30 commits into
nodejs:masterfrom
danbev:openssl-3.0-statically-linked
Closed

deps: update openssl to quictls/openssl 3.0.0+quic#38512
danbev wants to merge 30 commits into
nodejs:masterfrom
danbev:openssl-3.0-statically-linked

Conversation

@danbev

@danbevdanbev commented May 3, 2021

Copy link
Copy Markdown
Contributor

This pull request updates the OpenSSL version that is statically linked with Node.js from OpenSSl 1.1.1 to quictls OpenSSL 3.0.0+quic.

This pull request will replace the OpenSSL version that is currently in the deps directory and when performing a normal build OpenSSL 3.0+quic will be statically linked to the Node.js executable. We will still be able to dynamically link to OpenSSL 1.1.1 and we have a CI job which dynamically links to OpenSSL 1.1.1 which is run for every pull request to make sure that we maintain backward compatibility.

The question is when does the community think that we should make this switch to OpenSSL 3.0+quic?


Building

$ ./configure && make -j8 test...[03:59|% 100|+ 3363|- 0]: Done

Verify that OpenSSL is statically linked

$ ldd ./node	linux-vdso.so.1 (0x00007ffff7fcf000)	libdl.so.2 => /usr/lib64/libdl.so.2 (0x00007ffff7f9d000)	libstdc++.so.6 => /usr/lib64/libstdc++.so.6 (0x00007ffff7da4000)	libm.so.6 => /usr/lib64/libm.so.6 (0x00007ffff7c5e000)	libgcc_s.so.1 => /usr/lib64/libgcc_s.so.1 (0x00007ffff7c44000)	libpthread.so.0 => /usr/lib64/libpthread.so.0 (0x00007ffff7c22000)	libc.so.6 => /usr/lib64/libc.so.6 (0x00007ffff7a59000)	/lib64/ld-linux-x86-64.so.2 (0x00007ffff7fd1000)
$ ./node -p 'process.versions.openssl'3.0.0+quic

Building with FIPS support

$ ./configure --openssl-is-fips && make -j8 test...[04:06|% 100|+ 3384|- 0]: Done

The above command will build and install the FIPS module into the out directory.
This includes building fips.so, running the installfips command that generates the FIPS configuration file (fipsmodule.cnf), copying and updating openssl.cnf to include the correct path to fipsmodule.cnf and finally uncomment the fips section.

We can then run node specifying --enable-fips:

$ ./node --enable-fips -p 'crypto.getFips()'1

The above will use the Node's default locations for OpenSSL 3.0:

$ ./out/Release/openssl-cli version -m -dOPENSSLDIR: "/home/danielbevenius/work/nodejs/openssl/out/Release/obj.target/deps/openssl"MODULESDIR: "/home/danielbevenius/work/nodejs/openssl/out/Release/obj.target/deps/openssl/lib/openssl-modules"

Hopefully having these defaults will enable for CI jobs to be configured without too much trouble, and also enable developers to configure FIPS for development/testing.

@github-actionsgithub-actionsBot added build Issues and PRs related to build files or the CI. meta Issues and PRs related to the general management of the project. needs-ci PRs that need a full CI run. openssl Issues and PRs related to the OpenSSL dependency. labels May 3, 2021
@danbevdanbev added dont-land-on-v12.x quic Issues and PRs related to the QUIC implementation / HTTP/3. labels May 3, 2021
@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from bcc569a to 2b5ef85CompareMay 3, 2021 16:30
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from 2b5ef85 to eaf8adcCompareMay 26, 2021 10:49
@danbevdanbev changed the title deps: update openssl to quictls/openssl 3.0.0-alpha15+quic (wip)deps: update openssl to quictls/openssl 3.0.0-alpha17+quic (wip)May 26, 2021
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from 04ac9e1 to d6fb5d7CompareMay 31, 2021 06:50
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from d6fb5d7 to d677da6CompareMay 31, 2021 11:34
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from d677da6 to 955920cCompareJune 1, 2021 05:57
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

danbev added a commit to danbev/openssl that referenced this pull request Jun 7, 2021
This commit adds an architecture named aix64-gcc-as which can generate
assembler source code compatible with AIX assembler (as) instead of the
GNU Assembler (gas). This architecture name is then used in a callback
for the .p2align directive which is not available in AIX as.
The motivation for this addition came out of an issue we ran into when
working on upgrading OpenSSL in Node.js. We ran into the following
compilation error on one of the CI machines that uses AIX:
05:39:05 Assembler:
05:39:05 crypto/bn/ppc64-mont-fixed.s: line 4: Error In Syntax
This machine is using AIX Version 7.2 and does not have gas installed
and the .p2align directive is causing this error. After asking around if
it would be possible to install GAS on this machine I learned that AIX
GNU utils are not maintained as well as the native AIX ones and we
(Red Hat/IBM) have run into issues with the GNU utils in the past and if
possible it would be preferable to be able to use the AIX native
assembler.
Refs: nodejs/node#38512
openssl-machine pushed a commit to openssl/openssl that referenced this pull request Jun 8, 2021
This commit adds an architecture named aix64-gcc-as which can generate
assembler source code compatible with AIX assembler (as) instead of the
GNU Assembler (gas). This architecture name is then used in a callback
for the .p2align directive which is not available in AIX as.
The motivation for this addition came out of an issue we ran into when
working on upgrading OpenSSL in Node.js. We ran into the following
compilation error on one of the CI machines that uses AIX:
05:39:05 Assembler:
05:39:05 crypto/bn/ppc64-mont-fixed.s: line 4: Error In Syntax
This machine is using AIX Version 7.2 and does not have gas installed
and the .p2align directive is causing this error. After asking around if
it would be possible to install GAS on this machine I learned that AIX
GNU utils are not maintained as well as the native AIX ones and we
(Red Hat/IBM) have run into issues with the GNU utils in the past and if
possible it would be preferable to be able to use the AIX native
assembler.
Refs: nodejs/node#38512
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from #15638)
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev

Copy link
Copy Markdown
ContributorAuthor

Just a note that node-test-linux-linked-openssl300 is expected to fail until it has our CI has been upgraded to alpha17 or later.

@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch 2 times, most recently from c75fdea to a8ff58aCompareJune 17, 2021 05:06
@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from ba291ca to a991d15CompareJune 23, 2021 10:15
@danbevdanbev changed the title deps: update openssl to quictls/openssl 3.0.0-alpha17+quic (wip)deps: update openssl to quictls/openssl 3.0.0-beta1+quic (wip)Jun 23, 2021
This commit updates the node_metadata.{cc,h} to include openssl/quic.h
which was recently added in quictls/openssl. Previously this was part of
the generated openssl/crypto.h but has been moved out in
Commit 5517e642fc2a531666c909aae0180e9d258d539e ("QUIC: Don't muck with
FIPS checksums")
This updates all sources in deps/openssl/openssl by:
$ git clone git@github.com:quictls/openssl.git
$ cd node/deps/openssl
$ rm -rf openssl
$ cp -R ../openssl openssl
$ rm -rf openssl/.git* openssl/.travis*
$ git add --all openssl
$ git commit openssl
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
$ make -C deps/openssl/config
$ git add deps/openssl/config/archs
$ git add deps/openssl/openssl
$ git commit
This commit updates the linux64-riscv64 arch files by running make
linux64-riscv64 followed by a make generate_headers so that these files
are generated for OpenSSL 3.0.
@danbev
danbevforce-pushed the openssl-3.0-statically-linked branch from 1107e17 to 07ded8bCompareOctober 10, 2021 13:47
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@danbev

Copy link
Copy Markdown
ContributorAuthor

Re-run of failing node-test-commit-arm-fanned ✔️

danbev added a commit that referenced this pull request Oct 11, 2021
This pull request updates the OpenSSL version that is statically
linked with Node.js from OpenSSl 1.1.1 to quictls OpenSSL 3.0.0+quic.
This pull request will replace the OpenSSL version that is currently
in the deps directory and when performing a normal build
OpenSSL 3.0+quic will be statically linked to the Node.js executable.
We will still be able to dynamically link to OpenSSL 1.1.1 and we have
a CI job which dynamically links to OpenSSL 1.1.1 which is run for
every pull request to make sure that we maintain backward compatibility.
PR-URL: #38512
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
@danbev

Copy link
Copy Markdown
ContributorAuthor

Landed in 66da32c.

@danbevdanbev closed this Oct 11, 2021
@BethGriggsBethGriggs mentioned this pull request Oct 14, 2021
2 tasks
@pimterrypimterry mentioned this pull request Jan 14, 2022
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

buildIssues and PRs related to build files or the CI.metaIssues and PRs related to the general management of the project.needs-ciPRs that need a full CI run.opensslIssues and PRs related to the OpenSSL dependency.quicIssues and PRs related to the QUIC implementation / HTTP/3.semver-majorPRs that contain breaking changes and should be released in the next major version.tsc-agendaIssues and PRs to discuss during the meetings of the TSC.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants

@danbev@nodejs-github-bot@richardlau@mhdawson@BethGriggs@tniessen@targos