crypto: add randomFill and randomFillSync #10209

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
@evanlucas
Member

evanlucas commented Dec 9, 2016

Checklist
  • make -j4 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

crypto

Description of change

crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Dec 9, 2016

Contributor

Shouldn't the int64_t in these related Random* functions be size_t instead?

Contributor

mscdex commented Dec 9, 2016

Shouldn't the int64_t in these related Random* functions be size_t instead?

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Dec 9, 2016

Member

hm, it was changed from a uint32_t in 944f680. @trevnorris?

Member

evanlucas commented Dec 9, 2016

hm, it was changed from a uint32_t in 944f680. @trevnorris?

@sam-github

This comment has been minimized.

Show comment
Hide comment
@sam-github

sam-github Dec 10, 2016

Member

No strong opinion, but what about Buffer.randomFill() and Buffer.randomFillSync()? Or crypto.randomFill(buffer) (with a Sync version).

Also, while I appreciate you not wanting to commit too much work to something before you know it is getting a warm receiption, its hard to get meaningful comment on an API addition if you don't provide API documentation in the PR, you can only get feedback from those willing to wade through the C++.

And I'm generally +1 on the idea, seems reasonable.

Member

sam-github commented Dec 10, 2016

No strong opinion, but what about Buffer.randomFill() and Buffer.randomFillSync()? Or crypto.randomFill(buffer) (with a Sync version).

Also, while I appreciate you not wanting to commit too much work to something before you know it is getting a warm receiption, its hard to get meaningful comment on an API addition if you don't provide API documentation in the PR, you can only get feedback from those willing to wade through the C++.

And I'm generally +1 on the idea, seems reasonable.

@addaleax

This comment has been minimized.

Show comment
Hide comment
@addaleax

addaleax Dec 11, 2016

Member

Yeah, I agree, it would probably be easier to have this as its own API, too.

Member

addaleax commented Dec 11, 2016

Yeah, I agree, it would probably be easier to have this as its own API, too.

src/node_crypto.cc
+ char* buf = reinterpret_cast<char*>(Buffer::Data(argv[1].As<Object>()));
+ for (size_t i = 0; i < size; i++) {
+ buf[i] = data[i];
+ }

This comment has been minimized.

@addaleax

addaleax Dec 11, 2016

Member

Would there be any reason not to fill the passed buffer directly instead of copying?

@addaleax

addaleax Dec 11, 2016

Member

Would there be any reason not to fill the passed buffer directly instead of copying?

This comment has been minimized.

@evanlucas

evanlucas Dec 12, 2016

Member

Without doing a copy like this, I couldn't get it to work for some reason. I'll dig more into it though.

@evanlucas

evanlucas Dec 12, 2016

Member

Without doing a copy like this, I couldn't get it to work for some reason. I'll dig more into it though.

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Dec 12, 2016

Member

I think I would prefer to have a separate API for something like this because this prevents feature detection in a way

This would work, wouldn't it?

let supported = true;
try {
  crypto.randomBytes(new Buffer(1));
} catch (e) {
  supported = !(e instanceof TypeError);
}

I have a mild preference for extending the existing API.

That said, the API should ideally also take an offset and a length so you can read into a buffer at a specific location. That might get awkward to retrofit onto the existing API.

On the other hand: if the first argument is a buffer, it's unambiguous what version of the API you are trying to invoke.

Member

bnoordhuis commented Dec 12, 2016

I think I would prefer to have a separate API for something like this because this prevents feature detection in a way

This would work, wouldn't it?

let supported = true;
try {
  crypto.randomBytes(new Buffer(1));
} catch (e) {
  supported = !(e instanceof TypeError);
}

I have a mild preference for extending the existing API.

That said, the API should ideally also take an offset and a length so you can read into a buffer at a specific location. That might get awkward to retrofit onto the existing API.

On the other hand: if the first argument is a buffer, it's unambiguous what version of the API you are trying to invoke.

@mscdex

This comment has been minimized.

Show comment
Hide comment
@mscdex

mscdex Dec 12, 2016

Contributor

Yes, allowing an offset would be even better.

Contributor

mscdex commented Dec 12, 2016

Yes, allowing an offset would be even better.

@trevnorris

This comment has been minimized.

Show comment
Hide comment
@trevnorris

trevnorris Dec 13, 2016

Contributor

@evanlucas @mscdex I was doing some forward proofing, though I seemed to have left in the IsUint32() check above it. That should have been removed and the >= 0 check placed after retrieving size. Since the maximum size of the Buffer depends on the architecture, and the fact that ArrayBuffer has a much higher maximum size, I was hoping that the maximum length of a Uint8Array would increase in the future.

Contributor

trevnorris commented Dec 13, 2016

@evanlucas @mscdex I was doing some forward proofing, though I seemed to have left in the IsUint32() check above it. That should have been removed and the >= 0 check placed after retrieving size. Since the maximum size of the Buffer depends on the architecture, and the fact that ArrayBuffer has a much higher maximum size, I was hoping that the maximum length of a Uint8Array would increase in the future.

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Dec 14, 2016

Member

@bnoordhuis are you suggesting something like this?:

crypto.randomBytes(buf[, offset[, size]][, callback])

That seems like the following arguments would need to be possible:

crypto.randomBytes(size)
crypto.randomBytes(size, callback)
crypto.randomBytes(buf)
crypto.randomBytes(buf, callback)
crypto.randomBytes(buf, offset)
crypto.randomBytes(buf, offset, callback)
crypto.randomBytes(buf, offset, size)
crypto.randomBytes(buf, offset, size, callback)

Is there any way I could sway you on introducing a new api for this?

Member

evanlucas commented Dec 14, 2016

@bnoordhuis are you suggesting something like this?:

crypto.randomBytes(buf[, offset[, size]][, callback])

That seems like the following arguments would need to be possible:

crypto.randomBytes(size)
crypto.randomBytes(size, callback)
crypto.randomBytes(buf)
crypto.randomBytes(buf, callback)
crypto.randomBytes(buf, offset)
crypto.randomBytes(buf, offset, callback)
crypto.randomBytes(buf, offset, size)
crypto.randomBytes(buf, offset, size, callback)

Is there any way I could sway you on introducing a new api for this?

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Dec 23, 2016

Member

I'm definitely +1 on this but agree that a new API would be better. We consistently get feedback that adding new methods is preferable to extending an existing one.

Member

jasnell commented Dec 23, 2016

I'm definitely +1 on this but agree that a new API would be better. We consistently get feedback that adding new methods is preferable to extending an existing one.

@bnoordhuis

This comment has been minimized.

Show comment
Hide comment
@bnoordhuis

bnoordhuis Dec 23, 2016

Member

Yes, but we also consistently get feedback that our APIs sprawl and aren't very cohesive. :-)

What about crypto.randomBytesBuffer()? That's close enough to the original that it should be easy to memorize.

Member

bnoordhuis commented Dec 23, 2016

Yes, but we also consistently get feedback that our APIs sprawl and aren't very cohesive. :-)

What about crypto.randomBytesBuffer()? That's close enough to the original that it should be easy to memorize.

@sam-github

This comment has been minimized.

Show comment
Hide comment
@sam-github

sam-github Dec 29, 2016

Member

No one likes my Buffer.randomFill() idea? I'll pitch it a bit more: By moving it to a different module we associate it more closely with Buffer and make it more discoverable, and avoid sprawl within the crypto API.

It does have the downside of coupling the Buffer API to an underlying OpenSSL/crypto facility, though, so maybe that downside overweighs the up.

@evanlucas in your examples of the syntaxes that would be reasonably expected to work, will the callback-less one still be async, or will it become magically sync? For a new API, I'd lean towards the more node-typical API pattern of a function with Sync in the name explicitly for sync (not the uv-derived "don't pass a callback and it becomes sync" behaviour).

Member

sam-github commented Dec 29, 2016

No one likes my Buffer.randomFill() idea? I'll pitch it a bit more: By moving it to a different module we associate it more closely with Buffer and make it more discoverable, and avoid sprawl within the crypto API.

It does have the downside of coupling the Buffer API to an underlying OpenSSL/crypto facility, though, so maybe that downside overweighs the up.

@evanlucas in your examples of the syntaxes that would be reasonably expected to work, will the callback-less one still be async, or will it become magically sync? For a new API, I'd lean towards the more node-typical API pattern of a function with Sync in the name explicitly for sync (not the uv-derived "don't pass a callback and it becomes sync" behaviour).

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Dec 29, 2016

Member

@sam-github I would prefer to explicitly have to specify ...Sync() in the method name. I actually like randomFill() but not sure about it being on Buffer. I think it makes more sense to stick it on crypto.

Member

evanlucas commented Dec 29, 2016

@sam-github I would prefer to explicitly have to specify ...Sync() in the method name. I actually like randomFill() but not sure about it being on Buffer. I think it makes more sense to stick it on crypto.

@trevnorris

This comment has been minimized.

Show comment
Hide comment
@trevnorris

trevnorris Jan 11, 2017

Contributor

@sam-github Though we need to consider that there are already APIs in core that write into a Buffer. e.g. fs.read(). i.e. keeping it in the module where the buffer is being used makes more sense (also b/c there are other places i'd like to be able to do this, and we can't throw them all on Buffer).

+1 for @bnoordhuis proposal.

Contributor

trevnorris commented Jan 11, 2017

@sam-github Though we need to consider that there are already APIs in core that write into a Buffer. e.g. fs.read(). i.e. keeping it in the module where the buffer is being used makes more sense (also b/c there are other places i'd like to be able to do this, and we can't throw them all on Buffer).

+1 for @bnoordhuis proposal.

@ronkorving

This comment has been minimized.

Show comment
Hide comment
@ronkorving

ronkorving Jan 12, 2017

Contributor

@sam-github I prefer this staying in crypto, rather than being a Buffer method, because at least it indicates that OpenSSL is the source of the randomness (rather than Math.random()). Regardless of that being documented, that's something you instinctively know when using the API.

Contributor

ronkorving commented Jan 12, 2017

@sam-github I prefer this staying in crypto, rather than being a Buffer method, because at least it indicates that OpenSSL is the source of the randomness (rather than Math.random()). Regardless of that being documented, that's something you instinctively know when using the API.

@jasnell

This comment has been minimized.

Show comment
Hide comment
@jasnell

jasnell Jan 12, 2017

Member

+1 to it staying in crypto. fwiw, I'd really like to see this land :-)

Member

jasnell commented Jan 12, 2017

+1 to it staying in crypto. fwiw, I'd really like to see this land :-)

@sam-github

This comment has been minimized.

Show comment
Hide comment
@sam-github

sam-github Jan 12, 2017

Member

OK, consensus seems to be keep it in crypto and to use Sync for sync APIs.

I think randomBytesBuffer() as a name can be improved by describing the action rather than the data types it operates on:

crypto.randomFill(size, callback)
crypto.randomFill(buf, callback)
crypto.randomFill(buf, offset, callback)
crypto.randomFill(buf, offset, size, callback)

crypto.randomFillSync(size)
crypto.randomFillSync(buf)
crypto.randomFillSync(buf, offset)
crypto.randomFillSync(buf, offset, size)
Member

sam-github commented Jan 12, 2017

OK, consensus seems to be keep it in crypto and to use Sync for sync APIs.

I think randomBytesBuffer() as a name can be improved by describing the action rather than the data types it operates on:

crypto.randomFill(size, callback)
crypto.randomFill(buf, callback)
crypto.randomFill(buf, offset, callback)
crypto.randomFill(buf, offset, size, callback)

crypto.randomFillSync(size)
crypto.randomFillSync(buf)
crypto.randomFillSync(buf, offset)
crypto.randomFillSync(buf, offset, size)
@ronkorving

This comment has been minimized.

Show comment
Hide comment
@ronkorving

ronkorving Jan 13, 2017

Contributor

@sam-github Is there a point in supporting randomFill without supplying a buffer? I would just drop those in favor of the randomBytes we have today (unless I'm not getting what that's trying to do...). Other than that, thumbs up from me :)

Contributor

ronkorving commented Jan 13, 2017

@sam-github Is there a point in supporting randomFill without supplying a buffer? I would just drop those in favor of the randomBytes we have today (unless I'm not getting what that's trying to do...). Other than that, thumbs up from me :)

@evanlucas evanlucas removed the in progress label Jan 13, 2017

@evanlucas evanlucas changed the title from src: allow passing a buffer to RandomBytes to crypto: add randomFill and randomFillSync Jan 13, 2017

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Jan 13, 2017

Member

I've updated this to be crypto.randomFill() and crypto.randomFillSync(). PTAL. Thanks!

Member

evanlucas commented Jan 13, 2017

I've updated this to be crypto.randomFill() and crypto.randomFillSync(). PTAL. Thanks!

@sam-github

I like it. Optional suggestion: fill and return the arg[0] buffer, so we can do var randomBuf = crypto.randomFill(Buffer.allocUnsafe(10)), or console.log(crypto.randomFill(Buffer.alloc(10)).toString('hex').

doc/api/crypto.md
+* `size` {Number}
+
+This function is similar to [`crypto.randomBytes()`][] but requires the first
+argument to be a [`Buffer`][] that will be filled instead of returned. Another

This comment has been minimized.

@jasnell

jasnell Jan 13, 2017

Member

I definitely agree with @sam-github's suggestion that these ought to return the instance of the Buffer passed in so that calls can be chained.

@jasnell

jasnell Jan 13, 2017

Member

I definitely agree with @sam-github's suggestion that these ought to return the instance of the Buffer passed in so that calls can be chained.

This comment has been minimized.

@ronkorving

ronkorving Jan 16, 2017

Contributor

I was thinking the same 👍

@ronkorving

ronkorving Jan 16, 2017

Contributor

I was thinking the same 👍

This comment has been minimized.

@evanlucas

evanlucas Jan 17, 2017

Member

ack

lib/crypto.js
+
+ return binding.randomFill(buf, offset, size);
+}
+exports.randomFillSync = randomFillSync;

This comment has been minimized.

@jasnell

jasnell Jan 13, 2017

Member

Just running through a few argument examples on this, most variations look good with one exception:

>crypto.randomFillSync(Buffer.alloc(10), 11)
TypeError: size must be a number >= 0

The issue, of course, is in how the default size is calculated if the argument is not given but the error message is confusing in this case because it does not match the actual problem -- the fact that the offset is greater than the buffer size.

@jasnell

jasnell Jan 13, 2017

Member

Just running through a few argument examples on this, most variations look good with one exception:

>crypto.randomFillSync(Buffer.alloc(10), 11)
TypeError: size must be a number >= 0

The issue, of course, is in how the default size is calculated if the argument is not given but the error message is confusing in this case because it does not match the actual problem -- the fact that the offset is greater than the buffer size.

This comment has been minimized.

@evanlucas

evanlucas Jan 17, 2017

Member

ack

doc/api/crypto.md
@@ -1539,6 +1539,73 @@ This should normally never take longer than a few milliseconds. The only time
when generating the random bytes may conceivably block for a longer period of
time is right after boot, when the whole system is still low on entropy.
+### crypto.randomFillSync(buf[, offset][, size])
+
+<!-- YAML

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

nit: The whitespace above this can be dropped

@addaleax

addaleax Jan 16, 2017

Member

nit: The whitespace above this can be dropped

This comment has been minimized.

@evanlucas

evanlucas Jan 17, 2017

Member

ack

doc/api/crypto.md
+
+### crypto.randomFill(buf[, offset][, size], callback)
+
+<!-- YAML

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

(ditto regarding whitespace)

@addaleax

addaleax Jan 16, 2017

Member

(ditto regarding whitespace)

lib/crypto.js
+ throw new TypeError('"buf" argument must be a Buffer');
+ }
+
+ if (!size) size = buf.length - offset;

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

I know size === 0 is kind of an edge case but I’d actually expect that to be a no-op. So maybe a strict comparison with undefined is better than !size?

@addaleax

addaleax Jan 16, 2017

Member

I know size === 0 is kind of an edge case but I’d actually expect that to be a no-op. So maybe a strict comparison with undefined is better than !size?

lib/crypto.js
@@ -633,6 +633,37 @@ exports.setEngine = function setEngine(id, flags) {
return binding.setEngine(id, flags);
};
+function randomFillSync(buf, offset = 0, size) {
+ if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"buf" argument must be a Buffer');

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

Can I suggest that you use process.binding('util').isUint8Array instead of Buffer.isBuffer and adjust the error message to include Uint8Arrays?

@addaleax

addaleax Jan 16, 2017

Member

Can I suggest that you use process.binding('util').isUint8Array instead of Buffer.isBuffer and adjust the error message to include Uint8Arrays?

lib/crypto.js
+function randomFill(buf, offset, size, cb) {
+ if (!Buffer.isBuffer(buf)) {
+ throw new TypeError('"buf" argument must be a Buffer');
+ }

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

(ditto regarding Uint8Array support)

@addaleax

addaleax Jan 16, 2017

Member

(ditto regarding Uint8Array support)

src/node_crypto.cc
+ Environment* env = Environment::GetCurrent(args);
+
+ if (!Buffer::HasInstance(args[0])) {
+ return env->ThrowTypeError("buf must be a Buffer");

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

I know this is only copied, but you can write this as args[0]->IsUint8Array(), too; that’s what Buffer::HasInstance does under the hood.

@addaleax

addaleax Jan 16, 2017

Member

I know this is only copied, but you can write this as args[0]->IsUint8Array(), too; that’s what Buffer::HasInstance does under the hood.

src/node_crypto.cc
+ return env->ThrowRangeError("buffer too small");
+
+ if (size == 0)
+ size = len - offset;

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

This kind of echoes my comment on the JS part above, but why this bit?

@addaleax

addaleax Jan 16, 2017

Member

This kind of echoes my comment on the JS part above, but why this bit?

src/node_crypto.cc
: AsyncWrap(env, object, AsyncWrap::PROVIDER_CRYPTO),
error_(0),
size_(size),
- data_(node::Malloc(size)) {
+ data_(node::Malloc(size)),

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

This looks like a memory leak to me when randomFill is used – maybe it would be better to pass the memory behind the input Buffer as a parameter to RandomBytesRequest, and store that in data_?

That might allow you to get rid of the extra offset parameter and the memory copying in RandomBytesCheck, too.

@addaleax

addaleax Jan 16, 2017

Member

This looks like a memory leak to me when randomFill is used – maybe it would be better to pass the memory behind the input Buffer as a parameter to RandomBytesRequest, and store that in data_?

That might allow you to get rid of the extra offset parameter and the memory copying in RandomBytesCheck, too.

This comment has been minimized.

@evanlucas

evanlucas Jan 18, 2017

Member

so, if I just pass in req->data() without actually copying the memory, it aborts. I was able to switch to using memcpy though.

@evanlucas

evanlucas Jan 18, 2017

Member

so, if I just pass in req->data() without actually copying the memory, it aborts. I was able to switch to using memcpy though.

src/node_crypto.cc
+ const size_t max = req->offset() + size;
+ for (size_t i = req->offset(); i < max; i++) {
+ buf[i] = data[i - req->offset()];
+ }

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

If you want to keep the separate copy, you can probably replace this by a call to memcpy()

@addaleax

addaleax Jan 16, 2017

Member

If you want to keep the separate copy, you can probably replace this by a call to memcpy()

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Also, it would probably be good to verify that CHECK_LE(max, Buffer::Length(buffer)) first.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Also, it would probably be good to verify that CHECK_LE(max, Buffer::Length(buffer)) first.

This comment has been minimized.

@evanlucas

evanlucas Jan 18, 2017

Member

ack

+ const before = buf.toString('hex');
+ crypto.randomFillSync(buf, 5, 5);
+ const after = buf.toString('hex');
+ assert.notStrictEqual(before, after);

This comment has been minimized.

@addaleax

addaleax Jan 16, 2017

Member

Maybe add assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); (and in the other places where it applies, too)?

@addaleax

addaleax Jan 16, 2017

Member

Maybe add assert.deepStrictEqual(before.slice(0, 5), after.slice(0, 5)); (and in the other places where it applies, too)?

src/node_crypto.cc
@@ -5512,7 +5522,18 @@ void RandomBytesCheck(RandomBytesRequest* req, Local<Value> argv[2]) {
size_t size;
req->return_memory(&data, &size);
argv[0] = Null(req->env()->isolate());
- argv[1] = Buffer::New(req->env(), data, size).ToLocalChecked();
+ Local<Value> buffer = req->object()->Get(req->env()->buffer_string());

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Can you use the checked instance here? (The overload that takes a Local<Contex>.)

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Can you use the checked instance here? (The overload that takes a Local<Contex>.)

src/node_crypto.cc
+ Local<Value> buffer = req->object()->Get(req->env()->buffer_string());
+
+ if (Buffer::HasInstance(buffer)) {
+ char* buf = reinterpret_cast<char*>(Buffer::Data(buffer));

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

The reinterpret_cast isn't necessary, is it?

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

The reinterpret_cast isn't necessary, is it?

src/node_crypto.cc
+ const size_t max = req->offset() + size;
+ for (size_t i = req->offset(); i < max; i++) {
+ buf[i] = data[i - req->offset()];
+ }

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Also, it would probably be good to verify that CHECK_LE(max, Buffer::Length(buffer)) first.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Also, it would probably be good to verify that CHECK_LE(max, Buffer::Length(buffer)) first.

src/node_crypto.cc
+ int64_t size = args[2]->IntegerValue();
+
+ if (offset < 0 || offset > Buffer::kMaxLength)
+ return env->ThrowRangeError("offset is not a valid Smi");

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

"Smi" is a bit too jargon-y, not many people are going to know what it means. (As well, -1 is a valid SMI.)

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

"Smi" is a bit too jargon-y, not many people are going to know what it means. (As well, -1 is a valid SMI.)

src/node_crypto.cc
+ size = len - offset;
+
+ Local<Object> obj = env->NewInternalFieldObject();
+ obj->Set(env->buffer_string(), args[0]);

This comment has been minimized.

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Can you use the checked version of Get() and Set() here and below?

@bnoordhuis

bnoordhuis Jan 16, 2017

Member

Can you use the checked version of Get() and Set() here and below?

@jasnell

This comment has been minimized.

Show comment
Hide comment
Member

jasnell commented Mar 24, 2017

Ping @evanlucas

@jasnell jasnell added the stalled label Mar 24, 2017

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Mar 25, 2017

Member

yea, yea, i'll get this rebased and fixed. Thanks for the reminder :]

Member

evanlucas commented Mar 25, 2017

yea, yea, i'll get this rebased and fixed. Thanks for the reminder :]

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Apr 3, 2017

Member

Updated. All of the comments should be addressed. PTAL

CI: https://ci.nodejs.org/job/node-test-pull-request/7183/

Member

evanlucas commented Apr 3, 2017

Updated. All of the comments should be addressed. PTAL

CI: https://ci.nodejs.org/job/node-test-pull-request/7183/

src/node_crypto.cc
+ return env->ThrowRangeError("size out of range");
+
+ if (size + offset > len)
+ return env->ThrowRangeError("buffer too small");

This comment has been minimized.

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

Is there a reason for doing the type and length checks in C++ land? You could do them in JS land and simply CHECK them here.

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

Is there a reason for doing the type and length checks in C++ land? You could do them in JS land and simply CHECK them here.

src/node_crypto.cc
+ Local<Object> obj = env->NewInternalFieldObject();
+ obj->Set(env->context(), env->buffer_string(), args[0]).FromJust();
+ char* data = Buffer::Data(args[0]);
+ while (offset--) data++;

This comment has been minimized.

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

data += offset?

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

data += offset?

src/node_crypto.cc
+ else
+ args.GetReturnValue().Set(argv[1]);
+ }
+}

This comment has been minimized.

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

This could probably share more code with RandomBytes().

@bnoordhuis

bnoordhuis Apr 4, 2017

Member

This could probably share more code with RandomBytes().

doc/api/crypto.md
+
+* `buf` {Buffer}
+* `offset` {Number}
+* `size` {Number}

This comment has been minimized.

@addaleax

addaleax Apr 5, 2017

Member

We’ve switched to lower-casing primitives since this PR was opened … 😄

@addaleax

addaleax Apr 5, 2017

Member

We’ve switched to lower-casing primitives since this PR was opened … 😄

outdated

@evanlucas evanlucas removed the stalled label Apr 5, 2017

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Apr 5, 2017

Member

Updated. I moved the type/length checking to js and addressed the other comments.

CI: https://ci.nodejs.org/job/node-test-pull-request/7226/

Member

evanlucas commented Apr 5, 2017

Updated. I moved the type/length checking to js and addressed the other comments.

CI: https://ci.nodejs.org/job/node-test-pull-request/7226/

@evanlucas

This comment has been minimized.

Show comment
Hide comment
@evanlucas

evanlucas Apr 17, 2017

Member

Landed in d06eb53. Thanks!

Member

evanlucas commented Apr 17, 2017

Landed in d06eb53. Thanks!

evanlucas added a commit to evanlucas/node that referenced this pull request May 1, 2017

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: nodejs#10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

@evanlucas evanlucas referenced this pull request May 1, 2017

Merged

v7.10.0 proposal #12775

evanlucas added a commit that referenced this pull request May 1, 2017

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: #10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

evanlucas added a commit that referenced this pull request May 2, 2017

2017-05-02, Version 7.10.0 (Current)
Notable changes:

* **crypto**:
  - add randomFill and randomFillSync (Evan Lucas)
    #10209
* **meta**: Added new collaborators
  - add lucamaraschi to collaborators (Luca Maraschi)
    #12538
  - add DavidCai1993 to collaborators (David Cai)
    #12435
  - add jkrems to collaborators (Jan Krems)
    #12427
  - add AnnaMag to collaborators (AnnaMag)
    #12414
* **process**:
  - fix crash when Promise rejection is a Symbol (Cameron Little)
    #11640
* **url**:
  - make WHATWG URL more spec compliant (Timothy Gu)
    #12507
* **v8**:
  - fix stack overflow in recursive method (Ben Noordhuis)
    #12460
  - fix build errors with g++ 7 (Ben Noordhuis)
    #12392

PR-URL: #12775

evanlucas added a commit that referenced this pull request May 2, 2017

2017-05-02, Version 7.10.0 (Current)
Notable changes:

* **crypto**:
  - add randomFill and randomFillSync (Evan Lucas)
    #10209
* **meta**: Added new collaborators
  - add lucamaraschi to collaborators (Luca Maraschi)
    #12538
  - add DavidCai1993 to collaborators (David Cai)
    #12435
  - add jkrems to collaborators (Jan Krems)
    #12427
  - add AnnaMag to collaborators (AnnaMag)
    #12414
* **process**:
  - fix crash when Promise rejection is a Symbol (Cameron Little)
    #11640
* **url**:
  - make WHATWG URL more spec compliant (Timothy Gu)
    #12507
* **v8**:
  - fix stack overflow in recursive method (Ben Noordhuis)
    #12460
  - fix build errors with g++ 7 (Ben Noordhuis)
    #12392

PR-URL: #12775

evanlucas added a commit that referenced this pull request May 3, 2017

2017-05-02, Version 7.10.0 (Current)
Notable changes:

* **crypto**:
  - add randomFill and randomFillSync (Evan Lucas)
    #10209
* **meta**: Added new collaborators
  - add lucamaraschi to collaborators (Luca Maraschi)
    #12538
  - add DavidCai1993 to collaborators (David Cai)
    #12435
  - add jkrems to collaborators (Jan Krems)
    #12427
  - add AnnaMag to collaborators (AnnaMag)
    #12414
* **process**:
  - fix crash when Promise rejection is a Symbol (Cameron Little)
    #11640
* **url**:
  - make WHATWG URL more spec compliant (Timothy Gu)
    #12507
* **v8**:
  - fix stack overflow in recursive method (Ben Noordhuis)
    #12460
  - fix build errors with g++ 7 (Ben Noordhuis)
    #12392

PR-URL: #12775

evanlucas added a commit that referenced this pull request May 3, 2017

2017-05-02, Version 7.10.0 (Current)
Notable changes:

* **crypto**:
  - add randomFill and randomFillSync (Evan Lucas)
    #10209
* **meta**: Added new collaborators
  - add lucamaraschi to collaborators (Luca Maraschi)
    #12538
  - add DavidCai1993 to collaborators (David Cai)
    #12435
  - add jkrems to collaborators (Jan Krems)
    #12427
  - add AnnaMag to collaborators (AnnaMag)
    #12414
* **process**:
  - fix crash when Promise rejection is a Symbol (Cameron Little)
    #11640
* **url**:
  - make WHATWG URL more spec compliant (Timothy Gu)
    #12507
* **v8**:
  - fix stack overflow in recursive method (Ben Noordhuis)
    #12460
  - fix build errors with g++ 7 (Ben Noordhuis)
    #12392

PR-URL: #12775

imyller added a commit to imyller/meta-nodejs that referenced this pull request May 4, 2017

2017-05-02, Version 7.10.0 (Current)
    Notable changes:

    * **crypto**:
      - add randomFill and randomFillSync (Evan Lucas)
        nodejs/node#10209
    * **meta**: Added new collaborators
      - add lucamaraschi to collaborators (Luca Maraschi)
        nodejs/node#12538
      - add DavidCai1993 to collaborators (David Cai)
        nodejs/node#12435
      - add jkrems to collaborators (Jan Krems)
        nodejs/node#12427
      - add AnnaMag to collaborators (AnnaMag)
        nodejs/node#12414
    * **process**:
      - fix crash when Promise rejection is a Symbol (Cameron Little)
        nodejs/node#11640
    * **url**:
      - make WHATWG URL more spec compliant (Timothy Gu)
        nodejs/node#12507
    * **v8**:
      - fix stack overflow in recursive method (Ben Noordhuis)
        nodejs/node#12460
      - fix build errors with g++ 7 (Ben Noordhuis)
        nodejs/node#12392

    PR-URL: nodejs/node#12775

Signed-off-by: Ilkka Myller <ilkka.myller@nodefield.com>

anchnk added a commit to anchnk/node that referenced this pull request May 6, 2017

2017-05-02, Version 7.10.0 (Current)
Notable changes:

* **crypto**:
  - add randomFill and randomFillSync (Evan Lucas)
    nodejs#10209
* **meta**: Added new collaborators
  - add lucamaraschi to collaborators (Luca Maraschi)
    nodejs#12538
  - add DavidCai1993 to collaborators (David Cai)
    nodejs#12435
  - add jkrems to collaborators (Jan Krems)
    nodejs#12427
  - add AnnaMag to collaborators (AnnaMag)
    nodejs#12414
* **process**:
  - fix crash when Promise rejection is a Symbol (Cameron Little)
    nodejs#11640
* **url**:
  - make WHATWG URL more spec compliant (Timothy Gu)
    nodejs#12507
* **v8**:
  - fix stack overflow in recursive method (Ben Noordhuis)
    nodejs#12460
  - fix build errors with g++ 7 (Ben Noordhuis)
    nodejs#12392

PR-URL: nodejs#12775
@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn May 16, 2017

Member

LTS opted to punt on this for this release, and consider it before the next semver-minor v6.x release.

Should probably land with #10209

Member

gibfahn commented May 16, 2017

LTS opted to punt on this for this release, and consider it before the next semver-minor v6.x release.

Should probably land with #10209

@MylesBorins

This comment has been minimized.

Show comment
Hide comment
@MylesBorins

MylesBorins Jan 11, 2018

Member

should also land with #12541

Member

MylesBorins commented Jan 11, 2018

should also land with #12541

@gibfahn

This comment has been minimized.

Show comment
Hide comment
@gibfahn

gibfahn Jan 15, 2018

Member

Release team were +1 on backporting to v6.x and v8.x.

Member

gibfahn commented Jan 15, 2018

Release team were +1 on backporting to v6.x and v8.x.

MylesBorins added a commit that referenced this pull request Jan 16, 2018

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: #10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

MylesBorins added a commit that referenced this pull request Jan 17, 2018

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: #10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

@MylesBorins MylesBorins referenced this pull request Jan 24, 2018

Merged

v6.13.0 proposal #18342

MylesBorins added a commit that referenced this pull request Feb 10, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 11, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 12, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 12, 2018

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: #10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

MylesBorins added a commit that referenced this pull request Feb 12, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 13, 2018

crypto: add randomFill and randomFillSync
crypto.randomFill and crypto.randomFillSync are similar to
crypto.randomBytes, but allow passing in a buffer as the first
argument. This allows us to reuse buffers to prevent having to
create a new one on every call.

PR-URL: #10209
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Anna Henningsen <anna@addaleax.net>

MylesBorins added a commit that referenced this pull request Feb 13, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 109 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 29 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 13, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 13, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MylesBorins added a commit that referenced this pull request Feb 13, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    #12678
* crypto:
  - expose ECDH class (Bryan English)
    #8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    #10209
  - warn on invalid authentication tag length (Tobias Nießen)
    #17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    #16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    #7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    #13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    #13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    #16386
* net:
  - return this from getConnections() (Sam Roberts)
    #13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    #13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    #14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    #16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    #12087
  - add process.ppid (cjihrig)
    #16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    #12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    #15179
* url:
  - WHATWG URL api support (James M Snell)
    #7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    #10308

PR-URL: #18342

MayaLekova added a commit to MayaLekova/node that referenced this pull request May 8, 2018

2018-01-13, Version 6.13.0 'Boron' (LTS)
This LTS release comes with 112 commits, 17 of which are considered
Semver-Minor. This includes 32 which are doc related, 30 which are test
related, 8 which are build / tool related and 1 commit which updates
a dependency.

Notable Changes:

* console:
  - added console.count() and console.clear() (James M Snell)
    nodejs#12678
* crypto:
  - expose ECDH class (Bryan English)
    nodejs#8188
  - added cypto.randomFill() and crypto.randomFillSync() (Evan Lucas)
    nodejs#10209
  - warn on invalid authentication tag length (Tobias Nießen)
    nodejs#17566
* deps:
  - upgrade libuv to 1.16.1 (cjihrig)
    nodejs#16835
* dgram:
  - added socket.setMulticastInterface() (Will Young)
    nodejs#7855
* http:
  - add agent.keepSocketAlive and agent.reuseSocket as to allow
    overridable keep-alive behavior of `Agent` (Fedor Indutny)
    nodejs#13005
* lib:
  - return this from net.Socket.end() (Sam Roberts)
    nodejs#13481
* module:
  - add builtinModules api that provides list of all builtin modules in
    Node (Jon Moss)
    nodejs#16386
* net:
  - return this from getConnections() (Sam Roberts)
    nodejs#13553
* promises:
  - more robust stringification for unhandled rejections (Timothy Gu)
    nodejs#13784
* repl:
  - improve require() autocompletion (Alexey Orlenko)
    nodejs#14409
* src:
  - add openssl-system-ca-path configure option (Daniel Bevenius)
    nodejs#16790
  - add --use-bundled-ca --use-openssl-ca check (Daniel Bevenius)
    nodejs#12087
  - add process.ppid (cjihrig)
    nodejs#16839
* tls:
  - accept `lookup` option for `tls.connect()` (Fedor Indutny)
    nodejs#12839
* tools, build:
  - a new macOS installer! (JP Wesselink)
    nodejs#15179
* url:
  - WHATWG URL api support (James M Snell)
    nodejs#7448
* util:
  - add %i and %f formatting specifiers (Roman Reiss)
    nodejs#10308

PR-URL: nodejs#18342
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment