Commit Graph

32606 Commits

Author SHA1 Message Date
Momtchil Momtchev
656ce920a3 errors: eliminate all overhead for hidden calls
Eliminate all overhead for function calls that are to be
hidden from the stack traces at the expense of
reduced performance for the error case

Fixes: https://github.com/nodejs/node/issues/35386

PR-URL: https://github.com/nodejs/node/pull/35644
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-22 11:09:55 +01:00
Moshe vilner
67b9ba9afe test: increase abort logic coverage
PR-URL: https://github.com/nodejs/node/pull/36586
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-22 09:36:23 +00:00
Daniel Bevenius
fc8fcb084d src: remove unnecessary ToLocalChecked node_errors
PR-URL: https://github.com/nodejs/node/pull/36547
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-22 09:28:23 +01:00
Richard Lau
21f2e8859d tools: fix make-v8.sh
V8's `tools/dev/v8gen.py` does not like being passed an empty string
(`""`).

PR-URL: https://github.com/nodejs/node/pull/36594
Refs: https://github.com/nodejs/node/pull/36099
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Ben Coe <bencoe@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
2020-12-22 01:09:42 +00:00
ZiJian Liu
4d22dd329b test: increase coverage for stream
1. test addAbortSignal with invalid signal
Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L17

2. test addAbortSignal with invalid stream
Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L28

3. test addAbortSignalNoValidate with invalid signal
Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L34

4. test addAbortSignalNoValidate with aborted signal
Refs:  https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L40

5. test Readable.from with invalid args
Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/from.js.html#L31

PR-URL: https://github.com/nodejs/node/pull/36538
Refs: https://coverage.nodejs.org/coverage-a1509261770cb645/lib/internal/streams/add-abort-signal.js.html#L40
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-21 13:23:40 -05:00
Michaël Zasso
aadb0bdc73
build: do not run GitHub actions for draft PRs
PR-URL: https://github.com/nodejs/node/pull/35910
Fixes: https://github.com/nodejs/node/issues/35899
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Daijiro Wachi <daijiro.wachi@gmail.com>
2020-12-21 15:34:39 +01:00
Michaël Zasso
ce658bd2c8
doc: update and run license-builder for Babel
PR-URL: https://github.com/nodejs/node/pull/36504
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-21 15:07:13 +01:00
FrankQiu
bea2252554 doc: add remark about Collaborators discussion page
PR-URL: https://github.com/nodejs/node/pull/36420
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-21 06:04:45 -08:00
raisinten
1eb228eafd
lib: support BigInt in querystring.stringify
Fixes: https://github.com/nodejs/node/issues/36080

PR-URL: https://github.com/nodejs/node/pull/36499
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
2020-12-21 15:03:58 +01:00
ZiJian Liu
54e763ddc9
fs: refactor to use optional chaining
PR-URL: https://github.com/nodejs/node/pull/36524
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
2020-12-21 14:55:30 +01:00
Antoine du Hamel
6c25870073
tools: fix release script sign function
PR-URL: https://github.com/nodejs/node/pull/36556
Refs: https://github.com/nodejs/node/pull/36540
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
2020-12-21 14:47:22 +01:00
Rich Trott
b5fdb9e65a doc: simplify worker_threads.md text
PR-URL: https://github.com/nodejs/node/pull/36545
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-21 05:45:06 -08:00
Ruy Adorno
ffc11c6015
deps: upgrade npm to 7.3.0
PR-URL: https://github.com/nodejs/node/pull/36572
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-21 14:29:20 +01:00
zhangyongsheng
eefb424c60
tools: update ESLint to 7.16.0
PR-URL: https://github.com/nodejs/node/pull/36579
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-21 14:24:53 +01:00
zhangyongsheng
775ce40c99
tools: fix update-eslint.sh
PR-URL: https://github.com/nodejs/node/pull/36579
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-21 14:24:51 +01:00
Rich Trott
fee3b89a2b
benchmark: reduce code duplication
Merge duplicate case code in child-process-params.js.

PR-URL: https://github.com/nodejs/node/pull/36568
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
2020-12-21 13:43:30 +01:00
Anna Henningsen
2070d5b524
src: use correct microtask queue for checkpoints
I missed in c6c8337402 that we should not just use that queue for
enqueuing microtasks, but also for running them.

Refs: https://github.com/nodejs/node/pull/36482

PR-URL: https://github.com/nodejs/node/pull/36581
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
2020-12-21 13:28:51 +01:00
Anna Henningsen
82dd23f5ec
repl: disable blocking completions by default
It’s not okay for the REPL to be blocked for multiple seconds after
entering `require('` because the completion is performing blocking
fs operations on potentially huge directories. Turning the REPL
completion function asynchronous would be the right thing to do here,
but unfortunately the way the code is structured doesn’t play well
with that (in particular, it breaks the preview feature).
Therefore, disable these blocking calls by default.

Refs: https://github.com/nodejs/node/pull/33282#issuecomment-733646794

PR-URL: https://github.com/nodejs/node/pull/36564
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-21 12:52:02 +01:00
Robert Nagy
ab895bd587 stream: fix pipe deadlock when starting with needDrain
Fixes: https://github.com/nodejs/node/issues/36544

PR-URL: https://github.com/nodejs/node/pull/36563
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2020-12-20 10:27:35 +01:00
Michaël Zasso
daa132260d build: run some workflows only on nodejs/node
This updates the close-stalled, comment-stalled and license-builder
workflows to skip them on repositories that are not nodejs/node.

PR-URL: https://github.com/nodejs/node/pull/36507
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-18 12:38:18 -08:00
ZiJian Liu
565663e046 test: increase coverage for worker
test new Worker() with invalid NODE_OPTIONS
Refs: https://coverage.nodejs.org/coverage-743ee9d2c05efefe/lib/internal/worker.js.html#L179

PR-URL: https://github.com/nodejs/node/pull/36491
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-18 15:32:52 -05:00
Momtchil Momtchev
36581f1d4e doc: add two tips for speeding the dev builds
Add two important tips for novice Node.js contributors

PR-URL: https://github.com/nodejs/node/pull/36452
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-18 11:46:06 -08:00
Beth Griggs
b49145f795
2020-12-17, Version 14.15.3 'Fermium' (LTS)
Notable Changes:

Node.js v14.15.2 included a commit that has caused reported breakages
when cloning request objects. This release reverts the commit that
introduced the behaviour change.

See https://github.com/nodejs/node/issues/36550 for more details.

PR-URL: https://github.com/nodejs/node/pull/36555
2020-12-17 23:22:59 +00:00
Tobias Nießen
6255973a05 doc: add note about timingSafeEqual for TypedArray
PR-URL: https://github.com/nodejs/node/pull/36323
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-18 00:14:21 +01:00
Antoine du Hamel
f28715d95d tools: fix release script
PR-URL: https://github.com/nodejs/node/pull/36540
Refs: https://github.com/nodejs/node/pull/36123
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Beth Griggs <bgriggs@redhat.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
2020-12-17 16:03:48 +00:00
Rich Trott
32d58d7271 tools: remove unused variable in configure.py
PR-URL: https://github.com/nodejs/node/pull/36525
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
2020-12-17 05:20:06 -08:00
Rich Trott
bc50577b36 doc: move Derek Lewis to emeritus
Derek informed me that he intends to take a break from
collaborator-ship.

PR-URL: https://github.com/nodejs/node/pull/36514
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
2020-12-17 05:05:40 -08:00
Daniele Belardi
8154e47e2b http: add test for incomingmessage destroy
Test uncaught exceptions when destroying IncomingMessage.

PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:10 +00:00
Daniele Belardi
a6bf74eac0 http: use standard args order in IncomingMEssage onError
PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:10 +00:00
Daniele Belardi
f20a88fb86 http: remove trailing space
PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:09 +00:00
Daniele Belardi
5ae9690869 http: add comments in _http_incoming
PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:09 +00:00
Daniele Belardi
70eaf55a9d http: fix lint error in incoming message
PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:08 +00:00
Daniele Belardi
6120028ee3 http: reafactor incoming message destroy
Destroy the underlying socket only if it is not ready destroyed. Wait
for the stream to finish in that case.

PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:07 +00:00
Daniele Belardi
55e83cbe95 http: use autoDestroy: true in incoming message
Enable the default `autoDestroy: true` option in IncomingMessage.

Refactor `_http_client` and `_http_server` to remove any manual
destroying/closing of IncomingMessage.
Refactor IncomingMessage `destroy` method to use the standard
implementation of the stream module and move the early termination
event emitting inside of it.

PR-URL: https://github.com/nodejs/node/pull/33035
Refs: https://github.com/nodejs/node/issues/30625
Reviewed-By: Robert Nagy <ronagy@icloud.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-17 10:31:07 +00:00
Daniel Bevenius
eb14b10370 src: remove unnecessary ToLocalChecked call
PR-URL: https://github.com/nodejs/node/pull/36523
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2020-12-17 05:06:57 +01: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
Myles Borins
db3b2f625c
deps: upgrade openssl sources to 1.1.1i
This updates all sources in deps/openssl/openssl by:
    $ cd deps/openssl/
    $ rm -rf openssl
    $ tar zxf ~/tmp/openssl-1.1.1i.tar.gz
    $ mv openssl-1.1.1i openssl
    $ git add --all openssl
    $ git commit openssl

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:02 -05:00
Myles Borins
548790ab82
deps: update patch and docs for openssl update
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:00 -05:00
nlf
b833305a55 deps: fix npm doctor tests for pre-release node
Refs: https://github.com/npm/cli/pull/2358

PR-URL: https://github.com/nodejs/node/pull/36543
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-12-17 01:05:52 +00:00
Myles Borins
d0b1b135b2 deps: upgrade npm to 7.2.0
PR-URL: https://github.com/nodejs/node/pull/36543
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Ruy Adorno <ruyadorno@github.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
2020-12-17 01:05:51 +00:00
Antoine du Hamel
0e96dc1f95 tools: lint shell scripts
PR-URL: https://github.com/nodejs/node/pull/36099
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-16 23:45:26 +01:00
Chinmoy Chakraborty
4a6200e289
doc: add issue reference to github pr template
The PR template should include a Reference isssue (Fixes #issue_number)
so the PR can be tracked back to the issue easily.For a beginner trying
to read PRs to become comfortable with the codebase,it is really helpful
if one can directly reach the issue the PR fixes.

Fixes: https://github.com/nodejs/node/issues/36338

PR-URL: https://github.com/nodejs/node/pull/36440
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-16 10:39:24 -08:00
Rock
b558075738
doc: update url.md
Add missing 's' to example URL.

PR-URL: https://github.com/nodejs/node/pull/36147
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Harshitha K P <harshitha014@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-16 10:37:13 -08:00
Danny Sonnenschein
3bd9b81da0 deps: update to c-ares 1.17.1
PR-URL: https://github.com/nodejs/node/pull/36207
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-16 05:48:29 -08:00
Rich Trott
44243e59df test: specify global object for globals
Be explicit about using `global.externalizeString()` etc. in
test-fs-write instead of disabling the `no-undef` ESLint rule.

PR-URL: https://github.com/nodejs/node/pull/36498
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2020-12-16 05:21:54 -08:00
Richard Lau
0b3caadad3 doc: make explicit reverting node_version.h changes
Add an explicit command to revert changes to `node_version.h` when
cherry-picking the release commit to the `master` branch.

PR-URL: https://github.com/nodejs/node/pull/36461
Refs: https://github.com/nodejs/node/pull/36460
Refs: https://github.com/nodejs/node/pull/36385
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Danielle Adams <adamzdanielle@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
2020-12-16 10:57:56 +00:00
Beth Griggs
a150926177
2020-12-15, Version 14.15.2 'Fermium' (LTS)
Notable Changes:

- **deps**:
  - upgrade npm to 6.14.9 (Myles Borins)
    https://github.com/nodejs/node/pull/36450
  - update acorn to v8.0.4 (Michaël Zasso)
    https://github.com/nodejs/node/pull/35791
- **doc**: add release key for Danielle Adams (Danielle Adams)
    https://github.com/nodejs/node/pull/35545
- **http2**: check write not scheduled in scope destructor (David Halls)
    https://github.com/nodejs/node/pull/36241
- **stream**: fix regression on duplex end (Momtchil Momtchev)
    https://github.com/nodejs/node/pull/35941

PR-URL: https://github.com/nodejs/node/pull/36476
2020-12-15 23:48:00 +00:00
FrankQiu
91fe3de5e6 doc: add license info to the README
PR-URL: https://github.com/nodejs/node/pull/36278
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
2020-12-16 00:27:32 +01:00