Since it is a deprecated API, a deprecation warning is printed when
loading crypto module from ESM. Making it non enumerable remove the
deprecation warning and make the API non-available to named imports.
PR-URL: https://github.com/nodejs/node/pull/23222
Fixes: https://github.com/nodejs/node/issues/23203
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Guy Bedford <guybedford@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Move the following code into a new node_errors.cc file and
declare them in node_errors.h for clarity and make it possible
to include them with node_errors.h.
- AppendExceptionLine()
- DecorateErrorStack()
- FatalError()
- OnFatalError()
- PrintErrorString()
- FatalException()
- ReportException()
- FatalTryCatch
And move the following definitions (declared elsewhere than
node_errors.h) to node_errors.cc:
- Abort() (in util.h)
- Assert() (in util.h)
PR-URL: https://github.com/nodejs/node/pull/24058
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Our out-of-tree patch from 2b6bb9f588 ("deps: c-ares float, win ipv6 bad
fec0 prefix") should no longer be necessary, c-ares now blacklists such
addresses itself.
PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Remove leftover files that were added in commit 58e4edaf68 from 2013
to help with standalone builds of the c-ares fork that we maintained
at the time.
PR-URL: https://github.com/nodejs/node/pull/23854
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
posix -> POSIX
platform specific -> platform-specific
PR-URL: https://github.com/nodejs/node/pull/24118
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This updates the documentation
to clarify how to use `timeout`
in the vm module.
PR-URL: https://github.com/nodejs/node/pull/23512
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Implement several minor grammar, punctuation, and style fixes in
stream.md.
PR-URL: https://github.com/nodejs/node/pull/24116
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Currently, this test will fail when configured --without-ssl. This
commit adds a crypto check to have this test skipped when configured
without crypto support.
PR-URL: https://github.com/nodejs/node/pull/24096
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1) Should be passive voice instead of `can overridden`.
2) Change the order of the two sentences to make it more clear about
'What can be overridden' instead of 'Can be overridden'.
PR-URL: https://github.com/nodejs/node/pull/23799
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly return to avoid following operations on `null`
`this._handle`.
Fixes: https://github.com/nodejs/node/issues/23917
PR-URL: https://github.com/nodejs/node/pull/23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
In 62232361 we made the console.Console function construct an object
with methods from Console.prototype bound to the instance, instead of
with methods found on the prototype chain to be bound on the instances,
thus breaking users overriding these methods when subclassing Console
because they are not expecting this function to construct a
namespace whose methods are not looked up from the prototype
chain.
This patch restores the previous behavior since it does not affect
the characteristics of the global console anyway. So after this patch,
the Console function still constructs normal objects with function
properties looked up from the prototype chain but bound to the
instances always.
PR-URL: https://github.com/nodejs/node/pull/24047
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Also added the comment in f074612b7 to make
NativeModule.prototype.compile() more readable.
PR-URL: https://github.com/nodejs/node/pull/24057
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Also move Announce step to after technical stuff.
PR-URL: https://github.com/nodejs/node/pull/24042
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* `V8_DEPRECATION_WARNINGS` is here for explicity. It is already defined
in `node.gypi`, and `addon.gypi`.
* `V8_IMMINENT_DEPRECATION_WARNINGS` added to warn addons authors.
* `OPENSSL_THREADS` apears in the openSSL `.h` files, and was only
defined via GYP for the node build.
PR-URL: https://github.com/nodejs/node/pull/23426
Fixes: https://github.com/nodejs/node/issues/23167
Refs: https://github.com/nodejs/node/issues/23122
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Do not run any linting at all when `TRAVIS_PULL_REQUEST` is `false`.
This would otherwise break Travis CI for `master` and release branches.
Refs: https://github.com/nodejs/node/pull/24030
PR-URL: https://github.com/nodejs/node/pull/24076
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
- Always fulfill the `MaybeLocal<>` contract by scheduling an
exception when returning an empty value. This was previously
inconsistent, with no way to know whether an exception was
be scheduled or not in case of failure.
- Make sure that memory is released exactly once in case of
failure. Previously, some exit conditions would have leaked
memory or attempted to free it multiple times.
This should not really affect how `Buffer`s are created by
addons in practice, due to the low frequency with which
these errors would typically occur.
PR-URL: https://github.com/nodejs/node/pull/23939
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/24074
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Decouple first commit in pull request linting from Travis by using
the GitHub API to work out the first commit.
The shell script obtains the pull request number in one of the
following ways:
1) supplied on the command line (use this to test against any PR)
2) derived from the HEAD commit via the GitHub API
PR-URL: https://github.com/nodejs/node/pull/24030
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
In particular, this value is `true` and not `false`
between calling `connect()` and the operation finishing.
PR-URL: https://github.com/nodejs/node/pull/24066
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
This adds a SECURITY.md file and links to the security document per the
request of @https://github.com/Trott at a recent SF Node meetup.
PR-URL: https://github.com/nodejs/node/pull/24031
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Rather than ponder "node" vs. "Node.js", remove the descriptor so it's
just "command-line options" rather than "node command-line options" or
"Node.js command-line options".
PR-URL: https://github.com/nodejs/node/pull/24029
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Throw an exception instead of crashing when attempting to create
`Buffer` objects from a Context that is not associated with
a Node.js `Environment`.
Possible alternatives for the future might be just returning
a plain `Uint8Array`, or working on providing `Buffer` for all
`Context`s.
PR-URL: https://github.com/nodejs/node/pull/23938
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Low severity timing vulnerability in the DSA signature algorithm
Publicly disclosed but unreleased, pending OpenSSL 1.1.0j, not deemed
severe enough to be assigned a CVE #.
Ref: https://github.com/openssl/openssl/pull/7487
PR-URL: https://github.com/nodejs/node/pull/???
Upstream: https://github.com/openssl/openssl/commit/415c3356
Original commit message:
DSA mod inverse fix
There is a side channel attack against the division used to calculate one of
the modulo inverses in the DSA algorithm. This change takes advantage of the
primality of the modulo and Fermat's little theorem to calculate the inverse
without leaking information.
Thanks to Samuel Weiser for finding and reporting this.
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/7487)
PR-URL: https://github.com/nodejs/node/pull/23965
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
PR-URL: https://github.com/nodejs/node/pull/23971
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Clarify the behavior of what Boxstarter may do when it runs on a box
to install all the necessary tools so that there are no surprises to
the end user when the script is run.
Currently there is no interface that warns the user that Boxstarter
will reboot the machine possibly multiple times depending on how many
dependencies need to be installed and doesn't mention a need to disable
UAC. For folks who see what may look like a reboot loop, we feel it is
necessary to make them aware that UAC will be disabled and they will
need to take action to re-enable UAC manually if they interfere/stop
the script from finishing.
PR-URL: https://github.com/nodejs/node/pull/23987
Fixes: https://github.com/nodejs/Release/issues/369
Reviewed-By: John-David Dalton <john.david.dalton@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Instead of throwing errors in fs.accessSync and then catching it,
handle the result from the binding directly in fs.existsSync.
Note that the argument validation errors still needs to be caught
until we properly deprecate the don't-thrown-on-invalid-arguments
behavior.
PR-URL: https://github.com/nodejs/node/pull/24015
Fixes: https://github.com/nodejs/node/issues/24008
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
This commit updates the check of the offset argument passed to
CallJSOnreadMethod to avoid doing a cast as this currently generates
the following compiler warning when doing a debug build:
./src/stream_base.cc:295:3:
warning: comparison of integers of different signs:
'int32_t' (aka 'int') and 'size_t' (aka 'unsigned long')
[-Wsign-compare]
CHECK_EQ(static_cast<int32_t>(offset), offset);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~
PR-URL: https://github.com/nodejs/node/pull/23994
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Matheus Marchini <mat@mmarchini.me>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Currently, when building with --debug
test-async-wrap-pop-id-during-load fails on macosx with the following
error:
$ out/Debug/node test/parallel/test-async-wrap-pop-id-during-load.js
assert.js:86
throw new AssertionError(obj);
^
AssertionError [ERR_ASSERTION]: EXIT CODE: 1, STDERR:
internal/bootstrap/loaders.js:275
const script = new ContextifyScript(
^
RangeError: Maximum call stack size exceeded
at NativeModule.compile (internal/bootstrap/loaders.js:275:22)
at NativeModule.require (internal/bootstrap/loaders.js:168:18)
at assert.js:31:43
at NativeModule.compile (internal/bootstrap/loaders.js:299:7)
at NativeModule.require (internal/bootstrap/loaders.js:168:18)
at internal/process/main_thread_only.js:23:16
at NativeModule.compile (internal/bootstrap/loaders.js:299:7)
at Function.NativeModule.require
(internal/bootstrap/loaders.js:168:18)
at startup (internal/bootstrap/node.js:58:38)
at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
at Object.<anonymous>
(/node/test/parallel/test-async-wrap-pop-id-during-load.js:21:8)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js
(internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
at startup (internal/bootstrap/node.js:308:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)
This commit suggests increasing the stack_size to 80.
Refs: https://github.com/nodejs/node/pull/20940
PR-URL: https://github.com/nodejs/node/pull/23996
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Original commit message:
undef min,max macros on windows
This blocks building with official clang-cl and Windows SDK
Refs: https://github.com/nodejs/node/issues/19630
Change-Id: I41fdf934f486c660df7a9e0dd284f6eb3c294dd4
Reviewed-on: https://chromium-review.googlesource.com/c/1297479
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57053}
PR-URL: https://github.com/nodejs/node/pull/23985
Refs: dc704497ee
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>