Commit Graph

343 Commits

Author SHA1 Message Date
RafaelGSS
3f0db60258 deps: clean archs files for OpenSSL
After an OpenSSL source update, all the config files need to be
 regenerated and committed by:
    $ make -C deps/openssl/config clean
    $ make -C deps/openssl/config
    $ git add deps/openssl/config/archs
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/43735
Fixes: https://github.com/nodejs/node/issues/43667
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-07-15 15:46:22 -03:00
RafaelGSS
fabe8a47ee deps: remove not used architectures
PR-URL: https://github.com/nodejs/node/pull/43735
Fixes: https://github.com/nodejs/node/issues/43667
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-07-15 15:46:14 -03:00
RafaelGSS
91fe38e6ab deps: update archs files for quictls/openssl-3.0.5+quic
After an OpenSSL source update, all the config files need to be
regenerated and committed by:
    $ find archs \( -name \*.s \) -exec rm "{}" \;
    Edit deps/openssl/openssl/crypto/perlasm/x86asm.pl changing #ifdef
    to %ifdef to make it compatible to nasm on windows 32.
    $ make -C deps/openssl/config
    $ git add deps/openssl/config/archs
    $ git add deps/openssl/openssl
    $ git commit

Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/43693
2022-07-07 13:20:34 -03:00
RafaelGSS
05d8a5f232 deps: upgrade openssl sources to quictls/openssl-3.0.5+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ git checkout openssl-3.0.5+quic
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../../../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs/node/pull/43693
2022-07-07 13:20:26 -03:00
Michael Dawson
46093c45e2 deps: update default openssl.cnf directory
Update default openssl.cnf directory on linux to be consistent with
older versions

Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: RafaelGSS <rafael.nunu@hotmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
PR-URL: https://github.com/nodejs-private/node-private/pull/335
CVE-ID: CVE-2022-32222
2022-07-07 13:20:06 -03:00
Daniel Bevenius
f5a5df4802 src,deps,build,test: add OpenSSL config appname
This commit adds the setting of an appname (configuration section
name), 'nodejs_conf', to be used when reading OpenSSL configuration
files.

The motivation for this is that currently the default OpenSSL
configuration, 'openssl_conf', element will be used which may be
undesirable as it might configure OpenSSL in unwanted ways. With this
commit it is still possible to use a default openssl.cnf file but the
only section that Node.js will read from is a section named
'nodejs_conf'.

PR-URL: https://github.com/nodejs/node/pull/43124
Refs: https://github.com/nodejs/node/issues/40366
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2022-05-31 13:41:30 +02:00
Daniel Bevenius
2f442737e2 deps: regenerate OpenSSL archs files
PR-URL: https://github.com/nodejs/node/pull/42973
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-30 08:18:27 +02:00
Daniel Bevenius
c3a127dcd8 deps: exclude linker scripts for windows builds
This commit ignore fips.ld and legacy.ld linker scripts for Windows
environments.

PR-URL: https://github.com/nodejs/node/pull/42973
Fixes: https://github.com/nodejs/node/issues/40854
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-30 08:18:06 +02:00
Daniel Bevenius
556df3d29a deps: remove opensslconf template headers
This commit removes the header template files opensslconf.h as it is not
a generated header anymore (configuration.h is the generated header
now).

The motivation for this is that not using opensslconf.h from the OpenSSL
include directory means an addon that includes openssl/ssl.h will get
the following error:

~/.cache/node-gyp/17.8.0/include/node/openssl/macros.h:148:4: error:
 compatibility level"
  148 | #  error "The requested API level higher than the configured
 API compatibility level"

For more details please see #40575.

PR-URL: https://github.com/nodejs/node/pull/43035
Fixes: https://github.com/nodejs/node/issues/40575
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-14 10:11:45 +02:00
RafaelGSS
ea6ada1974 deps: update archs files for quictls/openssl-3.0.3+quic
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

PR-URL: https://github.com/nodejs/node/pull/43022
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-May/000223.html
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2022-05-12 09:15:23 -03:00
RafaelGSS
d82eaf839c deps: upgrade openssl sources to quictls/openssl-3.0.3
This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ git checkout openssl-3.0.3+quic
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../../../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/43022
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-May/000223.html
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2022-05-12 09:15:21 -03:00
Daniel Bevenius
306c7a55e9 deps: regenerate OpenSSL archs files
PR-URL: https://github.com/nodejs/node/pull/42978
Refs: https://github.com/nodejs/node/issues/42976
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-08 20:53:31 +00:00
Daniel Bevenius
7e6c05552d Revert "deps: add template for generated headers"
This reverts commit 7fae2c9d6e.

Refs: https://github.com/nodejs/node/issues/42976

PR-URL: https://github.com/nodejs/node/pull/42978
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-05-08 20:53:29 +00:00
Daniel Bevenius
4ecfe3fb28 deps: remove linux-ppc64 architecture
PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:48:10 +02:00
Daniel Bevenius
3f0b2a23f0 deps: remove linux-ppc architecture
PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:48:05 +02:00
Daniel Bevenius
d68c4e9103 deps: remove aix-gcc architecture
PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:47:40 +02:00
Daniel Bevenius
d8365ac0fb deps: remove archs/aix64-gcc
This arch was renamed to clarify that it used the aix assembler (as) and
not the gnu assembler. It was removed from the Makefile and not being
built but would still be picked up by make targets like the header-tar
target.

PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Refs: https://github.com/openssl/openssl/commit/178fa72ed5
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:47:25 +02:00
Daniel Bevenius
4f1f14e5cd deps: add note about removing asm archs
PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:47:19 +02:00
Daniel Bevenius
33bc537d41 deps: add template for generated headers
OpenSSL 3.0 has a number of header files that are generated, and
currently these headers are copied into the architecture specific
directories. This is done for each asm type, 'asm', 'asm_avx2', and
'no-asm' which has takes up quite a lot of disk space and also becomes
an issue with the headers.tar file which has increased due to this.

This commit adds copies the headers to a common directory for the
architecture, for example with linux-x86_64 there will be a directory
named deps/openssl/config/archs/linux-x86_64/common/include where the
headers will be copied (into subdirectories 'openssl' and 'crypto'.
And in the original locations a header file with the same name will be
generated which points (includes) the common header file.

PR-URL: https://github.com/nodejs/node/pull/42616
Fixes: https://github.com/nodejs/node/issues/42081
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2022-04-28 13:46:43 +02:00
Hassaan Pasha
07ee7966ff deps: update archs files for quictls/openssl-3.0.2+quic
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

PR-URL: https://github.com/nodejs/node/pull/42356
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000217.html
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-03-17 10:14:52 +00:00
Hassaan Pasha
0690b7f60f deps: upgrade openssl sources to quictls/openssl-3.0.2+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/42356
Refs: https://mta.openssl.org/pipermail/openssl-announce/2022-March/000217.html
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2022-03-17 10:14:51 +00:00
Ben Noordhuis
214d7da675
build: remove broken x32 arch support
I added support for x32 back in 2014 but it's been in a state of
disrepair ever since, not in the least because it was never a fully
supported architecture in upstream V8.

V8 dropped x32 support entirely in or around 2018 so the removal from
Node's build system is long overdue.

Refs: https://github.com/nodejs/node/issues/40576

PR-URL: https://github.com/nodejs/node/pull/41905
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2022-02-11 08:52:24 +00:00
Michael Dawson
a199387f04 doc: make contributing info more discoverable
There are been several discussions in recent PRs about
the docs related to contributing not being very discoverable.
Move these docs from doc/guides/ to doc/contributing.

Signed-off-by: Michael Dawson <mdawson@devrus.com>

PR-URL: https://github.com/nodejs/node/pull/41408
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Reviewed-By: Mary Marchini <oss@mmarchini.me>
Reviewed-By: James M Snell <jasnell@gmail.com>
2022-01-18 14:24:30 -05:00
Richard Lau
a3195f20cd deps: update archs files for quictls/openssl-3.0.1+quic
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

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:19 +00:00
Richard Lau
44804a9cf7 deps: upgrade openssl sources to quictls/openssl-3.0.1+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone git@github.com:quictls/openssl.git
    $ cd openssl
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:18 +00:00
Richard Lau
6f61c2b41f build: update openssl config generator Dockerfile
The `deps/openssl/config/generate_headers.pl` imports `Text::Template`
but that Perl module is not present in the default Perl installation in
the Dockerfile and needs to be explicitly installed.

PR-URL: https://github.com/nodejs/node/pull/41177
Refs: https://github.com/quictls/openssl/pull/69
Refs: https://mta.openssl.org/pipermail/openssl-announce/2021-December/000212.html
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2021-12-16 11:51:16 +00:00
Lu Yahan
68dc180011 deps: add riscv64 config into openssl gypi
PR-URL: https://github.com/nodejs/node/pull/40473
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2021-10-22 11:31:04 +00:00
Daniel Bevenius
f233cb2c29 deps: attempt to suppress macro-redefined warning
PR-URL: https://github.com/nodejs/node/pull/40518
Refs: https://github.com/nodejs/node/issues/40509
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-10-21 04:17:12 +02:00
Daniel Bevenius
a16c34ebff deps: regenerate OpenSSL arch files
PR-URL: https://github.com/nodejs/node/pull/40518
Refs: https://github.com/nodejs/node/issues/40509
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-10-21 04:16:46 +02:00
Daniel Bevenius
f4bd91b0e2 deps,build,tools: fix openssl-is-fips for ninja builds
Currently using the --openssl-is-fips configuration option in
combination with --ninja is broken.

This commit fixes two issues, one being an issue with the linker/version
script path variable. The second is that the locations of built
artifacts that differ for ninja and make.

ninja:
$ ./configure --openssl-is-fips --ninja
$ ninja -C out/Release
$ ./node --enable-fips -p 'crypto.getFips()'
1

make:
$ ./configure --openssl-is-fips
$ make -j8
$ ./node --enable-fips -p 'crypto.getFips()'
1

PR-URL: https://github.com/nodejs/node/pull/40518
Refs: https://github.com/nodejs/node/issues/40509
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-10-21 04:16:19 +02:00
Daniel Bevenius
d434c5382a deps: regenerate OpenSSL arch files
Co-authored-by: Richard Lau <rlau@redhat.com>

PR-URL: https://github.com/nodejs/node/pull/40478
Refs: https://github.com/nodejs/node/issues/40455
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-18 15:43:16 +02:00
Daniel Bevenius
2cebd5f02b deps: add missing legacyprov.c source
This commit add the missing legacy provider source code which is
requried for statically linking the OpenSSL legacy provider.

Co-authored-by: Richard Lau <rlau@redhat.com>

PR-URL: https://github.com/nodejs/node/pull/40478
Refs: https://github.com/nodejs/node/issues/40455
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-18 15:43:16 +02:00
Daniel Bevenius
66da32c045 deps,test,src,doc,tools: update to OpenSSL 3.0
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: https://github.com/nodejs/node/pull/38512
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2021-10-11 06:28:08 +02:00
Lu Yahan
7905df180e deps: add riscv64 into openssl Makefile and gen openssl-riscv64
PR-URL: https://github.com/nodejs/node/pull/40063
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-09-17 10:56:09 +00:00
Richard Lau
229b7d219d
deps: update archs files for OpenSSL-1.1.1l+quic
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/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/39867
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-08-26 13:11:13 -07:00
Richard Lau
1e4444047e
deps: upgrade openssl sources to OpenSSL_1_1_1l+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone https://github.com/quictls/openssl
    $ cd openssl
    $ git checkout OpenSSL_1_1_1l+quic
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../openssl openssl
    $ rm -rf openssl/.git* openssl/.travis*
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/39867
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-08-26 13:11:11 -07:00
Hassaan Pasha
f638d8d754 deps: update archs files for OpenSSL-1.1.1k
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/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/37916
Fixes: https://github.com/nodejs/node/issues/37913
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-03-31 03:52:01 +00:00
Hassaan Pasha
6f2085dc98 deps: upgrade openssl sources to 1.1.1k+quic
This updates all sources in deps/openssl/openssl by:
    $ git clone https://github.com/quictls/openssl
    $ cd openssl
    $ git checkout OpenSSL_1_1_1k+quic
    $ cd ../node/deps/openssl
    $ rm -rf openssl
    $ cp -R ../openssl openssl
    $ cd openssl && rm -rf .gitattributes .github/ .gitmodules .travis-apt-pin.preferences  .travis-create-release.sh
    $ cd ..
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/37916
Fixes: https://github.com/nodejs/node/issues/37913
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2021-03-31 03:51:57 +00:00
James M Snell
1fb81ea0fb
deps: update archs files for OpenSSL-1.1.1+quic
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37601
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-03-15 07:33:44 -07:00
James M Snell
b6285dd7ed
deps: switch openssl to quictls/openssl
As of
0c70d48181

Source: https://github.com/quictls/openssl/tree/OpenSSL_1_1_1j+quic
Signed-off-by: James M Snell <jasnell@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/37601
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2021-03-15 07:33:41 -07:00
Daniel Bevenius
8cf654c5fa
deps: update archs files for OpenSSL-1.1.1j
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/include/crypto/bn_conf.h
    $ git add deps/openssl/openssl/include/crypto/dso_conf.h
    $ git add deps/openssl/openssl/include/openssl/opensslconf.h
    $ git commit

PR-URL: https://github.com/nodejs/node/pull/37412
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-02-19 20:50:17 +00:00
Daniel Bevenius
e4fde52895
deps: upgrade openssl sources to 1.1.1j
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1j.tar.gz
    $ mv openssl-1.1.1j openssl
    $ git add --all openssl
    $ git commit openssl

PR-URL: https://github.com/nodejs/node/pull/37412
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2021-02-19 20:50:14 +00:00
James M Snell
290ecb307d
deps: update openssl config
PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:31 -08:00
James M Snell
c3d6d50309
quic: remove quic
PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:28 -08:00
James M Snell
f763a80ab5
Revert "deps: various quic patches from akamai/openssl"
This reverts commit 06c5b5315a.

PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:26 -08:00
James M Snell
e63035c312
Revert "deps: re-enable OPENSSL_NO_QUIC guards"
This reverts commit b0d5bfe73d.

PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:23 -08:00
James M Snell
1c52ce892f
Revert "deps: update patch and docs for openssl update"
This reverts commit 548790ab82.

PR-URL: https://github.com/nodejs/node/pull/37067
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2021-01-30 07:49:21 -08:00
Myles Borins
e51267bd4d
deps: update archs files for OpenSSL-1.1.1i
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/include/crypto/bn_conf.h
  $ git add deps/openssl/openssl/include/crypto/dso_conf.h
  $ git add deps/openssl/openssl/include/openssl/opensslconf.h
  $ git commit

PR-URL: https://github.com/nodejs/node/pull/36520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2020-12-16 21:49:42 -05:00
James M Snell
b0d5bfe73d
deps: re-enable OPENSSL_NO_QUIC guards
PR-URL: https://github.com/nodejs/node/pull/34033
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>

PR-URL: https://github.com/nodejs/node/pull/36520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2020-12-16 21:49:41 -05:00
Todd Short
06c5b5315a
deps: various quic patches from akamai/openssl
Add support for BoringSSL QUIC APIs

This is a cherry-pick of 2a4b03a306439307e0b822b17eda3bdabddfbb68
on the master-quic-support2 branch (2019-10-07)
Which was a rebase/squash of master-quic-support:

* 5aa62ce Add support for more secrets - Todd Short/Todd Short (master-quic-support)
* 58e0643 Tweeks to quic_change_cipher_state() - Todd Short/Todd Short
* 8169702 Move QUIC code out of tls13_change_cipher_state() - Todd Short/Todd Short
* a08cfe6 Correctly disable middlebox compat - Todd Short/Todd Short
* 3a9eabf Add OPENSSL_NO_QUIC wrapper - Todd Short/Todd Short
* f550eca Add client early traffic secret storage - Todd Short/Todd Short
* 1b787ae Quick fix: s2c to c2s for early secret - Todd Short/Todd Short
* f97e6a9 Don't process an incomplete message - Todd Short/Todd Short
* 81f0ce2 Reset init state in SSL_process_quic_post_handshake() - Todd Short/Todd Short
* 5d59cf9 Fix quic_transport constructors/parsers - Todd Short/Todd Short
* 5e5f91c Fix INSTALL nit. - Todd Short/Todd Short
* bd290ab Fix duplicate word in docs - Todd Short/Todd Short
* 699590b fixup! Handle partial handshake messages - Todd Short/Todd Short
* a472a8d Handle partial handshake messages - Todd Short/Todd Short
* 363cf3d fixup! Use proper secrets for handshake - Todd Short/Todd Short
* b03fee6 Use proper secrets for handshake - Todd Short/Todd Short
* 2ab1aa0 Move QUIC transport params to encrypted extensions - Todd Short/Todd Short
* 0d16af9 Make temp secret names less confusing - Todd Short/Todd Short
* abb6f39 New method to get QUIC secret length - Todd Short/Todd Short
* 05fdae9 Add support for BoringSSL QUIC APIs - Todd Short/Todd Short

This adds a compatible API for BoringSSL's QUIC support, based
on the current |draft-ietf-quic-tls|.

Based on BoringSSL commit 3c034b2cf386b3131f75520705491871a2e0cafe
Based on BoringSSL commit c8e0f90f83b9ec38ea833deb86b5a41360b62b6a
Based on BoringSSL commit 3cbb0299a28a8bd0136257251a78b91a96c5eec8
Based on BoringSSL commit cc9d935256539af2d3b7f831abf57c0d685ffd81
Based on BoringSSL commit e6eef1ca16a022e476bbaedffef044597cfc8f4b
Based on BoringSSL commit 6f733791148cf8a076bf0e95498235aadbe5926d
Based on BoringSSL commit 384d0eaf1930af1ebc47eda751f0c78dfcba1c03
Based on BoringSSL commit a0373182eb5cc7b81d49f434596b473c7801c942
Based on BoringSSL commit b1b76aee3cb43ce11889403c5334283d951ebd37

New method to get QUIC secret length

Make temp secret names less confusing

Move QUIC transport params to encrypted extensions

Use proper secrets for handshake

fixup! Use proper secrets for handshake

Handle partial handshake messages

fixup! Handle partial handshake messages

Fix duplicate word in docs

Fix INSTALL nit.

Fix quic_transport constructors/parsers

Reset init state in SSL_process_quic_post_handshake()

Don't process an incomplete message

Quick fix: s2c to c2s for early secret

Add client early traffic secret storage

Add OPENSSL_NO_QUIC wrapper

Correctly disable middlebox compat

Move QUIC code out of tls13_change_cipher_state()

Create quic_change_cipher_state() that does the minimal required
to generate the QUIC secrets. (e.g. encryption contexts are not
initialized).

Tweeks to quic_change_cipher_state()

Add support for more secrets

Fix resumption secret

(cherry picked from commit 16fafdf4e0ec6cddd5705f407e5dca26cb30914d)

QUIC: Handle EndOfEarlyData and MaxEarlyData

QUIC: Increase HKDF_MAXBUF to 2048

Fall-through for 0RTT

Some cleanup for the main QUIC changes

Try to reduce unneeded whitespace changes and wrap new code to 80 columns.
Reword documentation to attempt to improve clarity.
Add some more sanity checks and clarifying comments to the code.
Update referenced I-D versions.

Prevent KeyUpdate for QUIC

QUIC does not use the TLS KeyUpdate message/mechanism, and indeed
it is an error to generate or receive such a message.  Add the
necessary checks (noting that the check for receipt should be
redundant since SSL_provide_quic_data() is the only way to provide
input to the TLS layer for a QUIC connection).

Test KeyUpdate rejection

For now, just test that we don't generate any, since we don't really
expose the mechanics for encrypting one and the QUIC API is not
integrated into the TLSProxy setup.

Fix out-of-bounds read when TLS msg is split up into multiple chunks

Previously, SSL_provide_quic_data tried to handle this kind of
situation, but it failed when the length of input data is less than
SSL3_HM_HEADER_LENGTH.  If that happens, the code might get wrong
message length by reading value from out-of-bounds region.

Revert "Fix out-of-bounds read when TLS msg is split up into multiple chunks"

This reverts commit 18f993cbdae498111c94a075fd9b115bd8367574.

Test HKDF with empty IKM

Add an extra EVP test that provides empty input key material.
It currently fails, since attempting to set a zero-length key
on an EVP_PKEY_CTX results in a call to OPENSSL_memdup() with
length zero, which returns NULL and is detected as failure.

Allow zero-length HKDF keys

When making a copy to keep in the EVP_PKEY_CTX, allocate a single
byte for the cached key instead of letting memdup return NULL
and cause the call to fail.  The length still gets set to zero
properly, so we don't end up inspecting the allocated byte, but
it's important to have a non-NULL pointer set.

Buffer all provided quic data

Make all data supplied via SSL_provide_quic_data() pass through an
internal buffer, so that we can handle data supplied with arbitrary
framing and only parse complete TLS records onto the list of QUIC_DATA
managed by quic_input_data_head/quic_input_data_tail.

This lets us remove the concept of "incomplete" QUIC_DATA structures,
and the 'offset' field needed to support them.

However, we've already moved the provided data onto the buffer by
the time we can check for KeyUpdate messages, so defer that check
to quic_get_message() (where it is adjacent to the preexisting
ChangeCipherSpec check).

To avoid extra memory copies, we also make the QUIC_DATA structures
just store offsets into the consolidated buffer instead of having copies
of the TLS handshake messages themselves.

enforce consistent encryption level for handshake messages

The QUIC-TLS spec requires that TLS handshake messages do not cross
encryption level boundaries, but we were not previously enforcing this.

PR-URL: https://github.com/nodejs/node/pull/36520
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
2020-12-16 21:49:35 -05:00