summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2018-04-11src: update NODE_MODULE_VERSION to 63Myles Borins
Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 6.6. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md PR-URL: https://github.com/nodejs/node/pull/19201 Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com> Reviewed-By: Myles Borins <myles.borins@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-10src: add punctuation in --inspector doc url messageNick Filatov
PR-URL: https://github.com/nodejs/node/pull/19871 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
2018-04-10src: rename ERR_STRING_TOO_LARGE to ERR_STRING_TOO_LONGJoyee Cheung
The old error name and message were trying to be consistent with ERR_BUFFER_TOO_LARGE but they were not really accurate. The kStringMaxLength was measured in number of characters, not number of bytes. The name ERR_STRING_TOO_LARGE also seems a bit awkward. This patch tries to correct them before they get released to users. PR-URL: https://github.com/nodejs/node/pull/19864 Refs: https://github.com/nodejs/node/pull/19739 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-04-10zlib: fix windowBits validation to allow 0 for decompression modeAnand Suresh
From the zlib v1.2.11 manual: > ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, > int windowBits)); > > ... > windowBits can also be zero to request that inflate use the window > size in the zlib header of the compressed stream. The current validation of windowBits in zlib.js doesn't check for this case. PR-URL: https://github.com/nodejs/node/pull/19686 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
2018-04-10crypto: remove deperecated methods of TLS versionShigeki Ohtsu
All version-specific methods were deprecated in OpenSSL 1.1.0 and min/max versions explicitly need to be set. This still keeps comptatible with JS and OpenSSL-1.0.2 APIs for now. crypto, constants: add constant of OpenSSL-1.1.0 Several constants for OpenSSL-1.1.0 engine were removed and renamed in OpenSSL-1.1.0. This added one renamed constant in order to have a compatible feature with that of OpenSSL-1.0.2. Other missed or new constants in OpenSSL-1.1.0 are not yet added. crypto,tls,constants: remove OpenSSL1.0.2 support This is semver-majar change so that we need not to have compatibilities with older versions. Fixes: https://github.com/nodejs/node/issues/4270 PR-URL: https://github.com/nodejs/node/pull/19794 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-04-09src: remove unused util.h from tls_wrap.hDaniel Bevenius
This commit removes util.h from tls_wrap.h and adds util-inl.h to tls_wrap.cc which does use it. PR-URL: https://github.com/nodejs/node/pull/19849 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-08n-api: add more `int64_t` testsKyle Farnung
* Updated tests for `Number` and `int32_t` * Added new tests for `int64_t` * Updated N-API `int64_t` behavior to return zero for all non-finite numbers * Clarified the documentation for these calls. PR-URL: https://github.com/nodejs/node/pull/19402 Refs: https://github.com/nodejs/node-chakracore/pull/500 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-07module: move options checks from C++ to JSMichaël Zasso
PR-URL: https://github.com/nodejs/node/pull/19822 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-07src: migrate string_bytes.cc to throw errors with codeJoyee Cheung
PR-URL: https://github.com/nodejs/node/pull/19739 Fixes: https://github.com/nodejs/node/issues/3175 Fixes: https://github.com/nodejs/node/issues/9489 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-04-07src: add error code helpers to src/node_errors.hJoyee Cheung
This commit adds node::ERR_*(isolate, message) helpers in the C++ land to assign error codes to existing C++ errors. The following errors are added: - ERR_MEMORY_ALLOCATION_FAILED - ERR_STRING_TOO_LARGE PR-URL: https://github.com/nodejs/node/pull/19739 Fixes: https://github.com/nodejs/node/issues/3175 Fixes: https://github.com/nodejs/node/issues/9489 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-04-07buffer: reduce overhead of StringBytes::Encode for UCS2Joyee Cheung
Currently calling StringBytes::Encode on a UCS2 buffer results in two copies of the buffer and the usage of std::vector::assign makes the memory usage unpredictable, and therefore hard to test against. This patch makes the memory usage more predictable by allocating the memory using node::UncheckedMalloc and handles the memory allocation failure properly. Only one copy of the buffer will be created and it will be freed upon GC of the string. PR-URL: https://github.com/nodejs/node/pull/19798 Refs: https://github.com/nodejs/node/pull/19739 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-06crypto: add support for AES-CCMTobias Nießen
This commit adds support for another AEAD algorithm and introduces required API changes and extensions. Due to the design of CCM itself and the way OpenSSL implements it, there are some restrictions when using this mode as outlined in the updated documentation. PR-URL: https://github.com/nodejs/node/pull/18138 Fixes: https://github.com/nodejs/node/issues/2383 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org> Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-04-05fs: expose copy-on-write flags for fs.copyFile()cjihrig
This commit exposes the UV_FS_COPYFILE_FICLONE and UV_FS_COPYFILE_FICLONE_FORCE flags added in libuv 1.20.0. Fixes: https://github.com/nodejs/node/issues/19152 PR-URL: https://github.com/nodejs/node/pull/19759 Fixes: https://github.com/nodejs/node/issues/19152 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-04fs: refactor stats array to be more genericJoyee Cheung
- Pass kFsStatsFieldsLength between JS and C++ instead of using the magic number 14 - Pass the global stats array to the completion callback of asynchronous FSReqWrap similar to how the stats arrays are passed to the FSReqPromise resolvers - Abstract the stats converter and take an offset to compute the old stats in fs.watchFile - Use templates in node::FillStatsArray and FSReqPromise in preparation for BigInt intergration - Put the global stat array filler in node_internals.h because it is shared by node_file.cc and node_stat_watcher.cc PR-URL: https://github.com/nodejs/node/pull/19714 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-04buffer: use v8::TypedArray::kMaxLength as buffer::kMaxLengthJoyee Cheung
This was added in v8 6.2, looks like a safe replacement for our own buffer::kMaxLength. PR-URL: https://github.com/nodejs/node/pull/19738 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-03perf_hooks: simplify perf_hooksJames M Snell
Remove the `performance.getEntries()` and `performance.clear*()` variants and eliminate the accumulation of the global timeline entries. The design of this particular bit of the API is a memory leak and performance footgun. The `PerformanceObserver` API is a better approach to consuming the data in a more transient way. PR-URL: https://github.com/nodejs/node/pull/19563 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-04-03vm: move options checks from C++ to JSMichaël Zasso
Also introduces stronger type validations for options passed to vm functions. PR-URL: https://github.com/nodejs/node/pull/19398 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-03n-api: back up env before finalizeGabriel Schulhof
Heed the comment to not use fields of a Reference after calling its finalize callback, because such a call may destroy the Reference. Fixes: https://github.com/nodejs/node/issues/19673 PR-URL: https://github.com/nodejs/node/pull/19718 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-04-03src: rename req_wrap with -async/-sync suffixDaniel Bevenius
This commit renames the req_wrap variable to use an -async/-sync suffix to avoid cases where the variables were being shadowed. PR-URL: https://github.com/nodejs/node/pull/19628 Refs: https://github.com/nodejs/node/pull/19614 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-04-02inspector: report client-visible host and portEugene Ostroukhov
Node instance may not know the real host and port user sees when debug frontend connects through the SSH tunnel. This change fixes '/json/list' response by using the value client provided in the host header. PR-URL: https://github.com/nodejs/node/pull/19664 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-30src: fix warnings in aliased_bufferKyle Farnung
* Unary minus usages on unsigned type * Implicit casts to/from input parameters PR-URL: https://github.com/nodejs/node/pull/19665 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Khaidi Chu <i@2333.moe> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-30src: general C++ cleanup in node_url.ccAnna Henningsen
- Merge `domain` and `opaque` storage in URL parser: This just simplifies the code a bit, having multiple fields in an union with the same type is usually just overhead. - Add move variant of `URLHost::ToString()`: This helps avoid unnecessary string copy operations, especially since we control the lifetime of `URLHost` objects pretty well. - Use const refs in node_url.cc where appropriate - Remove or reduce overly generous `.reserve()` calls: These would otherwise keep a lot of unused memory lying around. - Return return values instead of unnecessary pointer arguments - Use more common/expressive variable names - Avoid macro use, reduce number of unnecessary JS strings: There’s no reason for `GET`, `GET_AND_SET` and `UTF8STRING` to be macros. Also, `GET` would previously create a JS string instance for each single call, even though the strings it was called with were compile-time constants. - Avoid unnecessary JS casts when the type of a value is known - Avoid (commonly unnecessary) copy for whitespace stripping PR-URL: https://github.com/nodejs/node/pull/19598 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
2018-03-30src: clean up `req.bytes` trackingAnna Henningsen
Simply always tell the caller how many bytes were written, rather than letting them track it. In the case of writing a string, also keep track of the bytes written by the earlier `DoTryWrite()`. Refs: https://github.com/nodejs/node/issues/19562 PR-URL: https://github.com/nodejs/node/pull/19551 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-30net: track bytesWritten in C++ landAnna Henningsen
Move tracking of `socket.bytesWritten` to C++ land. This makes it easier to provide this functionality for all `StreamBase` instances, and in particular should keep working when they have been 'consumed' in C++ in some way (e.g. for the network sockets that are underlying to TLS or HTTP2 streams). Also, this parallels `socket.bytesRead` a lot more now. PR-URL: https://github.com/nodejs/node/pull/19551 Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-30async_wrap: fix use-after-free for inspector sessionAnna Henningsen
This fixes the following condition: $ python -u tools/run-valgrind.py ./node_g test/sequential/test-inspector-async-call-stack.js [...] ==10848== Invalid read of size 4 ==10848== at 0x12F509E: node::AsyncWrap::provider_type() const (async_wrap-inl.h:34) ==10848== by 0x12E7642: node::AsyncWrap::EmitTraceEventAfter() (async_wrap.cc:208) ==10848== by 0x12F301B: node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) (async_wrap.cc:724) ==10848== by 0x14516C6: node::inspector::(anonymous namespace)::JSBindingsConnection::OnMessage(v8::Local<v8::Value>) (inspector_js_api.cc:88) ==10848== by 0x14514F1: node::inspector::(anonymous namespace)::JSBindingsConnection::JSBindingsSessionDelegate::SendMessageToFrontend(v8_inspector::StringView const&) (inspector_js_api.cc:57) ==10848== by 0x14436AD: node::inspector::(anonymous namespace)::ChannelImpl::sendMessageToFrontend(v8_inspector::StringView const&) (inspector_agent.cc:232) ==10848== by 0x1443627: node::inspector::(anonymous namespace)::ChannelImpl::sendResponse(int, std::unique_ptr<v8_inspector::StringBuffer, std::default_delete<v8_inspector::StringBuffer> >) (inspector_agent.cc:221) ==10848== by 0x15C54EA: v8_inspector::V8InspectorSessionImpl::sendProtocolResponse(int, std::unique_ptr<v8_inspector::protocol::Serializable, std::default_delete<v8_inspector::protocol::Serializable> >) (v8-inspector-session-impl.cc:165) ==10848== by 0x14C1E81: v8_inspector::protocol::DispatcherBase::sendResponse(int, v8_inspector::protocol::DispatchResponse const&, std::unique_ptr<v8_inspector::protocol::DictionaryValue, std::default_delete<v8_inspector::protocol::DictionaryValue> >) (Protocol.cpp:660) ==10848== by 0x14C1F0A: v8_inspector::protocol::DispatcherBase::sendResponse(int, v8_inspector::protocol::DispatchResponse const&) (Protocol.cpp:665) ==10848== by 0x14E68E3: v8_inspector::protocol::Debugger::DispatcherImpl::setAsyncCallStackDepth(int, std::unique_ptr<v8_inspector::protocol::DictionaryValue, std::default_delete<v8_inspector::protocol::DictionaryValue> >, v8_inspector::protocol::ErrorSupport*) (Debugger.cpp:1353) ==10848== by 0x14E2D49: v8_inspector::protocol::Debugger::DispatcherImpl::dispatch(int, v8_inspector::String16 const&, std::unique_ptr<v8_inspector::protocol::DictionaryValue, std::default_delete<v8_inspector::protocol::DictionaryValue> >) (Debugger.cpp:920) ==10848== Address 0x64e6f88 is 24 bytes inside a block of size 80 free'd ==10848== at 0x4C3123B: operator delete(void*) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==10848== by 0x14534F8: node::inspector::(anonymous namespace)::JSBindingsConnection::~JSBindingsConnection() (inspector_js_api.cc:34) ==10848== by 0x145187E: node::inspector::(anonymous namespace)::JSBindingsConnection::Disconnect() (inspector_js_api.cc:111) ==10848== by 0x14518C9: node::inspector::(anonymous namespace)::JSBindingsConnection::Disconnect(v8::FunctionCallbackInfo<v8::Value> const&) (inspector_js_api.cc:117) ==10848== by 0x166FF87: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) (api-arguments.cc:26) ==10848== by 0x172F829: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (builtins-api.cc:112) ==10848== by 0x172D85C: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (builtins-api.cc:142) ==10848== by 0x172D5F6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) (builtins-api.cc:130) ==10848== by 0x7895E1842C3: ??? ==10848== by 0x7895E19B737: ??? ==10848== by 0x7895E19B737: ??? ==10848== by 0x7895E18F9C2: ??? ==10848== Block was alloc'd at ==10848== at 0x4C3017F: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==10848== by 0x14517E8: node::inspector::(anonymous namespace)::JSBindingsConnection::New(v8::FunctionCallbackInfo<v8::Value> const&) (inspector_js_api.cc:103) ==10848== by 0x166FF87: v8::internal::FunctionCallbackArguments::Call(void (*)(v8::FunctionCallbackInfo<v8::Value> const&)) (api-arguments.cc:26) ==10848== by 0x172F113: v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<true>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) (builtins-api.cc:112) ==10848== by 0x172D748: v8::internal::Builtin_Impl_HandleApiCall(v8::internal::BuiltinArguments, v8::internal::Isolate*) (builtins-api.cc:138) ==10848== by 0x172D5F6: v8::internal::Builtin_HandleApiCall(int, v8::internal::Object**, v8::internal::Isolate*) (builtins-api.cc:130) ==10848== by 0x7895E1842C3: ??? ==10848== by 0x7895E1930DC: ??? ==10848== by 0x7895E293EAA: ??? ==10848== by 0x7895E19B737: ??? ==10848== by 0x7895E19B737: ??? ==10848== by 0x7895E19B737: ??? [...] PR-URL: https://github.com/nodejs/node/pull/19381 Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-29src: sort ENVIRONMENT_STRONG_PERSISTENT_PROPERTIESDaniel Bevenius
PR-URL: https://github.com/nodejs/node/pull/19627 Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-29src: rename fs_req_wrap -> FSReqWrapSyncDaniel Bevenius
This commit renames fs_req_wrap to FSReqWrapSync to make it consistent with most of the other classes in the code base. PR-URL: https://github.com/nodejs/node/pull/19614 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-28inspector: do not allow host namesEugene Ostroukhov
PR-URL: https://github.com/nodejs-private/node-private/pull/102/ Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2018-03-28inspector: check Host header for local connectionsEugene Ostroukhov
PR-URL: https://github.com/nodejs-private/node-private/pull/102/ Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
2018-03-27n-api: ensure in-module exceptions are propagatedGabriel Schulhof
Whenever we call into an addon, whether it is for a callback, for module init, or for async work-related reasons, we should make sure that * the last error is cleared, * the scopes before the call are the same as after, and * if an exception was thrown and captured inside the module, then it is re-thrown after the call. Therefore we should call into the module in a unified fashion. This change introduces the macro NAPI_CALL_INTO_MODULE() which should be used whenever invoking a callback provided by the module. Fixes: https://github.com/nodejs/node/issues/19437 PR-URL: https://github.com/nodejs/node/pull/19537 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-27tls: drop NPN (next protocol negotiation) supportBen Noordhuis
NPN has been superseded by ALPN. Chrome and Firefox removed support for NPN in 2016 and 2017 respectively to no ill effect. Fixes: https://github.com/nodejs/node/issues/14602 PR-URL: https://github.com/nodejs/node/pull/19403 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-27src: use `unordered_map` for perf marksAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/19558 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-27n-api: bump version of n-api supportedMichael Dawson
Bump the version due to additions to the api. PR-URL: https://github.com/nodejs/node/pull/19497 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-26src: drop CNNIC+StartCom certificate whitelistingBen Noordhuis
Remove the CNNIC certificates again and remove the whitelist from commit 3beb88071 ("crypto: add cert check to CNNIC Whitelist") from June 2015. PR-URL: https://github.com/nodejs/node/pull/19322 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-26crypto: update root certificatesBen Noordhuis
Update the list of root certificates in src/node_root_certs.h with tools/mk-ca-bundle.pl. Certificates added: - GDCA TrustAUTH R5 ROOT - SSL.com EV Root Certification Authority ECC - SSL.com EV Root Certification Authority RSA R2 - SSL.com Root Certification Authority ECC - SSL.com Root Certification Authority RSA - TrustCor ECA-1 - TrustCor RootCert CA-1 - TrustCor RootCert CA-2 Certificates removed: - ACEDICOM Root - AddTrust Low-Value Services Root - AddTrust Public Services Root - AddTrust ualified Certificates Root - CA Disig Root R1 - Camerfirma Chambers of Commerce Root - Camerfirma Global Chambersign Root - CA WoSign ECC Root - Certification Authority of WoSign G2 - Certinomis - Autorité Racine - Certum Root CA - China Internet Network Information Center EV Certificates Root - CNNIC ROOT - Comodo Secure Services root - Comodo Trusted Services root - DST ACES CA X6 - GeoTrust Global CA 2 - PSCProcert - Security Communication EV RootCA1 - StartCom Certification Authority - StartCom Certification Authority - StartCom Certification Authority G2 - Swisscom Root CA 1 - Swisscom Root CA 2 - Swisscom Root EV CA 2 - TUBITAK UEKAE Kok Sertifika Hizmet Saglayicisi - Surum 3 - TURKTRUST Certificate Services Provider Root 2007 - UTN USERFirst Hardware Root CA - WoSign - WoSign China PR-URL: https://github.com/nodejs/node/pull/19322 Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-26src: name all builtin init functions InitializeDaniel Bevenius
This commit renames a few of the builtin modules init functions to Initialize for consistency. PR-URL: https://github.com/nodejs/node/pull/19550 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-25src: remove unused 'ares.h' include from env.hAnna Henningsen
PR-URL: https://github.com/nodejs/node/pull/19557 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
2018-03-25src: ensure that `SetImmediate()`s have `HandleScope`sAnna Henningsen
Make sure that all native `SetImmediate()` functions have `HandleScope`s if they create handles. PR-URL: https://github.com/nodejs/node/pull/19470 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-25src: simplify http2 perf tracking codeAnna Henningsen
Use `unique_ptr`s and use the resulting simplification to reduce indentation in these functions. PR-URL: https://github.com/nodejs/node/pull/19470 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
2018-03-25Revert "process: add more version properties to release"Tobias Nießen
This reverts commit 982e3bdb1f06bf9d9926c808d30864b32a8223f9. It is believed that the original PR should not have landed as it is as the implemented and exposed API has a variety of flaws. PR-URL: https://github.com/nodejs/node/pull/19577 Refs: https://github.com/nodejs/node/pull/19438 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com>
2018-03-23crypto: add ECDH.convertKey to convert public keysWei-Wei Wu
ECDH.convertKey is used to convert public keys between different formats. PR-URL: https://github.com/nodejs/node/pull/19080 Fixes: https://github.com/nodejs/node/issues/18977 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
2018-03-23src: fix upcoming V8 deprecation warningsSarat Addepalli
PR-URL: https://github.com/nodejs/node/pull/19490 Fixes: https://github.com/nodejs/node/issues/18909 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
2018-03-22process: add more version properties to releaseGus Caplan
PR-URL: https://github.com/nodejs/node/pull/19438 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
2018-03-22vm: migrate isContext to internal/errorsdustinnewman98
PR-URL: https://github.com/nodejs/node/pull/19268 Refs: https://github.com/nodejs/node/issues/18106 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Jon Moss <me@jonathanmoss.me> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yuta Hiroto <hello@hiroppy.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-22inspector: migrate errors from C++ to JSMichaël Zasso
Assign a code to a user-facing error. Turn other internal-only errors to checks. PR-URL: https://github.com/nodejs/node/pull/19387 Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Eugene Ostroukhov <eostroukhov@google.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
2018-03-20n-api: add napi_fatal_exceptionMathias Buus
Add function to trigger and uncaught exception. Useful if an async callback throws an exception with no way to recover. PR-URL: https://github.com/nodejs/node/pull/19337 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
2018-03-20src: remove unused stdlib.h includeDaniel Bevenius
Commit 870229e66529309dfea932c52d718ddc2d734966 ("src: Add ABORT macro") replaced the abort call with the abort macro in util-inl.h. This commit removes the include as it is not needed anymore. PR-URL: https://github.com/nodejs/node/pull/19427 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2018-03-19perf_hooks,trace_events: fix timescale on bootstrap marksJames M Snell
PR-URL: https://github.com/nodejs/node/pull/19450 Reviewed-By: Anna Henningsen <anna@addaleax.net>
2018-03-19fs: improve errors in watchFile and unwatchFileJoyee Cheung
- Check if the watcher is active in JS land before invoking the binding, act as a noop if the state of the watcher does not match the expectation. This avoids firing 'stop' when the watcher is already stopped. - Update comments, validate more arguments and the type of the handle. - Handle the errors from uv_fs_poll_start - Create an `IsActive` helper method on StatWatcher PR-URL: https://github.com/nodejs/node/pull/19345 Refs: https://github.com/nodejs/node/pull/19089 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2018-03-19fs: fix memory leak in WriteStringJoyee Cheung
In the async case, if the buffer was copied instead of being moved then the buf will not get deleted after the request is done. This was introduced when the FSReqWrap:: Ownership was removed in 4b9ba9b, and ReleaseEarly was no longer called upon destruction of FSReqWrap. Create a custom Init function so we can use the MaybeStackBuffer in the FSReqBase to copy the string in the async case. The data will then get destructed when the FSReqBase is destructed. Fixes: https://github.com/nodejs/node/issues/19356 PR-URL: https://github.com/nodejs/node/pull/19357 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>