Skip to content

Commit 1943493

Browse files
committed
Merge remote-tracking branch 'upstream/v1.x' into v1.x
2 parents b6d2931 + 77f3586 commit 1943493

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+1842
-1569
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ the title of man pages).
2121

2222
## Download
2323

24-
Binaries, installers and source tarballs are available at
24+
Binaries, installers, and source tarballs are available at
2525
<https://iojs.org>.
2626

2727
**Releases** are available at <https://iojs.org/dist/>, listed under
@@ -278,6 +278,7 @@ information about the governance of the io.js project, see
278278
* **Aleksey Smolenchuk** ([@lxe](https://github.com/lxe)) &lt;[email protected]&gt;
279279
* **Shigeki Ohtsu** ([@shigeki](https://github.com/shigeki)) &lt;[email protected]&gt;
280280
* **Sam Roberts** ([@sam-github](https://github.com/sam-github)) &lt;[email protected]&gt;
281+
* **Wyatt Preul** ([@geek](https://github.com/geek)) &lt;[email protected]&gt;
281282

282283
Collaborators follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in
283284
maintaining the io.js project.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
var common = require('../common.js');
2+
var querystring = require('querystring');
3+
var v8 = require('v8');
4+
5+
var bench = common.createBenchmark(main, {
6+
type: ['noencode', 'encodemany', 'encodelast'],
7+
n: [1e6],
8+
});
9+
10+
function main(conf) {
11+
var type = conf.type;
12+
var n = conf.n | 0;
13+
14+
var inputs = {
15+
noencode: 'foo=bar&baz=quux&xyzzy=thud',
16+
encodemany: '%66%6F%6F=bar&%62%61%7A=quux&xyzzy=%74h%75d',
17+
encodelast: 'foo=bar&baz=quux&xyzzy=thu%64'
18+
};
19+
var input = inputs[type];
20+
21+
// Force-optimize querystring.parse() so that the benchmark doesn't get
22+
// disrupted by the optimizer kicking in halfway through.
23+
for (var name in inputs)
24+
querystring.parse(inputs[name]);
25+
26+
v8.setFlagsFromString('--allow_natives_syntax');
27+
eval('%OptimizeFunctionOnNextCall(querystring.parse)');
28+
29+
bench.start();
30+
for (var i = 0; i < n; i += 1)
31+
querystring.parse(input);
32+
bench.end(n);
33+
}
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
var common = require('../common.js');
2+
var querystring = require('querystring');
3+
var v8 = require('v8');
4+
5+
var bench = common.createBenchmark(main, {
6+
type: ['noencode', 'encodemany', 'encodelast'],
7+
n: [1e6],
8+
});
9+
10+
function main(conf) {
11+
var type = conf.type;
12+
var n = conf.n | 0;
13+
14+
var inputs = {
15+
noencode: {
16+
foo: 'bar',
17+
baz: 'quux',
18+
xyzzy: 'thud'
19+
},
20+
encodemany: {
21+
'\u0080\u0083\u0089': 'bar',
22+
'\u008C\u008E\u0099': 'quux',
23+
xyzzy: '\u00A5q\u00A3r'
24+
},
25+
encodelast: {
26+
foo: 'bar',
27+
baz: 'quux',
28+
xyzzy: 'thu\u00AC'
29+
}
30+
};
31+
var input = inputs[type];
32+
33+
// Force-optimize querystring.stringify() so that the benchmark doesn't get
34+
// disrupted by the optimizer kicking in halfway through.
35+
for (var name in inputs)
36+
querystring.stringify(inputs[name]);
37+
38+
v8.setFlagsFromString('--allow_natives_syntax');
39+
eval('%OptimizeFunctionOnNextCall(querystring.stringify)');
40+
41+
bench.start();
42+
for (var i = 0; i < n; i += 1)
43+
querystring.stringify(input);
44+
bench.end(n);
45+
}

doc/api/assert.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ access it with `require('assert')`.
99

1010
Throws an exception that displays the values for `actual` and `expected` separated by the provided operator.
1111

12-
## assert(value, message), assert.ok(value[, message])
12+
## assert(value[, message]), assert.ok(value[, message])
1313

1414
Tests if value is truthy, it is equivalent to `assert.equal(true, !!value, message);`
1515

doc/api/child_process.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ Example:
177177

178178
### child.connected
179179

180-
* {Boolean} Set to false after `.disconnect' is called
180+
* {Boolean} Set to false after `.disconnect` is called
181181

182182
If `.connected` is false, it is no longer possible to send messages.
183183

doc/api/fs.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Here is the synchronous version:
2929

3030
var fs = require('fs');
3131

32-
fs.unlinkSync('/tmp/hello')
32+
fs.unlinkSync('/tmp/hello');
3333
console.log('successfully deleted /tmp/hello');
3434

3535
With the asynchronous methods there is no guaranteed ordering. So the

doc/api/process.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ Example of listening for `exit`:
7272

7373
## Event: 'beforeExit'
7474

75-
This event is emitted when io.js empties it's event loop and has nothing else to
75+
This event is emitted when io.js empties its event loop and has nothing else to
7676
schedule. Normally, io.js exits when there is no work scheduled, but a listener
7777
for 'beforeExit' can make asynchronous calls, and cause io.js to continue.
7878

doc/api/smalloc.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ this it is possible to allocate external array data to more than a plain Object.
3838
v8 does not support allocating external array data to an Array, and if passed
3939
will throw.
4040

41-
It's possible is to specify the type of external array data you would like. All
41+
It's possible to specify the type of external array data you would like. All
4242
possible options are listed in `smalloc.Types`. Example usage:
4343

4444
var doubleArr = smalloc.alloc(3, smalloc.Types.Double);

doc/api/timers.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Stops an interval from triggering.
3434

3535
The opaque value returned by `setTimeout` and `setInterval` also has the method
3636
`timer.unref()` which will allow you to create a timer that is active but if
37-
it is the only item left in the event loop won't keep the program running.
37+
it is the only item left in the event loop, it won't keep the program running.
3838
If the timer is already `unref`d calling `unref` again will have no effect.
3939

4040
In the case of `setTimeout` when you `unref` you create a separate timer that

doc/api/tls.markdown

Lines changed: 18 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ To create a self-signed certificate with the CSR, do this:
2525

2626
Alternatively you can send the CSR to a Certificate Authority for signing.
2727

28-
(TODO: docs on creating a CA, for now interested users should just look at
29-
`test/fixtures/keys/Makefile` in the Node source code)
28+
For Perfect Forward Secrecy, it is required to generate Diffie-Hellman
29+
parameters:
30+
31+
openssl dhparam -outform PEM -out dhparam.pem 2048
3032

3133
To create .pfx or .p12, do this:
3234

@@ -136,31 +138,20 @@ automatically set as a listener for the [secureConnection][] event. The
136138
- `crl` : Either a string or list of strings of PEM encoded CRLs (Certificate
137139
Revocation List)
138140

139-
- `ciphers`: A string describing the ciphers to use or exclude.
140-
141-
To mitigate [BEAST attacks] it is recommended that you use this option in
142-
conjunction with the `honorCipherOrder` option described below to
143-
prioritize the non-CBC cipher.
144-
145-
Defaults to
146-
`ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:AES128-GCM-SHA256:RC4:HIGH:!MD5:!aNULL`.
147-
Consult the [OpenSSL cipher list format documentation] for details
148-
on the format.
141+
- `ciphers`: A string describing the ciphers to use or exclude, seperated by
142+
`:`. The default cipher suite is:
149143

150-
`ECDHE-RSA-AES128-SHA256`, `DHE-RSA-AES128-SHA256` and
151-
`AES128-GCM-SHA256` are TLS v1.2 ciphers and used when io.js is
152-
linked against OpenSSL 1.0.1 or newer, such as the bundled version
153-
of OpenSSL. Note that it is still possible for a TLS v1.2 client
154-
to negotiate a weaker cipher unless `honorCipherOrder` is enabled.
144+
ECDHE-RSA-AES256-SHA384:DHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA256:
145+
DHE-RSA-AES256-SHA256:ECDHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA256:
146+
HIGH:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!SRP:!CAMELLIA
155147

156-
`RC4` is used as a fallback for clients that speak on older version of
157-
the TLS protocol. `RC4` has in recent years come under suspicion and
158-
should be considered compromised for anything that is truly sensitive.
159-
It is speculated that state-level actors possess the ability to break it.
160-
161-
**NOTE**: Previous revisions of this section suggested `AES256-SHA` as an
162-
acceptable cipher. Unfortunately, `AES256-SHA` is a CBC cipher and therefore
163-
susceptible to [BEAST attacks]. Do *not* use it.
148+
The default cipher suite prefers ECDHE and DHE ciphers for Perfect Forward
149+
secrecy, while offering *some* backward compatibiltity. Old clients which
150+
rely on insecure and deprecated RC4 or DES-based ciphers (like Internet
151+
Explorer 6) aren't able to complete the handshake with the default
152+
configuration. If you absolutely must support these clients, the
153+
[TLS recommendations] may offer a compatible cipher suite. For more details
154+
on the format, see the [OpenSSL cipher list format documentation].
164155

165156
- `ecdhCurve`: A string describing a named curve to use for ECDH key agreement
166157
or false to disable ECDH.
@@ -178,11 +169,7 @@ automatically set as a listener for the [secureConnection][] event. The
178169
times out.
179170

180171
- `honorCipherOrder` : When choosing a cipher, use the server's preferences
181-
instead of the client preferences.
182-
183-
Although, this option is disabled by default, it is *recommended* that you
184-
use this option in conjunction with the `ciphers` option to mitigate
185-
BEAST attacks.
172+
instead of the client preferences. Default: `true`.
186173

187174
- `requestCert`: If `true` the server will request a certificate from
188175
clients that connect and attempt to verify that certificate. Default:
@@ -812,3 +799,4 @@ The numeric representation of the local port.
812799
[ECDHE]: https://en.wikipedia.org/wiki/Elliptic_curve_Diffie%E2%80%93Hellman
813800
[asn1.js]: http://npmjs.org/package/asn1.js
814801
[OCSP request]: http://en.wikipedia.org/wiki/OCSP_stapling
802+
[TLS recommendations]: https://wiki.mozilla.org/Security/Server_Side_TLS

0 commit comments

Comments
 (0)