Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test crypto keygen EC invalid param encoding #27200

Closed
Closed
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
10 changes: 3 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,19 @@ coverage/

/out

# various stuff that VC++ produces/uses
Debug/
!**/node_modules/debug/
Release/
!**/node_modules/**/release
# various stuff that VC++ produces/uses and is not in /out
/Debug/
/Release/
!doc/blog/**
*.sln
!nodemsi.sln
*.suo
*.vcproj
*.vcxproj
!custom_actions.vcxproj
*.vcxproj.user
*.vcxproj.filters
UpgradeLog*.XML
_UpgradeReport_Files/
ipch/
*.sdf
*.opensdf
*.VC.db
Expand Down
58 changes: 36 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
x-ccache-setup-steps: &ccache-setup-steps
- export CCACHE_NOSTATS=1
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
- export CC='ccache gcc-6'
- export CXX='ccache g++-6'

os: linux
dist: xenial
language: cpp
jobs:
include:
- stage: "Lint and Compile"
Expand All @@ -21,48 +28,55 @@ jobs:
- NODE=$(which node) make lint lint-py

- name: "Compile V8"
language: cpp
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install:
- CC='ccache gcc-6' CXX='ccache g++-6' ./configure
install: *ccache-setup-steps
script:
- CC='ccache gcc-6' CXX='ccache g++-6' make -j2 -C out V=1 v8
- ./configure
- make -j2 -C out V=1 v8

- name: "Compile Node.js"
language: cpp
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install:
- CC='ccache gcc-6' CXX='ccache g++-6' ./configure
install: *ccache-setup-steps
script:
- CC='ccache gcc-6' CXX='ccache g++-6' make -j2 V=1
- ./configure
- make -j2 V=1
- cp out/Release/node /home/travis/.ccache
- cp out/Release/cctest /home/travis/.ccache

- stage: "Tests"
name: "Test Suite"
language: cpp
name: "Test JS Suites"
cache: ccache
addons:
apt:
sources:
- ubuntu-toolchain-r-test
packages:
- g++-6
install:
- export CC='ccache gcc-6' CXX='ccache g++-6' JOBS=2
- ./configure
# We already have a compile log in the above job
- make -j2 > /dev/null
- make -j1 build-addons build-js-native-api-tests build-node-api-tests > /dev/null
- mkdir -p out/Release
- cp /home/travis/.ccache/node out/Release/node
script:
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare default

- name: "Test C++ Suites"
cache: ccache
install:
- export CCACHE_NOSTATS=1
- export CCACHE_SLOPPINESS="file_macro,include_file_mtime,include_file_ctime,time_macros,file_stat_matches"
- export CC='ccache gcc'
- export CXX='ccache g++'
- mkdir -p out/Release
- cp /home/travis/.ccache/node out/Release/node
- ln -fs out/Release/node node
- cp /home/travis/.ccache/cctest out/Release/cctest
- touch config.gypi
script:
- JOBS=2 FLAKY_TESTS=dontcare make -s -j1 V= test-ci | grep -F -e "---" -e "..." -v
- out/Release/cctest
- make -j1 V=1 test/addons/.buildstamp test/js-native-api/.buildstamp test/node-api/.buildstamp
- python tools/test.py -j 2 -p dots --report --mode=release --flaky-tests=dontcare addons js-native-api node-api
8 changes: 4 additions & 4 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ The TSC has final authority over this project, including:
* Contribution policy
* GitHub repository hosting
* Conduct guidelines
* Maintaining the list of additional Collaborators
* Maintaining the list of Collaborators

The current list of TSC members can be found in
The current list of TSC members is in
[the project README](./README.md#current-project-team-members).

The operations of the TSC are governed by the [TSC Charter][] as approved by
the Node.js Foundation Board of Directors.
The [TSC Charter][] governs the operations of the TSC. All changes to the
Charter need approval by the Node.js Board of Directors.

### TSC Meetings

Expand Down
7 changes: 7 additions & 0 deletions common.gypi
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
'variables': {
'configuring_node%': 0,
'asan%': 0,
'werror': '', # Turn off -Werror in V8 build.
'visibility%': 'hidden', # V8's visibility setting
Expand Down Expand Up @@ -280,6 +281,12 @@
'msvs_cygwin_shell': 0, # prevent actions from trying to use cygwin

'conditions': [
[ 'configuring_node', {
'msvs_configuration_attributes': {
'OutputDirectory': '<(DEPTH)/out/$(Configuration)/',
'IntermediateDirectory': '$(OutDir)obj/$(ProjectName)/'
},
}],
[ 'target_arch=="x64"', {
'msvs_configuration_platform': 'x64',
}],
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -1625,7 +1625,7 @@ def make_bin_override():

write('config.mk', do_not_edit + config)

gyp_args = ['--no-parallel']
gyp_args = ['--no-parallel', '-Dconfiguring_node=1']

if options.use_ninja:
gyp_args += ['-f', 'ninja']
Expand Down
9 changes: 9 additions & 0 deletions doc/api/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,14 @@ https://github.com/tc39/ecma262/pull/1320.

Both of the above may change in future updates, which will be breaking changes.

### `--heapsnapshot-signal=signal`
<!-- YAML
added: REPLACEME
-->

Generates a heap snapshot each time the process receives the specified signal.
`signal` must be a valid signal name. Disabled by default.

### `--http-parser=library`
<!-- YAML
added: v11.4.0
Expand Down Expand Up @@ -765,6 +773,7 @@ Node.js options that are allowed are:
- `--experimental-vm-modules`
- `--force-fips`
- `--frozen-intrinsics`
- `--heapsnapshot-signal`
- `--icu-data-dir`
- `--inspect`
- `--inspect-brk`
Expand Down
3 changes: 3 additions & 0 deletions doc/node.1
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ Same requirements as
.It Fl -frozen-intrinsics
Enable experimental frozen intrinsics support.
.
.It Fl -heapsnapshot-signal Ns = Ns Ar signal
Generate heap snapshot on specified signal.
.
.It Fl -http-parser Ns = Ns Ar library
Chooses an HTTP parser library. Available values are
.Sy llhttp
Expand Down
16 changes: 16 additions & 0 deletions lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ function prepareMainThreadExecution(expandArgv1 = false) {
initializeReport();
initializeReportSignalHandlers(); // Main-thread-only.

initializeHeapSnapshotSignalHandlers();

// If the process is spawned with env NODE_CHANNEL_FD, it's probably
// spawned by our child_process module, then initialize IPC.
// This attaches some internal event listeners and creates:
Expand Down Expand Up @@ -166,6 +168,20 @@ function initializeReportSignalHandlers() {
addSignalHandler();
}

function initializeHeapSnapshotSignalHandlers() {
const signal = getOptionValue('--heapsnapshot-signal');

if (!signal)
return;

require('internal/validators').validateSignalName(signal);
const { writeHeapSnapshot } = require('v8');

process.on(signal, () => {
writeHeapSnapshot();
});
}

function setupTraceCategoryState() {
const { isTraceCategoryEnabled } = internalBinding('trace_events');
const { toggleTraceCategoryState } = require('internal/process/per_thread');
Expand Down
27 changes: 27 additions & 0 deletions node.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,31 @@
],
},

'target_defaults': {
# Putting these explicitly here so not to depend on `common.gypi`.
# `common.gypi` need to be more general because it is used to build userland native addons.
# Refs: https://github.com/nodejs/node-gyp/issues/1118
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Werror=undefined-inline',
],
},

# Relevant only for x86.
# Refs: https://github.com/nodejs/node/pull/25852
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
'msvs_settings': {
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false',
},
},
},

'targets': [
{
'target_name': '<(node_core_target_name)',
Expand Down Expand Up @@ -438,6 +463,7 @@
'src/node_messaging.cc',
'src/node_metadata.cc',
'src/node_native_module.cc',
'src/node_native_module_env.cc',
'src/node_options.cc',
'src/node_os.cc',
'src/node_perf.cc',
Expand Down Expand Up @@ -518,6 +544,7 @@
'src/node_metadata.h',
'src/node_mutex.h',
'src/node_native_module.h',
'src/node_native_module_env.h',
'src/node_object_wrap.h',
'src/node_options.h',
'src/node_options-inl.h',
Expand Down
24 changes: 4 additions & 20 deletions node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -24,36 +24,20 @@
},
'force_load%': '<(force_load)',
},
# Putting these explicitly here so not to be dependant on common.gypi.
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
'xcode_settings': {
'WARNING_CFLAGS': [
'-Wall',
'-Wendif-labels',
'-W',
'-Wno-unused-parameter',
'-Werror=undefined-inline',
],
},
# Relevant only for x86.
# Refs: https://docs.microsoft.com/en-us/cpp/build/reference/safeseh-image-has-safe-exception-handlers
'msvs_settings': {
'VCLinkerTool': {
'ImageHasSafeExceptionHandlers': 'false',
},
},

'conditions': [
[ 'clang==1', {
'cflags': [ '-Werror=undefined-inline', ]
}],
[ 'node_shared=="false"', {
[ 'node_shared=="false" and "<(_type)"=="executable"', {
'msvs_settings': {
'VCManifestTool': {
'EmbedManifest': 'true',
'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest'
}
},
}, {
}],
[ 'node_shared=="true"', {
'defines': [
'NODE_SHARED_MODE',
],
Expand Down
4 changes: 2 additions & 2 deletions src/api/environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "node_context_data.h"
#include "node_errors.h"
#include "node_internals.h"
#include "node_native_module.h"
#include "node_native_module_env.h"
#include "node_platform.h"
#include "node_process.h"
#include "node_v8_platform-inl.h"
Expand Down Expand Up @@ -351,7 +351,7 @@ Local<Context> NewContext(Isolate* isolate,
};
Local<Value> arguments[] = {context->Global(), exports};
MaybeLocal<Function> maybe_fn =
per_process::native_module_loader.LookupAndCompile(
native_module::NativeModuleEnv::LookupAndCompile(
context, *module, &parameters, nullptr);
if (maybe_fn.IsEmpty()) {
return Local<Context>();
Expand Down
Loading