profile
viewpoint
Tobias Nießen tniessen Canada https://tnie.de Doing stuff with computers.

nodejs/node-core-utils 119

CLI tools for Node.js Core collaborators

cjihrig/uvwasi 88

WASI syscall API built atop libuv

tniessen/memfs-fuse 8

Simple fuse demo filesystem

tniessen/iperf-windows 5

Visual Studio solution to natively build iperf3 on Windows

tniessen/iperf-vsproj 2

iperf3: A TCP, UDP, and SCTP network bandwidth measurement tool

tniessen/node-args.js 2

Another Node.js argument parser

tniessen/cryptpad 1

Text editor for Windows supporting strong encryption

dthomso1/CubeSatSeniorDesign 0

CubeSatProject

tniessen/admin 0

Facilitating joint collaboration amongst the TSC and CommComm

tniessen/automation 0

Better automation for the Node.js project

pull request commentnodejs/node

fs: runtime deprecate closing FileHandle on garbage collection

@Uko The garbage collector should really only free memory that is not used anymore. Relying on the GC for cleaning up resources (e.g., closing file descriptors) is generally considered bad practice, because

  • in many implementations, when and how the GC runs is not deterministic,
  • resource cleanup might be slow and might therefore cause long GC times, and
  • resource cleanup itself might produce errors, which cannot be handled by the GC.
jasnell

comment created time in 5 days

pull request commentnodejs/node

doc: add Powershell oneliner to get Windows version

Replying to @saitonakamura:

maybe we can somehow mark it as optional?

and @DerekNonGeneric:

I have actually avoided reporting bugs with Node.js on Windows because of the ambiguity of this request.

Note that the template already says "Please fill in as much of the template below as you're able" (emphasis added). If this is ambigious, maybe the wording should be changed.

It's not clear what is meant by version: major number (7, 8, 10), build number, edition (Home, Pro, Enterprise), type (Server, Server Core) ?

@saitonakamura Fair point. From my perspective, version implies either the major number or build number (both would be okay), but that might be a translation issue.

It reports that my Windows Version is 10.0.17763. So, which is it?

@DerekNonGeneric I don't think it matters much. As far as I know, the BuildNumber, the WindowsVersion, the OsHardwareAbstractionLayer, and the WindowsProductName can all be used to identify the major Windows version. The exact build number rarely matters, and the distinction between desktop OS and server OS is often also not important.


(To be clear, I am not formally objecting. I did not block this PR and also won't do that in the future.)

saitonakamura

comment created time in 6 days

issue commentnodejs/webcrypto

How to install this package?

I am just curious whether or not github.com/nodejs has anything to do with nodejs.org, and if they belong to the same entity

https://github.com/nodejs is the GitHub organization of the Node.js project. The official website of the Node.js project is https://nodejs.org (the code behind the website is in https://github.com/nodejs/nodejs.org). So yes, both the GitHub organization "nodejs" and the domain "nodejs.org" belong to the Node.js project, which is now part of the OpenJS Foundation (formerly Node.js Foundation).

and if they belong to the same entity, why the future name of this package is not just 'webcrypto' like most other packages using nodejs?

For two reasons: First, the name "webcrypto" is already taken, the package already exists. We cannot simply remove a third-party package from npm. Second, unlike modules such as "fs" and "crypto", this is not a part of Node.js core, it is not a built-in module. Instead, it needs to be installed via npm, and we are leaning towards adding the namespace @nodejs to npm packages.

Jack-Works

comment created time in 6 days

issue commentmthom/scryer-prolog

Compiling and running scryer as a WebAssembly binary?

Unless using threads, terminal input cannot work anyway since the blocking read call would also block the browser event loop including input events to read user input. SWI-Prolog wasm version has exactly the same issue.

@rla It might be possible to avoid this in some browsers with only minimal modifications in scryer-prolog. I wrote synchronous-channel a while back to allow WebAssembly in worker threads to retrieve information (such as terminal input) from the main thread. I did not test the library in browsers, but it should work. So the idea would be for the main thread to write terminal input to a SynchronousChannel, and a worker thread running the WebAssembly code could read it from the SynchronousChannel. The library supports both blocking and non-blocking read and write operations.

do you happen to still have your changes somewhere? It would be a nice starting point.

I'll try to find and commit them, but it might take a few days.

rla

comment created time in 7 days

issue commentnodejs/admin

Add collaborators as "Read" to this repo

We should probably just unlock #516 then, and delete undesired comments quickly.

MylesBorins

comment created time in 7 days

issue commentnodejs/webcrypto

How to install this package?

Would you be so kind to rename the repository?

If we were to publish this, it would likely be under the name @nodejs/webcrypto, so I think the repository name is perfectly reasonable.

Jack-Works

comment created time in 7 days

issue commentnodejs/admin

Add collaborators as "Read" to this repo

Adding @nodejs/members with "Read" access might not help:

Citing @bnb from https://github.com/nodejs/admin/issues/516#issuecomment-650473171:

only people with write access to this repository can now comment, which excludes much of the project's collaborators.

GitHub seems to confirm this.

MylesBorins

comment created time in 8 days

issue commentWebAssembly/wasi-crypto

Finite field arithmetic

That's a really good point. This makes me wonder... Maybe it would be enough to provide these primitives? Sure, it would be a terribly long list, but if we assume that people need direct access to these primitives anyway, it doesn't matter. Maybe most cryptographic features could be implemented in WebAssembly then? For example, if we add timing-safe primitives, most timing vulnerabilities should not be a problem anymore. However, then hardware features such as AES acceleration are inaccessible again...

I am just putting this out there. I think it might not be entirely wrong to try to prevent WASI from becoming a full-featured crypto library with key import & export, hundreds of algorithms, ....

jedisct1

comment created time in 8 days

issue commentWebAssembly/wasi-crypto

Resumable host calls

Sorry @jedisct1. I really appreciate being involved in this, but I have barely had time to work through hundreds and hundreds of GitHub notifications from other projects for the last few months.

I think asynchronous behavior adds an incredible amount of complexity, and security aspects. That would require a background thread pool, which would somehow have to work together with explicit WebAssembly threads. (For example, WebAssembly in a browser should probably not be allowed to use 8 threads + 8 parallel asynchronous operations, which could easily use all available CPU resources.)

Asynchronous is what WebCrypto does, and it has its benefits for such a high-level environment (JavaScript in a browser). Node.js already has a thread pool and therefore also allows off-loading some crypto work to the thread pool. However, as long as WebAssembly does not have a unified concept of asynchronous background work (which will probably never be the case due to its low-level nature), I don't think we should add that complexity here.

jedisct1

comment created time in 8 days

issue commentnodejs/admin

Add collaborators as "Read" to this repo

+1 to @nodejs/members.

MylesBorins

comment created time in 8 days

pull request commentnodejs/node

doc: add Powershell oneliner to get Windows version

Thank you for the PR, @saitonakamura. I am -0 on this. I am not sure if adding such complexity to an otherwise simple template will actually help, or rather drive people away from using the template. I personally avoid PowerShell, but I guess it's universally available by now.

Most Node.js issues are not OS-specific, but people usually at least mention "Windows", even with the current template. Version and processor architecture are often unknown, but they are also rarely helpful or relevant. Windows 10 is now the only officially supported version, both from Microsoft's side and ours. In 2010, ten years ago, Microsoft reported that 50% of Windows users were already using 64 bit processors, and by now, that has probably gone up to 95% or so. I suspect the information gain will be very small.

saitonakamura

comment created time in 8 days

issue commentnodejs/node

Auditing @nodejs/platform-windows

stay

Trott

comment created time in 8 days

issue commentnodejs/webcrypto

JWK support for ecdsa

Thank you for opening the issue. Since Node.js itself has no support for JWK, support for JWK is sparse. I'll leave this open since it will have to be implemented eventually.

Jack-Works

comment created time in 8 days

issue commentnodejs/webcrypto

How to install this package?

Sorry, I wasn't particularly active on GitHub recently. This project is a protoype and so far, I have been the only person working on it. Less recently, due to a perceived lack of interest, and the realization that this likely never be a competitive implementation. WebCrypto doesn't do things the Node.js way, and Node.js doesn't do things the WebCrypto way.

Jack-Works

comment created time in 8 days

issue commentnodejs/webcrypto

feature request: exposing crypto interface directly

It just takes two more characters:

const { crypto } = require("webcrypto");
colourful-land

comment created time in 8 days

issue commentmthom/scryer-prolog

Compiling and running scryer as a WebAssembly binary?

Would it be possible to build scryer as a WebAssembly binary?

I did that one or two months ago, based on c342d18f926a5e5778204e35f80e44844482ae45. It seems possible, but it certainly isn't trivial.

Compilation problems

  1. The rug dependency doesn't work with WebAssembly. I exchanged a few emails with @tspiteri, and it seemed challenging to cross-compile GMP. Workaround: Remove the rug dependency and change the default features to ["num"], which uses num-rug-adapter.

  2. I couldn't get the crossterm crate to work, which is not really a surprise given the lack of a terminal in WebAssembly, but there might be a solution that I missed. Workaround: Remove crossterm and adapt get_single_char in src/prolog/machine/system_calls.rs to use an imported function raw_mode_single_char instead (which needs to be implemented in JavaScript):

    extern "C" {
      pub fn raw_mode_single_char() -> u32;
    }
    
    pub fn get_single_char() -> char {
      unsafe {
        return char::from_u32(raw_mode_single_char()).unwrap();
      }
    }
    
  3. ProcessTime won't work in WebAssembly. Workaround: Replace or remove ProcessTime::now() in src/prolog/machine/system_calls.rs.

  4. Signal handling doesn't work in WebAssembly. Workaround: Remove signal handling logic in src/main.rs. (Probably not necessary if you are building the project as a library instead of an executable binary.)

Cross-compiling

I don't remember the exact command I used to compile it, but I used rustup's nightly toolchain for the wasm32-wasi target.

Syscalls in the browser

I implemented necessary syscalls to an extent that allowed to load a prolog source file from a virtual in-browser file system. Apart from that, I left most of the wasi syscalls unimplemented, but someone with more time could probably get most of them to work.

Result

I got this tiny "Hello world" to work eventually:

:- initialization(hello_world).

hello_world :-
    write('Hello, World!'), nl.

Partial screenshot of the web page (with some debugging info):

prolog-webassembly

I didn't try much more after that, this had already taken me many hours and I mostly did it to gain some experience with Rust → WebAssembly.

rla

comment created time in 8 days

issue commentnodejs/node

Supported asymmetric key types

@jasnell I think so, yes. Please leave it open for now.

tniessen

comment created time in 10 days

startedsandboxie/sandboxie

started time in 13 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

Thanks @addaleax, seems to work!

tniessen

comment created time in 14 days

push eventtniessen/node

Tobias Nießen

commit sha c5d802450c2b8c18f0ad70a4d1dba529d83087ef

fixup! crypto: allow KeyObjects in postMessage

view details

push time in 14 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

I’ve taken the liberty to fix them directly since they’re my fault here, I hope that’s okay

Yes, thank you!


There is one related failure on node-test-commit-custom-suites-freestyle (not quite sure what that job does):

test.parallel/test-crypto-key-objects-messageport
fail (-15)
timeout
tniessen

comment created time in 14 days

pull request commentnodejs/node

stream: add closed property

At least semver-minor, I assume.

ronag

comment created time in 16 days

push eventtniessen/node

Tobias Nießen

commit sha 43a87c7262b38ed99a43bbf5015298fd92e9eca0

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net>

view details

push time in 16 days

push eventtniessen/node

Tobias Nießen

commit sha 9aed5e085061fe0c565c3f2e9add25ef2a62096d

Update src/node_crypto.cc Co-authored-by: Anna Henningsen <github@addaleax.net>

view details

push time in 16 days

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

 void KeyObject::Export(const FunctionCallbackInfo<Value>& args) {     args.GetReturnValue().Set(result.ToLocalChecked()); } -Local<Value> KeyObject::ExportSecretKey() const {-  return Buffer::Copy(env(), symmetric_key_.get(), symmetric_key_len_)-      .ToLocalChecked();+Local<Value> KeyObjectHandle::ExportSecretKey() const {+  const char* buf = data_->GetSymmetricKey();+  unsigned int len = data_->GetSymmetricKeySize();+  return Buffer::Copy(env(), buf, len).ToLocalChecked(); } -MaybeLocal<Value> KeyObject::ExportPublicKey(+MaybeLocal<Value> KeyObjectHandle::ExportPublicKey(     const PublicKeyEncodingConfig& config) const {-  return WritePublicKey(env(), asymmetric_key_.get(), config);+  return WritePublicKey(env(), data_->GetAsymmetricKey().get(), config); } -MaybeLocal<Value> KeyObject::ExportPrivateKey(+MaybeLocal<Value> KeyObjectHandle::ExportPrivateKey(     const PrivateKeyEncodingConfig& config) const {-  return WritePrivateKey(env(), asymmetric_key_.get(), config);+  return WritePrivateKey(env(), data_->GetAsymmetricKey().get(), config);+}++void NativeKeyObject::New(const FunctionCallbackInfo<Value>& args) {+  Environment* env = Environment::GetCurrent(args);+  CHECK_EQ(args.Length(), 1);+  CHECK(args[0]->IsObject());+  KeyObjectHandle* handle = Unwrap<KeyObjectHandle>(args[0].As<Object>());+  new NativeKeyObject(env, args.This(), handle->Data());+}++BaseObjectPtr<BaseObject> NativeKeyObject::KeyObjectTransferData::Deserialize(+        Environment* env,+        Local<Context> context,+        std::unique_ptr<worker::TransferData> self) {+  if (context != env->context()) {+    THROW_ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE(env);+    return {};+  }++  Local<Value> handle = KeyObjectHandle::Create(env, data_).ToLocalChecked();+  Local<Function> key_ctor;+  switch (data_->GetKeyType()) {+    case kKeyTypeSecret:+      key_ctor = env->crypto_key_object_secret_constructor();+      break;+    case kKeyTypePublic:+      key_ctor = env->crypto_key_object_public_constructor();+      break;+    case kKeyTypePrivate:+      key_ctor = env->crypto_key_object_private_constructor();+      break;+    default:+      CHECK(false);+  }++  Local<Value> key =+      key_ctor->NewInstance(context, 1, &handle).ToLocalChecked();+  return BaseObjectPtr<BaseObject>(Unwrap<KeyObjectHandle>(key.As<Object>()));+}++BaseObject::TransferMode NativeKeyObject::GetTransferMode() const {+  return BaseObject::TransferMode::kCloneable;+}++std::unique_ptr<worker::TransferData> NativeKeyObject::CloneForMessaging()+    const {+  return std::make_unique<KeyObjectTransferData>(handle_data_);+}++static void CreateNativeKeyObject(const FunctionCallbackInfo<Value>& args) {+  Environment* env = Environment::GetCurrent(args);++  CHECK_EQ(args.Length(), 1);+  Local<Value> callback = args[0];+  CHECK(callback->IsFunction());++  Local<FunctionTemplate> t = env->NewFunctionTemplate(NativeKeyObject::New);+  t->InstanceTemplate()->SetInternalFieldCount(+      KeyObjectHandle::kInternalFieldCount);+  t->Inherit(BaseObject::GetConstructorTemplate(env));++  Local<Value> ctor = t->GetFunction(env->context()).ToLocalChecked();++  Local<Value> recv = Undefined(env->isolate());+  Local<Array> ret =+      callback.As<Function>()->Call(env->context(), recv, 1, &ctor)+      .ToLocalChecked()+      .As<Array>();+  env->set_crypto_key_object_secret_constructor(+      ret->Get(env->context(), 1).ToLocalChecked().As<Function>());+  env->set_crypto_key_object_public_constructor(+      ret->Get(env->context(), 2).ToLocalChecked().As<Function>());+  env->set_crypto_key_object_private_constructor(+      ret->Get(env->context(), 3).ToLocalChecked().As<Function>());+  args.GetReturnValue().Set(ret);

This function is only called once by lib/internal/crypto/keys.js. In my opinion, any error would be a bug in Node.js and should terminate the process. Happy to change it if you disagree.

tniessen

comment created time in 16 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

Right, I was misled by the name to think that it would create one KeyObject object per call, not multiple classes :)

You are right, the name is misleading. I renamed the method while resolving conflicts :)

Nice work, LGTM!

Thank you for all your help (and your patience!) :)

tniessen

comment created time in 16 days

push eventtniessen/node

Daniel Bevenius

commit sha f645cc73185f1d690e82b01907e2c0da330a26de

tools: prevent js2c from running if nothing changed This commit updates tools/js2c.py to touch the target output file , <(SHARED_INTERMEDIATE_DIR)/node_javascript.cc, even if the content has not changed. This is to "help" the build system so that it can compare the inputs against the output to determine if the gyp action should be run. I believe the issue here is that if js2c.py is updated this can cause the action to be run as the node_javascript.cc target would be older than js2c.py. But when the target is run the timestamp for node_javascript.cc will not be updated (because we have not changed anything that would change the contents of the file) so the js2c.py prerequisite will always be passed and the target always run. Using the update in this commit one would have to touch/modify one of the js files specified in the library_files list, config.gypi, or tools/js2c.py for this action to be run again. PR-URL: https://github.com/nodejs/node/pull/33844 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Anna Henningsen

commit sha b371213d3d2b499f0392af2103cf45262e1042d3

src: add public APIs to manage v8::TracingController We added a hack for this a while ago for Electron, so let’s remove that hack and make this an official API. Refs: https://github.com/nodejs/node/pull/28724 Refs: https://github.com/nodejs/node/issues/33800 PR-URL: https://github.com/nodejs/node/pull/33850 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

James M Snell

commit sha a808cb76ce1d2f18f354ced39f41f4a4e92b4ec9

test: add common/udppair utility Extracted from the QUIC PR. This adds a utility used to deterministically test UDP traffic. It is currently only used by the experimental QUIC implementation. Separated out on request to make review easier. PR-URL: https://github.com/nodejs/node/pull/33380 Reviewed-By: Sam Roberts <vieuxtech@gmail.com>

view details

Todd Short

commit sha 2c549e505e8614ad184cfdb939db2cce7df1bfe6

deps: add support for BoringSSL QUIC APIs Acquired from: https://github.com/akamai/openssl/tree/OpenSSL_1_1_1f-quic Squashed: * https://github.com/akamai/openssl/commit/2ef7c58b2cb432abd4e371322667228d7ce2637b * https://github.com/akamai/openssl/commit/3f8eda3128f52f4d14399a1a912d1fdfacd86a86 * https://github.com/akamai/openssl/commit/b37f665884be2e17e8ff4ad919138626fb13f6c9 * https://github.com/akamai/openssl/commit/6b235895a16da3c0dd36a24cf8dfbe249c6cda3c * https://github.com/akamai/openssl/commit/3a793e06a5031311ce7ce094455be87fa92b8240 PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha 98c84985527b85d08a4876dd68430dff191a560e

deps: update archs files for OpenSSL-1.1.0 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/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha f96b981528da1f2fc9044211e5edf357f97dcfba

deps: details for updating openssl quic support Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha 834fa8f23fbfd86b88567d87f984b4737401d354

deps: add ngtcp2 and nghttp3 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha bccb514936ab5f225bb9fb7cda259490322321c1

deps: maintaining ngtcp2 and nghttp3 Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha 55360443ced34515c775c5beb29f907de671dffe

quic: initial QUIC implementation Co-authored-by: Anna Henningsen <anna@addaleax.net> Co-authored-by: Daniel Bevenius <daniel.bevenius@gmail.com> Co-authored-by: gengjiawen <technicalcute@gmail.com> Co-authored-by: James M Snell <jasnell@gmail.com> Co-authored-by: Lucas Pardue <lucaspardue.24.7@gmail.com> Co-authored-by: Ouyang Yadong <oyydoibh@gmail.com> Co-authored-by: Juan Jos<C3><A9> Arboleda <soyjuanarbol@gmail.com> Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com> Co-authored-by: Denys Otrishko <shishugi@gmail.com> PR-URL: https://github.com/nodejs/node/pull/32379 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha bc71278563b60caba7e2d39c170d439a205ff529

events: lazy load perf_hooks for EventTarget PR-URL: https://github.com/nodejs/node/pull/33717 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Dan Fabulich

commit sha ff74e35c0bfc206fdbac21b5df61edf860a3267b

process: add unhandled-rejection throw and warn-with-error-code This PR defines two new modes for the --unhandled-rejections flag. The first mode is called "throw". The "throw" mode first emits unhandledRejection. If this hook is not set, the "throw" mode will raise the unhandled rejection as an uncaught exception. The second mode is called "warn-with-error-code". The "warn-with-error-code" mode first emits unhandledRejection. If this hook is not set, the "warn-with-error-code" mode will trigger a warning and set the process's exit code to 1. The PR doesn't change the default behavior for unhandled rejections. That will come in a separate PR. Refs: https://github.com/nodejs/node/pull/33021 PR-URL: https://github.com/nodejs/node/pull/33475 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

James M Snell

commit sha 14d012ef96f25b097ca8d87cf32f173e3aa3bf7e

quic: fix minor linting issue PR-URL: https://github.com/nodejs/node/pull/33913 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com>

view details

Rich Trott

commit sha ee7f0e3f7550508f20c3d7f7c6b2be78a0a9a938

doc,stream: split finish and end events into separate entries The stream doc has the only instance in our docs where two events are combined into a single entry. Split them into separate adjacent entries. PR-URL: https://github.com/nodejs/node/pull/33881 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Pranshu Srivastava

commit sha 1e4187fcf4b8cc27df027fee2c4c266f17f14161

http2: add `invalidheaders` test Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33161 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com>

view details

Mathias Buus

commit sha 50fb0199cd274b177e596310018aa02c8067bcb2

n-api: document nextTick timing in callbacks PR-URL: https://github.com/nodejs/node/pull/33804 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Shelley Vohr

commit sha e9145dbaeff1c7217f51982bd8aa3934a8e42575

2020-06-17, Version 12.18.1 'Erbium' (LTS) Notable changes: deps: * V8: cherry-pick 548f6c81d424 (Dominykas Blyžė) [#33484](https://github.com/nodejs/node/pull/33484) * update to uvwasi 0.0.9 (Colin Ihrig) [#33445](https://github.com/nodejs/node/pull/33445) * upgrade to libuv 1.38.0 (Colin Ihrig) [#33446](https://github.com/nodejs/node/pull/33446) * upgrade npm to 6.14.5 (Ruy Adorno) [#33239](https://github.com/nodejs/node/pull/33239) PR-URL: https://github.com/nodejs/node/pull/33811

view details

Anna Henningsen

commit sha 133a97f60d0052496550f3423cbae9e20ecf9c7b

quic: always copy stateless reset token Take ownership of the token value, since the memory for it is allocated anyway and the buffer size is just 16, i.e. copyable very cheaply. This makes valgrind stop complaining about a use-after-free error when running `sequential/test-quic-preferred-address-ipv6`. PR-URL: https://github.com/nodejs/node/pull/33917 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

Daniel Bevenius

commit sha 4b70f95d6451d986596547cdfbbfe65f97d68532

quic: use Check instead of FromJust in QuicStream This commit uses Maybe::Check() instead of Maybe::FromJust() as the return value is not used. PR-URL: https://github.com/nodejs/node/pull/33909 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

James M Snell

commit sha 272b46e04d73f72e918c4be4aea0fb7cb90254e2

quic: skip test-quic-preferred-address-ipv6.js when no ipv6 PR-URL: https://github.com/nodejs/node/pull/33919 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>

view details

Brian White

commit sha a4f3206b767bee8ef3e0e1dc8bdbd5e477c5bfa6

events: improve listeners() performance PR-URL: https://github.com/nodejs/node/pull/33863 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>

view details

push time in 16 days

issue commentnodejs/TSC

Node.js Technical Steering Committee (TSC) Meeting 2020-06-18

Too late for me (11pm), sorry.

mhdawson

comment created time in 18 days

Pull request review commentnodejs/node

crypto: add OP flag constants added in OpenSSL v1.1.1

 the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.     <td><code>SSL_OP_PKCS1_CHECK_2</code></td>     <td></td>   </tr>+  <tr>+    <td><code>SSL_OP_PRIORITIZE_CHACHA</code></td>+    <td>Instructs OpenSSL server to prioritize ChaCha20Poly1305+    when client does.+    This option has no effect if SSL_OP_CIPHER_SERVER_PREFERENCE

Nit: Please wrap SSL_OP_CIPHER_SERVER_PREFERENCE in <code> or similar, too.

mkrawczuk

comment created time in 18 days

Pull request review commentnodejs/node

crypto: add OP flag constants added in OpenSSL v1.1.1

 the `crypto`, `tls`, and `https` modules and are generally specific to OpenSSL.     <a href="https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html">https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html</a>     for detail.</td>   </tr>+  <tr>+    <td><code>SSL_OP_ALLOW_NO_DHE_KEX</code></td>+    <td>Instructs OpenSSL to allow a non-[EC]DHE-based key exchane mode

Nit: exchaneexchange

mkrawczuk

comment created time in 18 days

push eventtniessen/node

Tobias Nießen

commit sha 946e9968f550924d4598bfa331dd07db765356be

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net>

view details

push time in 18 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

As for the error … in CreateNativeKeyObject(), the FunctionTemplate doesn’t inherit from the BaseObject template. I think that was the place where I mentioned I was getting merge conflicts :)

Right, you mentioned that! Thank you :)

As a side note, you generally don’t want to create a new FunctionTemplate per object but rather use a single one, because V8 caches FunctionTemplates, so this would appear like a memory leak, similar to the one fixed by 978d89f.

@addaleax Could you clarify this? From my perspective, CreateNativeKeyObject creates the JS class NativeKeyObject (once), and creating instances of NativeKeyObject should not cause new FunctionTemplates to be created.

tniessen

comment created time in 18 days

push eventtniessen/node

Tobias Nießen

commit sha 77d4b6c86f1c9a71bbb83b73890e3cfceb82e6d2

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net>

view details

push time in 18 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

Also, I see that you added a JSTransferable class. Would it make more sense to use that instead of NativeKeyObject?

tniessen

comment created time in 18 days

pull request commentnodejs/node

Allow passing KeyObjects via postMessage

@addaleax I rebased it, but either (a) there was a bug in this PR before, or (b) I broke something while rebasing this PR, or (c) something changed on the upstream branch that I didn't see.

Passing KeyObject instances to postMessage now throws:

DOMException [DataCloneError]: Cannot transfer object of unsupported type.
tniessen

comment created time in 18 days

push eventtniessen/node

Michaël Zasso

commit sha dcc112b7f7e7543e57b279d95a5bbb24ef771652

2020-05-26, Version 12.17.0 'Erbium' (LTS) Notable changes: * ECMAScript Modules - `--experimental-modules` flag removal * AsyncLocalStorage API (experimental) * REPL previews * REPL reverse-i-search * REPL substring-based search * Error monitoring * Monitoring `error` events * Monitoring uncaught exceptions * File system APIs * New function: `fs.readv` * Optional parameters in `fs.read` * Console `groupIndentation` option * `maxStringLength` option for `util.inspect()` * Stable N-API release 6 * Stable diagnostic reports * Increase of the default server headers timeout * New `--trace-sigint` CLI flag * Various crypto APIs now support Diffie-Hellman secrets * Added support for the `dns.ALL` flag in `dns.lookup()` * Added a new experimental API to interact with Source Map V3 data * Added support for passing a `transferList` along with `workerData` to the `Worker` constructor PR-URL: https://github.com/nodejs/node/pull/33197

view details

Robert Nagy

commit sha 9949a2e1e3100c4ff1f228bac57c1af95cdc3e9d

test: make flaky test stricter Make assertions in flaky test stricter to possibly make it easier to determine the root cause. Refs: https://github.com/nodejs/node/issues/4066 PR-URL: https://github.com/nodejs/node/pull/33539 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Robert Nagy

commit sha fb8cc72e738f2854302bf270b2f3997bc273b9a6

stream: construct Provide a standardized way of asynchronously creating and initializing resources before performing any work. Refs: https://github.com/nodejs/node/issues/29314 PR-URL: https://github.com/nodejs/node/pull/29656 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>

view details

Robert Nagy

commit sha 54b36e401d2b72d95e5f1dbbc787f6beed639347

fs: reimplement read and write streams using stream.construct Refs: #23133 PR-URL: https://github.com/nodejs/node/pull/29656 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Denys Otrishko <shishugi@gmail.com>

view details

Jan Krems

commit sha d12d5ef3ef8e5d9f6a755d72c4b8ddc82658dee9

module: remove dynamicInstantiate loader hook The dynamicInstantiate loader hook requires that the hooks run in the same global scope as the code being loaded. We don't want to commit to this being true in the future. It stops us from sharing hooks between multiple worker threads or isolating loader hook from the application code. Using `getSource` and `getGlobalPreloadCode` the same use cases should be covered. PR-URL: https://github.com/nodejs/node/pull/33501 Reviewed-By: Geoffrey Booth <webmaster@geoffreybooth.com> Reviewed-By: Guy Bedford <guybedford@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>

view details

Daniel Bevenius

commit sha 27d347b56b1a36d479b4b6b23dca8ea34fecc55c

src: use NewFromUtf8Literal in GetLinkedBinding This commit changes the usage of NewFromUtf8 to NewFromUtf8Literal. The motivation for this change is that NewFromUtf8Literal is a templated function that takes a char[N] argument so the length of the string can be asserted at compile time, avoiding length checks that NewFromUtf8 performs. My understanding is that since these checks can be performed at compile time, checking that the string is not zero and checking that it is not greater than kMaxLength, this function does not have to return a MaybeLocal<String> and can return a Local<String> meaning that the additional ToLocalChecked call is avoided. PR-URL: https://github.com/nodejs/node/pull/33552 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Daniel Bevenius

commit sha 47044a91c6269a395098cf74d4b2a2e70df5c321

src: use MaybeLocal.ToLocal instead of IsEmpty This commit suggest using MaybeLocal.ToLocal and passing in the Local<Function> fn. The motivation for doing this is that the following MaybeLocal.ToLocalChecked call can then be avoided. PR-URL: https://github.com/nodejs/node/pull/33554 Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

James M Snell

commit sha 785842a053d62820027c6b62b41110113a7f1755

events: initial implementation of experimental EventTarget See documentation changes for details Signed-off-by: James M Snell <jasnell@gmail.com> PR-URL: https://github.com/nodejs/node/pull/33556 Refs: https://github.com/nodejs/node/pull/33527 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Bradley Farias <bradley.meck@gmail.com>

view details

Daniel Bevenius

commit sha 4a20cc937f6a2b830a2752e35da7e389bbc4e006

src: remove unused using declarations This commit removes the unused using declarations reported by lint-cpp. PR-URL: https://github.com/nodejs/node/pull/33268 Refs: https://github.com/nodejs/node/issues/29226 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>

view details

Richard Lau

commit sha 05db68245ba63bc908d09c1cc64098ce97fa9d1f

tools: fix check-imports.py to match on word boundaries `check-imports.py` was missing some unused `using` statements as it was not matching on word boundaries (e.g. `MaybeLocal` was considered a use of `Local`). Fix that and add some unit tests (which required the script to be renamed to drop the `-` so it could be imported into the test script). PR-URL: https://github.com/nodejs/node/pull/33268 Refs: https://github.com/nodejs/node/issues/29226 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Christian Clauss <cclauss@me.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>

view details

himself65

commit sha f19a576f6c73d21064699c8cc81a26ac5139a88b

http: simplify Agent initialization PR-URL: https://github.com/nodejs/node/pull/33551 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Denys Otrishko <shishugi@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com>

view details

Ash Cripps

commit sha fb33b673f1809aa51e5edda76ba6f29377b55893

meta: add flaky test issue template Add a flaky test issue template to ensure that enough information is provided for investigation PR-URL: https://github.com/nodejs/node/pull/33500 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>

view details

Gabriel Schulhof

commit sha 6a1df3b5afc92f438cf84621abd8cda79d9b1b17

n-api: remove `napi_env::CallIntoModuleThrow` Give `napi_env::CallIntoModule` the thrower used by `CallIntoModuleThrow` as its default second argument. That way we do not need two different methods on `napi_env` for calling into the addon. PR-URL: https://github.com/nodejs/node/pull/33570 Signed-off-by: Gabriel Schulhof <gabriel.schulhof@intel.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>

view details

Pranshu Srivastava

commit sha c095808e7363f1b6f6d2fbe3e3cd07173d319820

http2: use `Object.create(null)` for `getHeaders` refactor `getHeaders` to initialize headers using `Object.create(null)` Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33188 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Richard Lau

commit sha 69612b70da7cec270bc96ac3741076eb5d26b742

build: fix python-version selection with actions s/PYTHON\_VERSION/python-version Refs: https://github.com/actions/setup-python Refs: https://github.com/nodejs/node/pull/32609 PR-URL: https://github.com/nodejs/node/pull/33589 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com>

view details

Shelley Vohr

commit sha 0ff3819481e0d1a810f2a3c8e19ad99f413ce704

src: don't use semicolon outside function PR-URL: https://github.com/nodejs/node/pull/33592 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Zeke Sikelianos

commit sha f08174c9fb155a5549dafcd972cf63e4a63bf24e

doc: update ```txt ```fandamental and ```raw code blocks These are changed to either ```text or ```console. PR-URL: https://github.com/nodejs/node/pull/33028 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Pranshu Srivastava

commit sha de35c030b5a1b86ad06bdd3e5cc4608fa67f4893

http2: add type checks for Http2ServerResponse.end Refs: https://github.com/nodejs/node/issues/29829 PR-URL: https://github.com/nodejs/node/pull/33146 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

João Reis

commit sha 2c0a4fab11f8aa866056a857a42b55a1882391b6

win: allow skipping the supported platform check Fixes: https://github.com/nodejs/node/issues/33034 PR-URL: https://github.com/nodejs/node/pull/33176 Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Pranshu Srivastava

commit sha df31f71f1e79016ae4914d9d768b5333ea4fe31f

http2: header field valid checks checks validity for request, writeHead, and setHeader methods PR-URL: https://github.com/nodejs/node/pull/33193 Refs: https://github.com/nodejs/node/issues/29829 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>

view details

push time in 18 days

pull request commentnodejs/node-addon-api

Add ArrayBuffer::Detach() and ::IsDetached()

Yes, sorry @mhdawson, I do intend to work on this. I didn't find much time recently.

tniessen

comment created time in a month

Pull request review commentnodejs/node

Allow passing FileHandle objects via postMessage

 Local<FunctionTemplate> GetMessagePortConstructorTemplate(Environment* env) {   return GetMessagePortConstructorTemplate(env); } +JSTransferable::JSTransferable(Environment* env, Local<Object> obj)+    : BaseObject(env, obj) {+  MakeWeak();+}++void JSTransferable::New(const FunctionCallbackInfo<Value>& args) {+  CHECK(args.IsConstructCall());+  new JSTransferable(Environment::GetCurrent(args), args.This());+}++JSTransferable::TransferMode JSTransferable::GetTransferMode() const {+  // Implement `kClone in this ? kCloneable : kTransferable`.+  HandleScope handle_scope(env()->isolate());+  errors::TryCatchScope ignore_exceptions(env());++  bool has_clone;+  if (!object()->Has(env()->context(),+                     env()->messaging_clone_symbol()).To(&has_clone)) {+    return TransferMode::kUntransferable;+  }++  return has_clone ? TransferMode::kCloneable : TransferMode::kTransferable;+}++std::unique_ptr<TransferData> JSTransferable::TransferForMessaging() {+  return TransferOrClone(TransferMode::kTransferable);+}++std::unique_ptr<TransferData> JSTransferable::CloneForMessaging() const {+  return TransferOrClone(TransferMode::kCloneable);+}++std::unique_ptr<TransferData> JSTransferable::TransferOrClone(+    TransferMode mode) const {+  // Call `this[symbol]()` where `symbol` is `kClone` or `kTransfer`,+  // which should return an object with `data` and `deserializeInfo` properties;+  // `data` is written to the serializer later, and `deserializeInfo` is stored+  // on the `TransferData` instance as a string.+  HandleScope handle_scope(env()->isolate());+  Local<Context> context = env()->isolate()->GetCurrentContext();+  Local<Symbol> method_name = mode == TransferMode::kCloneable ?+      env()->messaging_clone_symbol() : env()->messaging_transfer_symbol();++  Local<Value> method;+  if (!object()->Get(context, method_name).ToLocal(&method)) {+    return {};+  }+  if (method->IsFunction()) {+    Local<Value> result_v;+    if (!method.As<Function>()->Call(+            context, object(), 0, nullptr).ToLocal(&result_v)) {+      return {};+    }++    if (result_v->IsObject()) {+      Local<Object> result = result_v.As<Object>();+      Local<Value> data;+      Local<Value> deserialize_info;+      if (!result->Get(context, env()->data_string()).ToLocal(&data) ||+          !result->Get(context, env()->deserialize_info_string())+              .ToLocal(&deserialize_info)) {+        return {};+      }+      Utf8Value deserialize_info_str(env()->isolate(), deserialize_info);+      if (*deserialize_info_str == nullptr) return {};+      return std::make_unique<Data>(+          *deserialize_info_str, Global<Value>(env()->isolate(), data));+    }+  }++  if (mode == TransferMode::kTransferable)+    return TransferOrClone(TransferMode::kCloneable);+  else+    return {};+}++Maybe<BaseObjectList>+JSTransferable::NestedTransferables() const {+  // Call `this[kTransferList]()` and return the resulting list of BaseObjects.+  HandleScope handle_scope(env()->isolate());+  Local<Context> context = env()->isolate()->GetCurrentContext();+  Local<Symbol> method_name = env()->messaging_transfer_list_symbol();++  Local<Value> method;+  if (!object()->Get(context, method_name).ToLocal(&method)) {+    return Nothing<BaseObjectList>();+  }+  if (!method->IsFunction()) return Just(BaseObjectList {});++  Local<Value> list_v;+  if (!method.As<Function>()->Call(+          context, object(), 0, nullptr).ToLocal(&list_v)) {+    return Nothing<BaseObjectList>();+  }+  if (!list_v->IsArray()) return Just(BaseObjectList {});+  Local<Array> list = list_v.As<Array>();++  BaseObjectList ret;+  for (size_t i = 0; i < list->Length(); i++) {+    Local<Value> value;+    if (!list->Get(context, i).ToLocal(&value))+      return Nothing<BaseObjectList>();+    if (env()->base_object_ctor_template()->HasInstance(value))+      ret.emplace_back(Unwrap<BaseObject>(value));+  }+  return Just(ret);+}++Maybe<bool> JSTransferable::FinalizeTransferRead(+    Local<Context> context, ValueDeserializer* deserializer) {+  // Call `this[kDeserialize](data)` where `data` comes from the return value+  // of `this[kTransfer]()` or `this[kClone]()`.+  HandleScope handle_scope(env()->isolate());+  Local<Value> data;+  if (!deserializer->ReadValue(context).ToLocal(&data)) return Nothing<bool>();++  Local<Symbol> method_name = env()->messaging_deserialize_symbol();+  Local<Value> method;+  if (!object()->Get(context, method_name).ToLocal(&method)) {+    return Nothing<bool>();+  }+  if (!method->IsFunction()) return Just(true);++  if (method.As<Function>()->Call(context, object(), 1, &data).IsEmpty()) {+    return Nothing<bool>();+  }+  return Just(true);+}++JSTransferable::Data::Data(std::string&& deserialize_info,+                           v8::Global<v8::Value>&& data)+    : deserialize_info_(std::move(deserialize_info)),+      data_(std::move(data)) {}++BaseObjectPtr<BaseObject> JSTransferable::Data::Deserialize(+    Environment* env,+    Local<Context> context,+    std::unique_ptr<TransferData> self) {+  // Create the JS wrapper object that will later be filled with data passed to+  // the `[kDeserialize]()` method on it. This split is necessary, because here+  // we need to create an object with the right prototype and internal fields,+  // but the actual JS data stored in the serialized data can only be read at+  // the end of the stream, after the main message has been read.++  if (context != env->context()) {+    // It would be nice to throw some kind of exception here, but how do we+    // pass that to end users? For now, just drop the message silently.+    return {};+  }

Thank you for explaining these changes, it's very helpful :-) I'll try to do the same in my PR :)

addaleax

comment created time in a month

startedsql-js/sql.js

started time in a month

issue commentnodejs/TSC

Node.js Technical Steering Committee (TSC) Meeting 2020-06-04

@Trott It ended :)

mhdawson

comment created time in a month

issue commentnodejs/node

Proposal: remove minimal time limit for semver-patch prs

Alternatively, the first author approving a "trivial" change can suggest fast-tracking, and as soon as another collaborator approves the PR + fast tracking (and CI is green etc.), it can land.

jasnell

comment created time in a month

Pull request review commentnodejs/node

napi: add __wasm32__ guards

 typedef struct {     }                                                                 \   EXTERN_C_END +#ifdef __wasm32__+#define NAPI_MODULE(modname, regfunc)                                          \+  EXTERN_C_START                                                               \+  NAPI_MODULE_EXPORT napi_value _napi_register(napi_env env,                   \+                                               napi_value exports) {           \+    return regfunc(env, exports);                                              \+  }                                                                            \+  EXTERN_C_END

Why is this change necessary? Just to have a predictable function name?

devsnek

comment created time in a month

startedgoogle/crc32c

started time in a month

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

+'use strict';+const common = require('../common');+if (!common.hasCrypto)+  common.skip('missing crypto');++const assert = require('assert');+const { createSecretKey, generateKeyPairSync } = require('crypto');+const { createContext } = require('vm');+const { MessageChannel, moveMessagePortToContext } = require('worker_threads');++const secretKey = createSecretKey(Buffer.alloc(32));+const { publicKey, privateKey } = generateKeyPairSync('rsa', {+  modulusLength: 1024+});++function keyToString(key) {+  if (key.type === 'secret') {+    return key.export().toString('hex');+  } else {+    return key.export({ type: 'pkcs1', format: 'pem' });+  }+}++// Get immutable representations of all keys.+const keys = [secretKey, publicKey, privateKey]+             .map((key) => [key, keyToString(key)]);++for (const [key, repr] of keys) {+  {+    const { port1, port2 } = new MessageChannel();++    port1.postMessage({ key });+    assert.strictEqual(keyToString(key), repr);++    port2.once('message', common.mustCall(({ key }) => {+      assert.strictEqual(keyToString(key), repr);+    }));+  }++  {+    // Test 3: Clone a dummy object to a message port in another context.+    const { port1, port2 } = new MessageChannel();+    const context = createContext();+    const port2Moved = moveMessagePortToContext(port2, context);+    assert(!(port2Moved instanceof Object));++    port2Moved.onmessage = common.mustCall(({ data: { key } }) => {+      assert.strictEqual(keyToString(key), repr);

I can't quite figure out where to throw. Throwing in Deserialize compiles, but then how would the user catch it? It doesn't seem to cause an error event. Throwing in CloneForMessaging seems like the better choice to me, but that seems to be even more difficult (since it only happens in SerializerDelegate::Finish without access to the environment/context etc.). Do you have another hint for me? :)

tniessen

comment created time in a month

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

+'use strict';+const common = require('../common');+if (!common.hasCrypto)+  common.skip('missing crypto');++const assert = require('assert');+const { createSecretKey, generateKeyPairSync } = require('crypto');+const { createContext } = require('vm');+const { MessageChannel, moveMessagePortToContext } = require('worker_threads');++const secretKey = createSecretKey(Buffer.alloc(32));+const { publicKey, privateKey } = generateKeyPairSync('rsa', {+  modulusLength: 1024+});++function keyToString(key) {+  if (key.type === 'secret') {+    return key.export().toString('hex');+  } else {+    return key.export({ type: 'pkcs1', format: 'pem' });+  }+}++// Get immutable representations of all keys.+const keys = [secretKey, publicKey, privateKey]+             .map((key) => [key, keyToString(key)]);++for (const [key, repr] of keys) {+  {+    const { port1, port2 } = new MessageChannel();++    port1.postMessage({ key });+    assert.strictEqual(keyToString(key), repr);++    port2.once('message', common.mustCall(({ key }) => {+      assert.strictEqual(keyToString(key), repr);+    }));+  }++  {+    // Test 3: Clone a dummy object to a message port in another context.+    const { port1, port2 } = new MessageChannel();+    const context = createContext();+    const port2Moved = moveMessagePortToContext(port2, context);+    assert(!(port2Moved instanceof Object));++    port2Moved.onmessage = common.mustCall(({ data: { key } }) => {+      assert.strictEqual(keyToString(key), repr);

Can you give me a hint how to store the constructors as templates? I didn't think it was possible with classes defined in JavaScript :)

tniessen

comment created time in a month

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

 class KeyObject : public BaseObject {   v8::MaybeLocal<v8::Value> ExportPrivateKey(       const PrivateKeyEncodingConfig& config) const; -  KeyObject(Environment* env, v8::Local<v8::Object> wrap, KeyType key_type);+  KeyObjectHandle(Environment* env,+                  v8::Local<v8::Object> wrap);   private:-  const KeyType key_type_;-  std::unique_ptr<char, std::function<void(char*)>> symmetric_key_;-  unsigned int symmetric_key_len_;-  ManagedEVPPKey asymmetric_key_;+  std::shared_ptr<KeyObjectData> data_;+};++class NativeKeyObject : public BaseObject {+ public:+  static void New(const v8::FunctionCallbackInfo<v8::Value>& args);++  SET_NO_MEMORY_INFO()+  SET_MEMORY_INFO_NAME(NativeKeyObject)+  SET_SELF_SIZE(NativeKeyObject)++  class KeyObjectTransferData : public worker::TransferData {+   public:+    explicit KeyObjectTransferData(const std::shared_ptr<KeyObjectData>& data)+        : data_(data) {}++    BaseObject* Deserialize(+        Environment* env,+        v8::Local<v8::Context> context,+        std::unique_ptr<worker::TransferData> self) override;++    SET_MEMORY_INFO_NAME(KeyObjectTransferData)+    SET_SELF_SIZE(KeyObjectTransferData)+    SET_NO_MEMORY_INFO()++   private:+    std::shared_ptr<KeyObjectData> data_;+  };++  BaseObject::TransferMode GetTransferMode() const override;+  std::unique_ptr<worker::TransferData> CloneForMessaging() const override;++ private:+  NativeKeyObject(Environment* env,+                  v8::Local<v8::Object> wrap,+                  const std::shared_ptr<KeyObjectData>& handle_data)+    : BaseObject(env, wrap),+      handle_data_(handle_data) {}++  std::shared_ptr<KeyObjectData> handle_data_; };

Done, thank you!

tniessen

comment created time in a month

push eventtniessen/node

cjihrig

commit sha cbf2fa63d7ffb6f7e129086c2d85b306ef247186

tools: update ESLint to 7.0.0 Update ESLint to 7.0.0 PR-URL: https://github.com/nodejs/node/pull/33316 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Zeyu Yang <himself65@outlook.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>

view details

Robert Nagy

commit sha 8a6fab02adab2de05f6e864847f96b0924be0840

http: emit 'error' on aborted server request Server requests aka. IncomingMessage emits 'aborted' instead of 'error' which causes confusion when the object is used as a regular stream, i.e. if functions working on streams are passed a server request object they might not work properly unless they take this into account. Refs: https://github.com/nodejs/web-server-frameworks/issues/41 PR-URL: https://github.com/nodejs/node/pull/33172 Fixes: https://github.com/nodejs/node/issues/28172 Refs: https://github.com/nodejs/node/pull/28677 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Robert Nagy

commit sha b04e88439acca6915ffae4c6b9515ff896ad2cec

http: don't destroy completed request Calling destroy() on a completed ClientRequest, i.e. once 'close' will be emitted should be a noop. Also before emitting 'close' destroyed === true. Fixes: https://github.com/nodejs/node/issues/32851 PR-URL: https://github.com/nodejs/node/pull/33120 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>

view details

Rich Trott

commit sha 5ded044deaad44ea4b87b321e02190cdb12fe33a

test: fix test-net-throttle Repeat writes until data is queued in memory, rather than assuming that it will happen by a certain point. Fixes: https://github.com/nodejs/node/issues/33135 PR-URL: https://github.com/nodejs/node/pull/33329 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>

view details

Daniel Bevenius

commit sha 86f8f47cc346c3aa386919b239bd10f58bcfb351

src: fix typo in comment in async_wrap.cc PR-URL: https://github.com/nodejs/node/pull/33350 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Daniel Bevenius

commit sha 12b3e0c1acb937d919fe03f27499a9775ef05bbf

doc: fix typo in n-api.md This commit fixes what I think is a typo, even though the section in question does talk about a environment (env). PR-URL: https://github.com/nodejs/node/pull/33319 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>

view details

Daniel Bevenius

commit sha 8c5d58b5a765981a5309bf4218ed16b7332a5c45

src: use MaybeLocal.ToLocal instead of IsEmpty This commit suggest using MaybeLocal.ToLocal and passing in the Local<Function> fn. The motivation for doing this is that the following MaybeLocal.ToLocalChecked call can then be avoided. PR-URL: https://github.com/nodejs/node/pull/33312 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Michaël Zasso

commit sha cfec30fef3866bc7dfccc6488d8dbd3d9d87772f

deps: update to ICU 67.1 Refs: https://github.com/unicode-org/icu/releases/tag/release-67-1 PR-URL: https://github.com/nodejs/node/pull/33324 Reviewed-By: Ujjwal Sharma <ryzokuken@disroot.org> Reviewed-By: Steven R Loomis <srloomis@us.ibm.com>

view details

rickyes

commit sha aee36a04475a20c13663d1037aa6f175ff368bc7

src: delete unused variables to resolve compile time print warning PR-URL: https://github.com/nodejs/node/pull/33358 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: David Carlier <devnexen@gmail.com>

view details

Michaël Zasso

commit sha 1d6adf7432defeb39b751a19c68335e8afb0d8ee

deps: update V8 to 8.3.110.9 PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Michaël Zasso

commit sha 37abad4340d4602ced23125b5a409a2aa4a7f57d

build: reset embedder string to "-node.0" PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Michaël Zasso

commit sha 308900faef8b2e5edab5f9737495d2d1b3b54ffe

src: update NODE_MODULE_VERSION to 84 Major V8 updates are usually API/ABI incompatible with previous versions. This commit adapts NODE_MODULE_VERSION for V8 8.3. Refs: https://github.com/nodejs/CTC/blob/master/meetings/2016-09-28.md PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Michaël Zasso

commit sha db0ed118d8f39e93063425076dd7d95351d799eb

tools: update V8 gypfiles for V8 8.3 PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

cjihrig

commit sha a48928836a930ecdc894e9c684a675bde1508109

deps: update V8 dtrace & postmortem metadata PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Refael Ackermann

commit sha c3866a1b3e9de7b19753d822b313509f43266c42

deps: V8: un-cherry-pick bd019bd Original commit message: [testrunner] delete ancient junit compatible format support Testrunner has ancient support for JUnit compatible XML output. This CL removes this old feature. R=mstarzinger@chromium.org,jgruber@chromium.org,jkummerow@chromium.org CC=​machenbach@chromium.org Bug: v8:8728 Change-Id: I7e1beb011dbaec3aa1a27398a5c52abdd778eaf0 Reviewed-on: https://chromium-review.googlesource.com/c/1430065 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Michael Starzinger <mstarzinger@chromium.org> Commit-Queue: Tamer Tas <tmrts@chromium.org> Cr-Commit-Position: refs/heads/master@{#59045} Refs: https://github.com/v8/v8/commit/bd019bdb725cebaa34327634d73936cd7003d17c PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Ujjwal Sharma

commit sha 6b5ea2efa23d5e6206ea8db2bba54995c20c6597

deps: patch V8 to run on older XCode versions Patch V8 (compiler/js-heap-broker.cc) to remove the use of an optional property, which is a fairly new C++ feature, since that requires a newer XCode version than the minimum requirement in BUILDING.md and thus breaks CI. PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Refael Ackermann

commit sha 55f7ae6386eafa10012e1a7ccf3149becb3b5288

deps: V8: patch register-arm64.h Fixes a compilation issue on some platforms PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Refael Ackermann

commit sha 9dfaf49b84ff13f83dbe9755ac2eb934719792df

deps: V8: forward declaration of `Rtl*FunctionTable` This should be semver-patch since actual invocation is version conditional. PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Joao Reis

commit sha 32be677f49b6415ce08842fe78288637f300041d

deps: make v8.h compatible with VS2015 There is a bug in the most recent version of VS2015 that affects v8.h and therefore prevents compilation of addons. Refs: https://stackoverflow.com/q/38378693 PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Michaël Zasso

commit sha e9a6ba0a4c144585f58a78e36692a4f6d0fb82ea

deps: V8: silence irrelevant warnings PR-URL: https://github.com/nodejs/node/pull/32831 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

push time in a month

startedharelba/q

started time in a month

startedsimple-statistics/simple-statistics

started time in 2 months

issue commentnodejs/node

Installation on Windows 10 Pro results in "Access denied" for "node" and "npm".

I can't reproduce this, after having installed virtually all recent Node.js releases on Windows 10 Pro machines.

SomervilleTom

comment created time in 2 months

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

 for (const m of [[kKeyEncodingPKCS1, 'pkcs1'], [kKeyEncodingPKCS8, 'pkcs8'],                  [kKeyEncodingSPKI, 'spki'], [kKeyEncodingSEC1, 'sec1']])   encodingNames[m[0]] = m[1]; -class KeyObject {-  constructor(type, handle) {-    if (type !== 'secret' && type !== 'public' && type !== 'private')-      throw new ERR_INVALID_ARG_VALUE('type', type);-    if (typeof handle !== 'object')-      throw new ERR_INVALID_ARG_TYPE('handle', 'object', handle);--    this[kKeyType] = type;--    ObjectDefineProperty(this, kHandle, {-      value: handle,-      enumerable: false,-      configurable: false,-      writable: false-    });-  }--  get type() {-    return this[kKeyType];-  }+function checkKeyTypeAndHandle(type, handle) {+  if (type !== 'secret' && type !== 'public' && type !== 'private')+    throw new ERR_INVALID_ARG_VALUE('type', type);+  if (typeof handle !== 'object' || !(handle instanceof KeyObjectHandle))+    throw new ERR_INVALID_ARG_TYPE('handle', 'object', handle); } -class SecretKeyObject extends KeyObject {-  constructor(handle) {-    super('secret', handle);-  }+// Creating the KeyObject class is a little complicated due to inheritance+// and that fact that KeyObjects should be transferrable between threads,+// which requires the KeyObject base class to be implemented in C++.+// The creation requires a callback to make sure that the NativeKeyObject+// base class cannot exist without the other KeyObject implementations.+const [+  KeyObject,+  SecretKeyObject,+  PublicKeyObject,+  PrivateKeyObject+] = createNativeKeyObject((NativeKeyObject) => {+  // Publicly visible KeyObject class.+  class KeyObject extends NativeKeyObject {+    constructor(type, handle) {+      super(checkKeyTypeAndHandle(type, handle) || handle);++      this[kKeyType] = type;++      ObjectDefineProperty(this, kHandle, {+        value: handle,+        enumerable: false,+        configurable: false,+        writable: false+      });+    } -  get symmetricKeySize() {-    return this[kHandle].getSymmetricKeySize();+    get type() {+      return this[kKeyType];

That's pre-existing code, but I'll consider it. I guess the same is true for a lot of existing class fields in core.

tniessen

comment created time in 2 months

Pull request review commentnodejs/node

Allow passing KeyObjects via postMessage

 MaybeLocal<Value> Message::Deserialize(Environment* env,   EscapableHandleScope handle_scope(env->isolate());   Context::Scope context_scope(context); -  // Create all necessary MessagePort handles.-  std::vector<MessagePort*> ports(message_ports_.size());-  for (uint32_t i = 0; i < message_ports_.size(); ++i) {-    ports[i] = MessagePort::New(env,-                                context,-                                std::move(message_ports_[i]));-    if (ports[i] == nullptr) {-      for (MessagePort* port : ports) {-        // This will eventually release the MessagePort object itself.-        if (port != nullptr)-          port->Close();+  // Create all necessary objects for transferables, e.g. MessagePort handles.+  std::vector<BaseObject*> host_objects(transferables_.size());+  for (uint32_t i = 0; i < transferables_.size(); ++i) {

I don't think foreach makes things simpler: i is required as the index for transferables_ and host_objects.

tniessen

comment created time in 2 months

PR opened nodejs/node

Allow passing KeyObjects via postMessage C++ crypto worker

This patch allows to pass KeyObject instances between threads/contexts, and is based on some great work by @addaleax.

While the public API has not changed, the internal structure has become a little complicated. In order to be cloneable, the KeyObject class must be implemented in C++. However, KeyObject relies on its JavaScript class hierarchy. To get around this problem, a new base class NativeKeyObject is added, from which all KeyObject classes inherit:

             +---------------------+
             |     BaseObject      |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |   NativeKeyObject   |
             +---------------------+
                        |
                        |
                        |
             +---------------------+
             |      KeyObject      |
             +---------------------+
               /                 \
              /                   \
             /                     \
            /                       \
+---------------------+    +---------------------+
|   SecretKeyObject   |    | AsymmetricKeyObject |
+---------------------+    +---------------------+
                             /                 \
                            /                   \
                           /                     \
                          /                       \
              +---------------------+   +---------------------+
              |   PublicKeyObject   |   |   PrivateKeyObject  |
              +---------------------+   +---------------------+

NativeKeyObject has no properties and doesn't change the behavior of KeyObject. It only exists to be cloneable.

Each KeyObject k has an associated KeyObjectHandle, which is stored in k[kHandle]. The public KeyObject API uses the internal KeyObjectHandle API to perform most operations, however, a KeyObjectHandle is a BaseObject and cannot be shared between threads directly. Instead, each KeyObjectHandle references a KeyObjectData object, which contains the actual key. This object can be shared between threads:

+-----------------+
| NativeKeyObject |
+-----------------+
        ^
     extends
        |
+-----------------+    +-----------------+    +---------------+
| KeyObject  (JS) | -> | KeyObjectHandle | -> | KeyObjectData |
+-----------------+    +-----------------+    +---------------+

When a key is passed via a MessagePort, the receiver creates a new KeyObjectHandle and the correct KeyObject (one of SecretKeyObject, PublicKeyObject, PrivateKeyObject). However, it does not create a new KeyObjectData object: All threads always refer to the same KeyObjectData for the same key:

+-------------------+
| NativeKeyObject 1 | ------------------------------------------+
+-------------------+                                           |
        ^                                                       |
     extends                                                    |
        |                                                       |
+-------------------+    +-------------------+                  |
| KeyObject 1  (JS) | -> | KeyObjectHandle 1 | --------------+  |
+-------------------+    +-------------------+               |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
                                                             |  |
+-------------------+                                        |  |
| NativeKeyObject 2 | ------------------------------------+  |  |
+-------------------+                                     |  |  |
        ^                                                 |  |  |
     extends                                              |  |  |
        |                                                 |  |  |
+-------------------+    +-------------------+            |  |  |
| KeyObject 2  (JS) | -> | KeyObjectHandle 2 | --------+  |  |  |
+-------------------+    +-------------------+         |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
                                                       |  |  |  |
+-------------------+                                  |  |  |  |
| NativeKeyObject 3 | ------------------------------+  |  |  |  |
+-------------------+                               |  |  |  |  |
        ^                                           |  |  |  |  |
     extends                                        |  |  |  |  |
        |                                           v  v  v  v  v
+-------------------+    +-------------------+    +---------------+
| KeyObject 3  (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData |
+-------------------+    +-------------------+    +---------------+

Since almost all operations go through the KeyObjectHandle, it makes sense for the KeyObjectHandle to contain a pointer to the KeyObjectData. However, the NativeKeyObject class implements CloneForMessaging and therefore also needs access to the same KeyObjectData. In theory, we could go through this[kHandle]->Data(), but it is easier to also maintain a pointer from the NativeKeyObject to the same KeyObjectData.

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

cc @addaleax @panva @nodejs/crypto @nodejs/security-wg

+650 -263

0 comment

21 changed files

pr created time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha 6444d7b78fb6f6ceb336c4c50d72f358eb7361fd

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net>>

view details

push time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha 0bd789a980ad38dffaf35e029a13d08d7e28c15b

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+ Co-authored-by: Anna Henningsen <anna@addaleax.net>

view details

push time in 2 months

push eventtniessen/node

Rich Trott

commit sha 83ebd7731852369fa08fb5885c7fcf7b671bce91

test: replace console.error() with debuglog calls Somehow thought I did this in 8905be2ceea9abead85a5018c09645a3650d7495 but clearly did not. PR-URL: https://github.com/nodejs/node/pull/32588 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>

view details

Richard Lau

commit sha d4fd03e67371ef8db8c47d2981bbee9601700034

doc: fix return type of `crypto.getFips()` `crypto.getFips()` returns a number, not a boolean. PR-URL: https://github.com/nodejs/node/pull/32580 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Signed-off-by: Richard Lau <riclau@uk.ibm.com>

view details

Richard Lau

commit sha b9da063ae9034b3fd8207791ef78a5e769a5eb0d

doc: return type of `crypto.getFips()` may change Document that the return type of `crypto.getFips()` may change in a future semver-major release from a `number` to a `boolean`. PR-URL: https://github.com/nodejs/node/pull/32580 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Tobias Nießen <tniessen@tnie.de> Signed-off-by: Richard Lau <riclau@uk.ibm.com>

view details

Robert Nagy

commit sha 8f86986985b161b7fb5aa41283d792417329bc2c

stream: use callback to properly propagate error The stream will be destroyed upstream through the proper error flow. PR-URL: https://github.com/nodejs/node/pull/29179 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Matheus Marchini

commit sha 05841335c5d209efe6e249a57f3798d5c1154a8f

Revert "deps: V8: cherry-pick f9257802c1c0" This reverts commit 75da64c0587f2925319cd9c1717a19b647b93511. PR-URL: https://github.com/nodejs/node/pull/32521 Refs: https://github.com/v8/v8/compare/8.1.307.20...8.1.307.26 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Matheus Marchini

commit sha 3052769bbc222fb5972cd90ca81b5102fb676360

deps: patch V8 to 8.1.307.26 Refs: https://github.com/v8/v8/compare/8.1.307.20...8.1.307.26 PR-URL: https://github.com/nodejs/node/pull/32521 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Matheus Marchini

commit sha 17f323ebfaf4b6f15e994412113d1e856a2e0ffc

deps: remove duplicated postmortem metadata entry Signed-off-by: Matheus Marchini <mmarchini@netflix.com> PR-URL: https://github.com/nodejs/node/pull/32521 Refs: https://github.com/v8/v8/compare/8.1.307.20...8.1.307.26 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Ben Noordhuis

commit sha 251b08d4e85fce0a9cda6536a112b6153bd56a5a

test: skip crypto test on arm buildbots The Raspberry Pis are too slow to run this computationally expensive test in a timely manner, it times out after 240 seconds. PR-URL: https://github.com/nodejs/node/pull/32636 Reviewed-By: Tobias Nießen <tniessen@tnie.de> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Thomas Watson

commit sha 04b71848af97ff3ea917eb281768a5b14823ee2c

doc: document that server.address() can return null PR-URL: https://github.com/nodejs/node/pull/32519 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Rich Trott <rtrott@gmail.com>

view details

Rich Trott

commit sha c452632d3421d6baf26a61e14c21c922bd18175e

test: refactor test-http2-buffersize Remove seemlingly misplaced and/or extraneous comment. Replace countdown with Promise.all. PR-URL: https://github.com/nodejs/node/pull/32540 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Harshitha KP

commit sha d03d9a05f0318604d2aa71a1c3dbd6cbca8894e4

doc: clarify `length` param in `buffer.write` `buffer.write` documentation has an incaccuracy w.r.t the `length` parameter: It says default number of bytes written is `buf.length - offset`. Change it to: If the buffer has sufficient space from the offset, the string is written upto `length`. If the buffer is short in space, only `buf.length - offset` bytes are written. Refs: https://github.com/nodejs/node/pull/32104#discussion_r388524733 PR-URL: https://github.com/nodejs/node/pull/32119 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

himself65

commit sha 4d59253bc3f56bead123d20b1a8aad3cf80e1ff6

tools: update Boxstarter script and document PR-URL: https://github.com/nodejs/node/pull/32299 Reviewed-By: David Carlier <devnexen@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

himself65

commit sha cee396ea586c02fd22c438f65d5f0e0ab7f12d67

doc: add unreachable code on events example PR-URL: https://github.com/nodejs/node/pull/32364 Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

Juan José Arboleda

commit sha 34a4ab72787fd20e67ae85d65428e9a0b8b7e431

doc: clarify docs fs.watch exception may be emitted Fixes: https://github.com/nodejs/node/issues/29894 PR-URL: https://github.com/nodejs/node/pull/32513 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

Hassaan Pasha

commit sha a1b6ae6ca69a4f43405dbd3de140e54077055b95

doc: adjust paths in openssl maintenance guide The path for the crypto files in the `deps/openssl/openssl/` after running `cd deps/openssl/config && make` has been changed. The original path `deps/openssl/openssl/crypto/includes/internal/` now maps to `deps/openssl/openssl/includes/crypto`for the files that need to be added for the commit. PR-URL: https://github.com/nodejs/node/pull/32593 Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>

view details

himself65

commit sha 0e0e338347b2434518aa76b13671204e33e48c4d

build: remove make lint on lint-py PR-URL: https://github.com/nodejs/node/pull/32599 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Matheus Marchini <mat@mmarchini.me> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Sam Roberts

commit sha 2fc038a4476b18ff2eb47748a556706c6cad068b

doc: make openssl commit messages be valid The current commit message is wrapped at 80 columns, but commit message descriptions should wrap at 72, so the maintainer has to fix the message up instead of just copying it in. They might not notice that requirement, in which case it has to be fixed during landing because `git node land` notices. To prevent that, make the message template wrap before 72 to keep the landing process as simple as possible. PR-URL: https://github.com/nodejs/node/pull/32602 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>

view details

Anna Henningsen

commit sha cf659c8690ec184490f87d657a900fb4cbd4a8bc

test: copy addons .gitignore to test/abort/ `cp test/addons/.gitignore test/abort/.gitignore`, because the new addon test in there leaves a build/ folder lying around and somebody is bound to use `git add .` earlier or later. Refs: https://github.com/nodejs/node/pull/31740 PR-URL: https://github.com/nodejs/node/pull/32624 Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>

view details

Dave Vandyke

commit sha 8c0a17ae2847b007c2563f9fd38c601c12402e59

doc: correct version metadata for Readable.from PR-URL: https://github.com/nodejs/node/pull/32639 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>

view details

Richard Lau

commit sha 0ddfd0fc129b0122437055e0aa87bdfa81744e80

test: fix tool path in test-doctool-versions.js Path to the versions tool tested by test-doctool-versions.js would be incorrect if the test temporary directory was redirected (e.g. via NODE_TEST_DIR) outside of `test/`. Signed-off-by: Richard Lau <riclau@uk.ibm.com> PR-URL: https://github.com/nodejs/node/pull/32645 Refs: https://github.com/nodejs/node/pull/32518 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Shelley Vohr <codebytere@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>

view details

push time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha feea78252b0df21d9be9b3831cf872ae7b9067dd

src: rename internal key handles to KeyObjectHandle

view details

Tobias Nießen

commit sha e331b51ac7b841b4de00280858b251c1ae78cf47

src: add NativeKeyObject base class +---------------------+ | BaseObject | +---------------------+ | | | +---------------------+ | NativeKeyObject | +---------------------+ | | | +---------------------+ | KeyObject | +---------------------+ / \ / \ / \ / \ +---------------------+ +---------------------+ | SecretKeyObject | | AsymmetricKeyObject | +---------------------+ +---------------------+ / \ / \ / \ / \ +---------------------+ +---------------------+ | PublicKeyObject | | PrivateKeyObject | +---------------------+ +---------------------+

view details

Anna Henningsen

commit sha 24222c2e33365a254dcdf10b888d16785345b321

src: introduce BaseObject base FunctionTemplate

view details

Anna Henningsen

commit sha 6dcf9244be2295982a6877e3b62e37cd97f488b0

worker: allow transferring/cloning generic BaseObjects Extend support for transferring objects à la `MessagePort` to other types of `BaseObject` subclasses, as well as implement cloning support for cases in which destructive transferring is not needed or optional.

view details

Tobias Nießen

commit sha 6d9de0215cd0252403b86bf792ca28f5ce2e60a6

src: store key data in separate class This separates key handles from the actual key data: +-----------------+ | NativeKeyObject | +-----------------+ ^ extends | +-----------------+ +-----------------+ +---------------+ | KeyObject (JS) | -> | KeyObjectHandle | -> | KeyObjectData | +-----------------+ +-----------------+ +---------------+

view details

Tobias Nießen

commit sha 1a1bb7f68340a55928e32b31994cc9fdd989a020

crypto: allow KeyObjects in postMessage This change allows sharing KeyObjects between threads via postMessage. The receiver acquires a new KeyObject and a new KeyObjectHandle, but refers to the same KeyObjectData: +-------------------+ | NativeKeyObject 1 | ------------------------------------------+ +-------------------+ | ^ | extends | | | +-------------------+ +-------------------+ | | KeyObject 1 (JS) | -> | KeyObjectHandle 1 | --------------+ | +-------------------+ +-------------------+ | | | | | | | | | | | | +-------------------+ | | | NativeKeyObject 2 | ------------------------------------+ | | +-------------------+ | | | ^ | | | extends | | | | | | | +-------------------+ +-------------------+ | | | | KeyObject 2 (JS) | -> | KeyObjectHandle 2 | --------+ | | | +-------------------+ +-------------------+ | | | | | | | | | | | | | | | | | | | | | | | | +-------------------+ | | | | | NativeKeyObject 3 | ------------------------------+ | | | | +-------------------+ | | | | | ^ | | | | | extends | | | | | | v v v v v +-------------------+ +-------------------+ +---------------+ | KeyObject 3 (JS) | -> | KeyObjectHandle 3 | -> | KeyObjectData | +-------------------+ +-------------------+ +---------------+

view details

push time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha cfc9ddc7a7520285605ce48aef48641d23e19aa3

crypto: allow KeyObjects in postMessage

view details

push time in 2 months

create barnchtniessen/node

branch : allow-keyobjects-in-postmessage

created branch time in 2 months

startedjasnell/notare

started time in 2 months

pull request commentnodejs/node

modules: deprecate module.parent

@DerekNonGeneric I believe suitable alternatives exist. Is there something module.parent can do that other features cannot achieve in a similar/better way?

aduh95

comment created time in 2 months

issue commentnodejs/node

Allow multiple installs of Node on Windows with msi

we don't yet have a plan; i just met with the build WG recently and confirmed the direction for a first step. I"m hoping to have time to write something up soon.

@ljharb I believe this was two years ago, any updates? This issue has been open for four years, and the situation doesn't seem to have changed at all.

felixfbecker

comment created time in 2 months

issue commentWebAssembly/WASI-crypto

Resumable host calls

This is a fundamental problem with WebAssembly. Most JavaScript applications only use WebAssembly in a background thread for this very reason. For standalone WebAssembly applications, threading will eventually be necessary to be able to compete with the performance of native applications.

jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.++- <a href="#crypto_errno.not_implemented" name="crypto_errno.not_implemented"></a> `not_implemented`+The requested operation is valid, but not implemented by the host.++- <a href="#crypto_errno.unsupported_feature" name="crypto_errno.unsupported_feature"></a> `unsupported_feature`+The requested feature is not supported by the chosen algorithm.++- <a href="#crypto_errno.prohibited_operation" name="crypto_errno.prohibited_operation"></a> `prohibited_operation`+The requested operation is valid, but was administratively prohibited.++- <a href="#crypto_errno.unsupported_encoding" name="crypto_errno.unsupported_encoding"></a> `unsupported_encoding`+Unsupported encoding for an import or export operation.++- <a href="#crypto_errno.unsupported_algorithm" name="crypto_errno.unsupported_algorithm"></a> `unsupported_algorithm`+The requested algorithm is not supported by the host.++- <a href="#crypto_errno.unsupported_option" name="crypto_errno.unsupported_option"></a> `unsupported_option`+The requested option is not supported by the currently selected algorithm.++- <a href="#crypto_errno.invalid_key" name="crypto_errno.invalid_key"></a> `invalid_key`+An invalid or incompatible key was supplied.++The key may not be valid, or was generated for a different algorithm or parameters set.++- <a href="#crypto_errno.invalid_length" name="crypto_errno.invalid_length"></a> `invalid_length`+The currently selected algorithm doesn't support the requested output length.++This error is thrown by non-extensible hash functions, when requesting an output size larger than they produce out of a single block.++- <a href="#crypto_errno.verification_failed" name="crypto_errno.verification_failed"></a> `verification_failed`+A signature or authentication tag verification failed.++- <a href="#crypto_errno.rng_error" name="crypto_errno.rng_error"></a> `rng_error`+A secure random numbers generator is not available.++The requested operation requires random numbers, but the host cannot securely generate them at the moment.++- <a href="#crypto_errno.algorithm_failure" name="crypto_errno.algorithm_failure"></a> `algorithm_failure`+An error was returned by the underlying cryptography library.++The host may be running out of memory, parameters may be incompatible with the chosen implementation of an algorithm or another unexpected error may have happened.++Ideally, the specification should provide enough details and guidance to make this error impossible to ever be thrown.++Realistically, the WASI crypto module cannot possibly cover all possible error types implementations can return, especially since some of these may be language-specific.+This error can thus be thrown when other error types are not suitable, and when the original error comes from the cryptographic primitives themselves and not from the WASI module.++- <a href="#crypto_errno.invalid_signature" name="crypto_errno.invalid_signature"></a> `invalid_signature`+The supplied signature is invalid, or incompatible with the chosen algorithm.++- <a href="#crypto_errno.closed" name="crypto_errno.closed"></a> `closed`+An attempt was made to close a handle that was already closed.++- <a href="#crypto_errno.invalid_handle" name="crypto_errno.invalid_handle"></a> `invalid_handle`+A function was called with an unassigned handle, a closed handle, or handle of an unexpected type.++- <a href="#crypto_errno.overflow" name="crypto_errno.overflow"></a> `overflow`+The host needs to copy data to a guest-allocated buffer, but that buffer is too small.++- <a href="#crypto_errno.internal_error" name="crypto_errno.internal_error"></a> `internal_error`+An internal error occurred.++This error is reserved to internal consistency checks, and must only be sent if the internal state of the host remains safe after an inconsistency was detected.

This would indicate a bug, right? And should probably be unreachable?

jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.++- <a href="#crypto_errno.not_implemented" name="crypto_errno.not_implemented"></a> `not_implemented`+The requested operation is valid, but not implemented by the host.++- <a href="#crypto_errno.unsupported_feature" name="crypto_errno.unsupported_feature"></a> `unsupported_feature`+The requested feature is not supported by the chosen algorithm.++- <a href="#crypto_errno.prohibited_operation" name="crypto_errno.prohibited_operation"></a> `prohibited_operation`+The requested operation is valid, but was administratively prohibited.++- <a href="#crypto_errno.unsupported_encoding" name="crypto_errno.unsupported_encoding"></a> `unsupported_encoding`+Unsupported encoding for an import or export operation.++- <a href="#crypto_errno.unsupported_algorithm" name="crypto_errno.unsupported_algorithm"></a> `unsupported_algorithm`+The requested algorithm is not supported by the host.++- <a href="#crypto_errno.unsupported_option" name="crypto_errno.unsupported_option"></a> `unsupported_option`+The requested option is not supported by the currently selected algorithm.++- <a href="#crypto_errno.invalid_key" name="crypto_errno.invalid_key"></a> `invalid_key`+An invalid or incompatible key was supplied.++The key may not be valid, or was generated for a different algorithm or parameters set.++- <a href="#crypto_errno.invalid_length" name="crypto_errno.invalid_length"></a> `invalid_length`+The currently selected algorithm doesn't support the requested output length.++This error is thrown by non-extensible hash functions, when requesting an output size larger than they produce out of a single block.++- <a href="#crypto_errno.verification_failed" name="crypto_errno.verification_failed"></a> `verification_failed`+A signature or authentication tag verification failed.++- <a href="#crypto_errno.rng_error" name="crypto_errno.rng_error"></a> `rng_error`+A secure random numbers generator is not available.++The requested operation requires random numbers, but the host cannot securely generate them at the moment.++- <a href="#crypto_errno.algorithm_failure" name="crypto_errno.algorithm_failure"></a> `algorithm_failure`+An error was returned by the underlying cryptography library.++The host may be running out of memory, parameters may be incompatible with the chosen implementation of an algorithm or another unexpected error may have happened.++Ideally, the specification should provide enough details and guidance to make this error impossible to ever be thrown.++Realistically, the WASI crypto module cannot possibly cover all possible error types implementations can return, especially since some of these may be language-specific.+This error can thus be thrown when other error types are not suitable, and when the original error comes from the cryptographic primitives themselves and not from the WASI module.++- <a href="#crypto_errno.invalid_signature" name="crypto_errno.invalid_signature"></a> `invalid_signature`+The supplied signature is invalid, or incompatible with the chosen algorithm.++- <a href="#crypto_errno.closed" name="crypto_errno.closed"></a> `closed`+An attempt was made to close a handle that was already closed.

This seems like a slippery slope, because -- I assume -- handle values might also be reused.

jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.++- <a href="#crypto_errno.not_implemented" name="crypto_errno.not_implemented"></a> `not_implemented`+The requested operation is valid, but not implemented by the host.++- <a href="#crypto_errno.unsupported_feature" name="crypto_errno.unsupported_feature"></a> `unsupported_feature`+The requested feature is not supported by the chosen algorithm.++- <a href="#crypto_errno.prohibited_operation" name="crypto_errno.prohibited_operation"></a> `prohibited_operation`+The requested operation is valid, but was administratively prohibited.++- <a href="#crypto_errno.unsupported_encoding" name="crypto_errno.unsupported_encoding"></a> `unsupported_encoding`+Unsupported encoding for an import or export operation.++- <a href="#crypto_errno.unsupported_algorithm" name="crypto_errno.unsupported_algorithm"></a> `unsupported_algorithm`+The requested algorithm is not supported by the host.++- <a href="#crypto_errno.unsupported_option" name="crypto_errno.unsupported_option"></a> `unsupported_option`+The requested option is not supported by the currently selected algorithm.++- <a href="#crypto_errno.invalid_key" name="crypto_errno.invalid_key"></a> `invalid_key`+An invalid or incompatible key was supplied.++The key may not be valid, or was generated for a different algorithm or parameters set.++- <a href="#crypto_errno.invalid_length" name="crypto_errno.invalid_length"></a> `invalid_length`+The currently selected algorithm doesn't support the requested output length.++This error is thrown by non-extensible hash functions, when requesting an output size larger than they produce out of a single block.++- <a href="#crypto_errno.verification_failed" name="crypto_errno.verification_failed"></a> `verification_failed`+A signature or authentication tag verification failed.++- <a href="#crypto_errno.rng_error" name="crypto_errno.rng_error"></a> `rng_error`+A secure random numbers generator is not available.++The requested operation requires random numbers, but the host cannot securely generate them at the moment.++- <a href="#crypto_errno.algorithm_failure" name="crypto_errno.algorithm_failure"></a> `algorithm_failure`+An error was returned by the underlying cryptography library.++The host may be running out of memory, parameters may be incompatible with the chosen implementation of an algorithm or another unexpected error may have happened.++Ideally, the specification should provide enough details and guidance to make this error impossible to ever be thrown.++Realistically, the WASI crypto module cannot possibly cover all possible error types implementations can return, especially since some of these may be language-specific.+This error can thus be thrown when other error types are not suitable, and when the original error comes from the cryptographic primitives themselves and not from the WASI module.++- <a href="#crypto_errno.invalid_signature" name="crypto_errno.invalid_signature"></a> `invalid_signature`+The supplied signature is invalid, or incompatible with the chosen algorithm.

Maybe we should clarify the difference between "invalid" and "incorrect".

jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.++- <a href="#crypto_errno.not_implemented" name="crypto_errno.not_implemented"></a> `not_implemented`+The requested operation is valid, but not implemented by the host.++- <a href="#crypto_errno.unsupported_feature" name="crypto_errno.unsupported_feature"></a> `unsupported_feature`+The requested feature is not supported by the chosen algorithm.++- <a href="#crypto_errno.prohibited_operation" name="crypto_errno.prohibited_operation"></a> `prohibited_operation`+The requested operation is valid, but was administratively prohibited.++- <a href="#crypto_errno.unsupported_encoding" name="crypto_errno.unsupported_encoding"></a> `unsupported_encoding`+Unsupported encoding for an import or export operation.++- <a href="#crypto_errno.unsupported_algorithm" name="crypto_errno.unsupported_algorithm"></a> `unsupported_algorithm`+The requested algorithm is not supported by the host.++- <a href="#crypto_errno.unsupported_option" name="crypto_errno.unsupported_option"></a> `unsupported_option`+The requested option is not supported by the currently selected algorithm.++- <a href="#crypto_errno.invalid_key" name="crypto_errno.invalid_key"></a> `invalid_key`+An invalid or incompatible key was supplied.++The key may not be valid, or was generated for a different algorithm or parameters set.++- <a href="#crypto_errno.invalid_length" name="crypto_errno.invalid_length"></a> `invalid_length`+The currently selected algorithm doesn't support the requested output length.++This error is thrown by non-extensible hash functions, when requesting an output size larger than they produce out of a single block.++- <a href="#crypto_errno.verification_failed" name="crypto_errno.verification_failed"></a> `verification_failed`+A signature or authentication tag verification failed.++- <a href="#crypto_errno.rng_error" name="crypto_errno.rng_error"></a> `rng_error`+A secure random numbers generator is not available.
A secure random number generator is not available.
jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.++- <a href="#crypto_errno.not_implemented" name="crypto_errno.not_implemented"></a> `not_implemented`+The requested operation is valid, but not implemented by the host.

If the host does not implement it, can the host be sure that it is valid?

jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.
An error occurred during a conversion from a host type to a guest type.
jedisct1

comment created time in 2 months

Pull request review commentWebAssembly/WASI-crypto

Add symmetric operations to the proposal and implementation

+# Types+## <a href="#crypto_errno" name="crypto_errno"></a> `crypto_errno`: Enum(`u16`)+Error codes.++Size: 2++Alignment: 2++### Variants+- <a href="#crypto_errno.success" name="crypto_errno.success"></a> `success`+Operation succeeded.++- <a href="#crypto_errno.guest_error" name="crypto_errno.guest_error"></a> `guest_error`+An error occurred when trying to during a conversion from a host type to a guest type.++Only an internal bug can throw this error.

"Only an internal bug"? Should this not be unreachable then?

jedisct1

comment created time in 2 months

issue commentnodejs/TSC

TSC Chair Election 2020 - proposed schedule

+1 on not needing to vote

mhdawson

comment created time in 2 months

issue commentnodejs/node-addon-api

WASM_COMPAT ?

@devsnek I would love to sync up, could you send me a DM on Twitter (same handle as on GitHub) or an email (<github handle>@tnie.de)?

mhdawson

comment created time in 2 months

issue closednodejs/node-addon-api

WASM_COMPAT ?

Was talking to @tniessen who was trying to compile a module that used node-addon-api with WASM. One problem is that the use of mutexes is not currently supported in WASM.

Opening issue to discuss if we might add a WASM_COMPAT flag or something like that which would remove the problematic includes related code if it was defined.

closed time in 2 months

mhdawson

issue commentnodejs/node-addon-api

WASM_COMPAT ?

I think this particular issue is not needed then. (It might still make sense to conditionally exclude features that compile but won't work, but we can discuss that separately.)

mhdawson

comment created time in 2 months

issue commentnodejs/node-addon-api

WASM_COMPAT ?

Since a good libc impl like https://github.com/WebAssembly/wasi-libc provides such things, I'm not sure we need to specialize.

Oh, you are right, I forgot I had a compiler option enabled that was incompatible with the mutex search path 🤦

might be fun to sync up.

Sure, just send me a twitter DM or an email! :)

mhdawson

comment created time in 2 months

PR opened nodejs/node

doc: fix typos in handle scope descriptions

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+2 -2

0 comment

1 changed file

pr created time in 2 months

create barnchtniessen/node

branch : doc-typos-handle-scope

created branch time in 2 months

pull request commentnodejs/node

dns: use ternary operator simplify statement

@zhangwinning Thank you for your contribution! I did not mean that this should not be merged. Do you want this to be reopened?

zhangwinning

comment created time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha 6f6128e51a3eee4c1e385ad30c3d7af906b48958

Update test/wasi/test-wasi-not-started.js

view details

push time in 2 months

Pull request review commentnodejs/node

wasi: prevent syscalls before start

+'use strict';+require('../common');++if (process.argv[2] === 'wasi-child') {+  const assert = require('assert');+  const fs = require('fs');+  const path = require('path');++  const { WASI } = require('wasi');+  const wasi = new WASI({+    args: ['foo', '-bar', '--baz=value']+  });+  const importObject = { wasi_snapshot_preview1: wasi.wasiImport };++  const modulePath = path.join(__dirname, 'wasm', 'main_args.wasm');+  const buffer = fs.readFileSync(modulePath);++  assert.rejects(async () => {+    const { instance } = await WebAssembly.instantiate(buffer, importObject);+    instance.exports._start();+  }, {+    name: 'Error',+    code: 'ERR_WASI_NOT_STARTED',+    message: 'wasi.start has not been called'
    message: 'wasi.start() has not been called'
tniessen

comment created time in 2 months

push eventtniessen/node

Tobias Nießen

commit sha 425ee11411ee454cce24f2e74f42a5e82c27db48

Update src/node_errors.h Co-authored-by: Colin Ihrig <cjihrig@gmail.com>

view details

push time in 2 months

pull request commentnodejs/node

wasi: avoid hard crash if start() is never called

I didn't see this PR (or the issue) before opening https://github.com/nodejs/node/pull/33235. Please consider it as an alternative:

  • Personally, I think a non-recoverable error (at least not recoverable from WASM) is more appropriate in case a WASI module was not started properly. With this PR, it is up to the WASM module to handle the error code EINVAL, even though the WASM module likely isn't at fault.
  • This PR doesn't prevent calling syscalls that don't access memory.
cjihrig

comment created time in 2 months

pull request commentnodejs/node

wasi: prevent syscalls before start

I just noticed that https://github.com/nodejs/node/pull/33184 already exists. I guess this is still a valid alternative with a few important differences.

tniessen

comment created time in 2 months

PR opened nodejs/node

Reviewers
wasi: prevent syscalls before start

Calling instance.exports._start() crashes the process with a segmentation fault. This prevents syscalls before start() has been called.

<!-- Thank you for your pull request. Please provide a description above and review the requirements below.

Bug fixes and new features should include tests and possibly benchmarks.

Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md -->

Checklist

<!-- Remove items that do not apply. For completed items, change [ ] to [x]. -->

  • [x] make -j4 test (UNIX), or vcbuild test (Windows) passes
  • [x] tests and/or benchmarks are included
  • [x] documentation is changed or added
  • [x] commit message follows commit guidelines

<!-- Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I have the right to submit it under the open source license indicated in the file; or

(b) The contribution is based upon previous work that, to the best of my knowledge, is covered under an appropriate open source license and I have the right under that license to submit that work with modifications, whether created in whole or in part by me, under the same open source license (unless I am permitted to submit under a different license), as indicated in the file; or

(c) The contribution was provided directly to me by some other person who certified (a), (b) or (c) and I have not modified it.

(d) I understand and agree that this project and the contribution are public and that a record of the contribution (including all personal information I submit with it, including my sign-off) is maintained indefinitely and may be redistributed consistent with this project or the open source license(s) involved. -->

+102 -45

0 comment

4 changed files

pr created time in 2 months

create barnchtniessen/node

branch : wasi-check-started

created branch time in 2 months

startedcjihrig/uvwasi

started time in 2 months

pull request commentnodejs/node

Update crypto.md to correct function description for `decipher.setAAD`

I am not sure if the PR in its current state is an improvement.

when decrypting the plaintextLength parameter actually refers to the ciphertext length, not the plaintext length

The plaintextLength option only applies to CCM ciphers. The ciphertext length produced by CCM ciphers is always equal to the plaintext length. So there is really no difference between "plaintext length" and "ciphertext length" (except for the caveat below).

This parameter probably should have been called inputLength or bufferLength instead of plaintextLength

When I implemented this, I called the option plaintextLength to avoid confusion as to whether it includes the length of the authentication tag. Many crypto libraries include the authentication tag in the ciphertext, which means that they produce ciphertexts of the length plaintextLength + authTagLength. Node.js does not include the authentication tag, so the ciphertext length is always plaintextLength.


I think a better approach would be to explain that the ciphertext length is equal to the plaintext length.

jbuhacoff

comment created time in 2 months

pull request commentnodejs/node

crypto: increase maxmem range from 32 to 53 bits

My original analysis was wrong. A few months ago, I found a mistake (incorrect conversion between bits/bytes) in the RFC and filed errata at the beginning of February (5971, 5972, and 5973). If someone fixes OpenSSL accordingly, Node.js will allow previously invalid inputs.

tniessen

comment created time in 2 months

issue commentgolang/go

x/crypto/scrypt: implementation not compliant with RFC 7914?

My original analysis that @michaelsbradleyjr referred to in https://github.com/golang/go/issues/33703#issuecomment-535033857 was wrong. I actually found the mistake in the RFC and filed errata a few months ago. See 5971, 5972, and 5973.

michaelsbradleyjr

comment created time in 2 months

issue commentethereum/wiki

scrypt example not compliant with RFC 7914

I found the mistake in the RFC and filed errata a few months ago. See 5971, 5972, and 5973.

michaelsbradleyjr

comment created time in 2 months

issue commentethereum/go-ethereum

scrypt usage not compliant with RFC 7914?

They'll probably fix up the spec whenever.

I found the mistake in the RFC and filed errata a few months ago. See 5971, 5972, and 5973.

michaelsbradleyjr

comment created time in 2 months

issue commentnodejs/node

CPU time passes 10x faster than real time on a single core

@bnoordhuis Oh, nice! That explains it :D Any idea when that patch might make it into a Node.js release?

tniessen

comment created time in 2 months

issue openednodejs/node

CPU time passes 10x faster than real time on a single core

<!-- Thank you for reporting an issue.

This issue tracker is for bugs and issues found within Node.js core. If you require more general support please file an issue on our help repo. https://github.com/nodejs/help

Please fill in as much of the template below as you're able.

Version: output of node -v Platform: output of uname -a (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify affected core module name -->

  • Version: v13.11.0
  • Platform: Linux 4.15.0-91-generic #92-Ubuntu SMP x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: os

What steps will reproduce the bug?

Paste this into a REPL:

const { cpus } = require('os');
const measure = () => cpus().map(c => c.times.idle);
const diff = (first, second) => second.map((v, i) => v - first[i]);
setTimeout(((first) => () => console.log(diff(first, measure())))(measure()), 1000);

<!-- Enter details about your bug, preferably a simple code snippet that can be run using node directly without installing third-party dependencies. -->

How often does it reproduce? Is there a required condition?

Always.

What is the expected behavior?

Within 1000ms, each core cannot spend more than (approximately) 1000ms idle.

What do you see instead?

[
  10200, 10200,
  10100, 10200,
  10000, 10000,
   9900, 10000
]

<!-- If possible please provide textual output instead of screenshots. -->

Additional information

I cannot reproduce the problem on Windows, so I assumed it's a problem in libuv, but the code in libuv seems correct to me.

created time in 2 months

pull request commentipfs/ipfs-docs-v2

Improve descriptions of academic papers

Thank you! :)

tniessen

comment created time in 2 months

pull request commentipfs/ipfs-docs-v2

Improve descriptions of academic papers

@johnnymatthews I believe that the errors I corrected were introduced by copying the text. They are not present in the original papers. Please consider reopening this PR.

tniessen

comment created time in 2 months

PR opened ipfs/ipfs-docs-v2

Improve descriptions of academic papers

Just a few minor improvements.

+2 -2

0 comment

1 changed file

pr created time in 3 months

push eventtniessen/ipfs-docs-v2

Tobias Nießen

commit sha 0f918ad810556a234e6a032286eea450eca654b7

Improve descriptions of academic papers

view details

push time in 3 months

fork tniessen/ipfs-docs-v2

📚IPFS documentation platform (beta)

https://docs-beta.ipfs.io

fork in 3 months

issue commentnodejs/TSC

Node.js Technical Steering Committee (TSC) Meeting 2020-04-16

I might be late or not attend at all today, sorry.

mhdawson

comment created time in 3 months

pull request commentnodejs/node

crypto: assign and use ERR_CRYPTO_UNKNOWN_CIPHER

I don't know. I am still not sure if this is considered a breaking change or not (I didn't assume so, but IIRC @jasnell did). Ref: https://github.com/nodejs/node/pull/31873#issuecomment-588534047

tniessen

comment created time in 3 months

more