Commit Graph

8952 Commits (8c868989be778246bc4b9558f087d0f93724b83d)

Author SHA1 Message Date
Fedor Indutny 8c868989be zlib: do not Unref() if wasn't Ref()ed
In very unlikely case, where `deflateInit2()` may return error (right
now happening only on exhausting all memory), the `ZCtx::Error()` will
be called and will try to `Unref()` the handle. But the problem is that
this handle was never `Ref()`ed, so it will trigger an assertion error
and crash the program.

Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
PR-URL: https://github.com/joyent/node/pull/8687
2014-12-04 18:10:13 +03:00
Ben Noordhuis f9456a2d36 crypto: update root certificates
Update tools/certdata.txt to [0] (last updated on 2014-11-14) and
rebuild src/node_root_certs.h.

Refs joyent/node#8679 and joyent/node#8709.

[0] https://hg.mozilla.org/mozilla-central/raw-file/64206634959a/security/nss/lib/ckfw/builtins/certdata.txt
2014-12-04 16:57:48 +03:00
Ben Noordhuis 479b0b4e54 tools: customize mk-ca-bundle.pl
Remove unneeded functionality and tweak the generated output so we
can #include it in C++ source code.

This is a back-port of commit e159073 from the master branch.
2014-12-04 16:57:48 +03:00
Ben Noordhuis 3c9c920f57 tools: bundle mk-ca-bundle.pl from upstream curl
This is a back-port of commit 5ab863d from the master branch.
2014-12-04 16:57:48 +03:00
Trevor Norris 0d051238be timers: fix unref() memory leak
The destructor isn't being called for timers that have been unref'd.

Fixes: https://github.com/joyent/node/issues/8364
Signed-off-by: Trevor Norris <trev.norris@gmail.com>
2014-11-26 12:27:57 -08:00
Sam Roberts 3a08b7c3e0 doc: cover stdio option in child_process
- Add hyperlinks from spawn options to subsections detailing what
those options do.
- Clarify some verbiage around ChildProcess.prototype.std{in,out,err}.
- Remove second-person pronoun.

PR-URL: https://github.com/joyent/node/pull/8639
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-11-18 19:28:46 -08:00
Trevor Norris a1b2875afd lint: fix lint issues
Forgot to fix these before landing the patch.

Fixes: e17c5a72
2014-11-18 16:42:10 -08:00
Julien Gilli caeb67735b domains: fix issues with abort on uncaught
Do not abort the process if an error is thrown from within a domain, an
error handler is setup for the domain and --abort-on-uncaught-exception
was passed on the command line.

However, if an error is thrown from within the top-level domain's error
handler and --abort-on-uncaught-exception was passed on the command
line, make the process abort.

Fixes: https://github.com/joyent/node/issues/8631
Fixes: https://github.com/joyent/node/issues/8630
PR-URL: https://github.com/joyent/node/pull/8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:39:39 -08:00
Trevor Norris fbff7054a4 v8: add api for aborting on uncaught exception
Add v8::Isolate::SetAbortOnUncaughtException() so the user can be
notified when an uncaught exception has bubbled.

PR-URL: https://github.com/joyent/node/pull/8666
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:37:54 -08:00
Sam Roberts 8032a21025 test: test all spawn parameter positions
PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:31 -08:00
Sam Roberts 70dafa7b62 child_process: check fork args is an array
Optional fork args should be type-checked with same behaviour as the
equivalent argument to spawn.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:21 -08:00
Sam Roberts e17c5a72b2 child_process: check execFile args is an array
execFile and spawn have same API signature with respect to optional arg
array and optional options object, they should have same behaviour with
respect to argument validation.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:20:06 -08:00
Sam Roberts 2ff29cc7e3 test: use assert.throw to test exceptions
The test wasn't checking directly that an assertion was thrown. Instead,
it was checking that spawn did not sucessfully spawn a non-existent
command.

However, the command chosen, dir, exists in GNU coreutils, so it exists
on Linux (though not on BSD derived OS X). The test as written passed on
Linux, even with the TypeError it is supposed to be checking for deleted
from spawn(). It would also pass on Windows if a ls.exe existed.

The approach is unnecessarily obscure, assert.throw() is for asserting
code throws, using it is more clear and works regardless of what
commands do or do not exist.

PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:19:52 -08:00
Sam Roberts 13a992b1c2 doc: document the fds behind stdin/out/err
Its common knowledge on unix, but node documentation depends on knowing
this, as it exposes both streams named after stdio, and the fd numbers,
so make this explicit.

Fixes: https://github.com/joyent/node/pull/8624
PR-URL: https://github.com/joyent/node/pull/8454
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-11-18 16:19:21 -08:00
Julien Gilli 5ff59453a4 doc: clarify dns.lookup vs dns.resolve
Clarify and emphasize the differences between dns.lookup and the rest of
the functions in the dns module.

PR-URL: https://github.com/joyent/node/pull/8726
Reviewed-by: Chris Dickinson <christopher.s.dickinson@gmail.com>
2014-11-14 12:33:34 -08:00
Eric Mill 88bd95cfef doc: update openssl commands to use best practices
This updates key size to 2048 and default hash function to sha256.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
PR-URL: https://github.com/joyent/node/pull/8690
2014-11-11 20:39:57 +03:00
Fedor Indutny d435f4b3eb Merge remote-tracking branch 'joyent/v0.10' into v0.10 2014-11-04 00:11:23 -05:00
Emmanuel Odeke 523929c927 repl: Private Buffer object in lib/* files
Fixes usage of global object 'Buffer' in lib/* files by ensuring that
each file does an explicit require('buffer').Buffer.  Previously, when
running a repl, due to usage of global 'Buffer', any redefinition of
Buffer would cause a crash eg var Buffer = {}.

Fixes: https://github.com/joyent/node/issues/8588
PR-URL: https://github.com/joyent/node/pull/8603
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-10-25 00:36:04 -07:00
Timothy J Fontaine ea69dd7584 Now working on 0.10.34 2014-10-23 12:13:05 -07:00
Timothy J Fontaine e59eca58ad Merge branch 'v0.10.33-release' into v0.10 2014-10-23 12:12:52 -07:00
Julien Gilli 8d045a30e9 tests: add TLS tests matrix
Add a test that goes through the whole matrix of:
- command line options (--enable-ssl*)
- secureOptions
- secureProtocols

and makes sure that compatible test setups actually work as expected.

The test works by spawning two processes for each test case: one client
and one server. The test passes if a SSL/TLS connection from the client
to the server is successful and the test case was supposed to pass, or
if the connection couldn't be established and the test case was supposed
to fail.

The test is currently located in the directory 'test/external' because
it has external dependencies.
2014-10-23 10:45:12 -07:00
Timothy J Fontaine 69080f5474 tls: enforce secureOptions on incoming clients
Reuse the secureProtocol and secureOptions of the server when creating
the secure context for incoming clients.
2014-10-23 10:45:04 -07:00
Timothy J Fontaine b9283cf9d1 tls: honorCipherOrder should not degrade defaults
Specifying honorCipherOrder should not change the SSLv2/SSLv3 defaults
for a TLS server.

Use secureOptions logic in both lib/tls.js and lib/crypto.js
2014-10-23 10:44:56 -07:00
Timothy J Fontaine fe2e8a4a24 2014.10.20, Version 0.10.33 (Stable)
* openssl: Update to 1.0.1j (Addressing multiple CVEs)

* uv: Update to v0.10.29

* child_process: properly support optional args (cjihrig)

* crypto: Disable autonegotiation for SSLv2/3 by default (Fedor Indutny,
Timothy J Fontaine, Alexis Campailla)

This is a behavior change, by default we will not allow the negotiation to
SSLv2 or SSLv3. If you want this behavior, run Node.js with either
`--enable-ssl2` or `--enable-ssl3` respectively.

This does not change the behavior for users specifically requesting
`SSLv2_method` or `SSLv3_method`. While this behavior is not advised, it is
assumed you know what you're doing since you're specifically asking to use
these methods.
2014-10-20 17:43:37 -07:00
Timothy J Fontaine 35443862a2 uv: Update to v0.10.29 2014-10-20 16:13:29 -07:00
Fedor Indutny 1349b680ba crypto: allow forcing SSLv2/v3 via secureProtocol
Force-enable SSLv2/v3 when `secureProtocol` is explicitly set
to `SSLv2_method` or `SSLv3_method`.

see discussion at #8551
2014-10-20 14:35:18 -07:00
Calvin Metcalf 7dbc024c85 doc: add note about key derivation
adds a note to the crypto docs passing along
the advice that openssl gives about what
key derivation function they recommend.

PR-URL: https://github.com/joyent/node/pull/8580
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-10-20 13:41:15 +04:00
Timothy J Fontaine 6c8593d456 crypto: move disaling SSLv2/3 into JavaScript 2014-10-17 15:16:26 -07:00
Timothy J Fontaine 226c98649d doc: clarify poodle mitigation 2014-10-17 15:15:45 -07:00
Timothy J Fontaine b259f245f8 docs: update api location 2014-10-17 15:14:45 -07:00
Alexis Campailla 3139fa20d7 crypto: extra caution in setting ssl options
Always set ssl2/ssl3 disabled based on whether they are enabled in Node.
In some corner-case scenario, node with OPENSSL_NO_SSL3 defined could
be linked to openssl that has SSL3 enabled.
2014-10-16 18:45:47 +02:00
Timothy J Fontaine 3859fbdb7d test: fix test-net-listen-fd0 for pipes
In the case of a pipe'd input, i.e. from the CI the fd will be a PIPE
and when listen() is called it will return ENOTSOCK instead of EINVAL.

Backport: cd2d3aedaa
2014-10-15 18:48:34 -07:00
Timothy J Fontaine 2afa3d8a03 test: crypto-domains avoid spurious failures
The order of the callbacks is non-deterministic, so don't expect the
error messages to come back in the same order every time, instead just
verify they are expected messages.
2014-10-15 18:36:36 -07:00
Timothy J Fontaine d601c76f4d crypto: allow runtime opt in using SSLv2/SSLv3
This change disables SSLv2/SSLv3 use by default, and introduces a
command line flag to opt into using SSLv2/SSLv3.

SSLv2 and SSLv3 are considered unsafe, and should only be used in
situations where compatibility with other components is required and
they cannot be upgrade to support newer forms of TLS.
2014-10-15 17:36:05 -07:00
Timothy J Fontaine c1f4aacc75 build: revert change to disable ssl2 and ssl3 2014-10-15 14:49:41 -07:00
Fedor Indutny 707cc25011 test: fix test-crypto-stream
Because of constant-timeness change made in openssl-1.0.1j the error is
no longer returned from EVP_DecryptFinal_ex. Now it just return 0, and
thus the error message does not contain proper error code. Adapt to this
change, there is not much that we could do about it.
2014-10-15 14:07:00 -07:00
Fedor Indutny e0e38c2f47 deps: update openssl to 1.0.1j 2014-10-15 14:06:03 -07:00
Fedor Indutny d6712917f5 doc: document why SSL2/SSL3 is disabled
PR-URL: https://github.com/joyent/node/pull/8551
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-10-15 19:39:56 +04:00
Fedor Indutny 0ec78c961b configure: disable ssl2/ssl3 by default
PR-URL: https://github.com/joyent/node/pull/8551
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
2014-10-15 19:39:40 +04:00
Swaagie 6a95e9f7e0 tls add secureOptions documentation
PR-URL: https://github.com/joyent/node/pull/8553
Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-10-15 13:19:54 +04:00
Matthew Fitzsimmons 1524d48333 doc: update design to match nodejs.org 2014-10-13 14:17:39 -07:00
Timothy J Fontaine 641cea0926 doc: build branch versioned docs 2014-10-13 14:17:39 -07:00
Timothy J Fontaine 2b7c8a2f02 test: check for multi-localhost support 2014-10-13 14:17:39 -07:00
Fedor Indutny d87ae24dfe hdr: always define NODE_WANT_INTERNALS
Otherwise the warning could be printed on some systems.

fix #8419
2014-09-26 10:31:10 +04:00
Calvin Metcalf c8e0bdd7cf doc: document _transform callback takes 2 args
Expands the paragraph in the transform stream
implementation docs about the callback that is passed
to the _transform method to include details about how
two arguments may be passed, error and data.  A code
example is also included.

Reviewed-By: Fedor Indutny <fedor@indutny.com>
2014-09-23 15:53:58 +04:00
cjihrig 542ac7f3d2 child_process: properly support optional args
Currently, a TypeError is incorrectly thrown if the second argument is
an object. This commit allows the args argument to be properly omitted.

Fixes: https://github.com/joyent/node/issues/6068
Reviewed-by: Trevor Norris <trev.norris@gmail.com>
2014-09-17 15:13:34 -07:00
Timothy J Fontaine 84952da241 Now working on 0.10.33 2014-09-16 16:53:10 -07:00
Timothy J Fontaine 1a8b0e807f Merge branch 'v0.10.32-release' into v0.10 2014-09-16 16:52:57 -07:00
Timothy J Fontaine 0fe0d12155 2014.09.16, Version 0.10.32 (Stable)
* npm: Update to 1.4.28

* v8: fix a crash introduced by previous release (Fedor Indutny)

* configure: add --openssl-no-asm flag (Fedor Indutny)

* crypto: use domains for any callback-taking method (Chris Dickinson)

* http: do not send `0rnrn` in TE HEAD responses (Fedor Indutny)

* querystring: fix unescape override (Tristan Berger)

* url: Add support for RFC 3490 separators (Mathias Bynens)
2014-09-16 15:47:52 -07:00
Timothy J Fontaine daca803e9e npm: Update to 1.4.28 2014-09-16 15:38:50 -07:00