Browse Source

Merge remote-tracking branch ry/v0.10 into master

Conflicts:
	AUTHORS
	ChangeLog
	src/node_crypto.cc
	src/node_version.h
v0.11.3-release
isaacs 12 years ago
parent
commit
0fefcc1690
  1. 2
      AUTHORS
  2. 13
      ChangeLog
  3. 4
      doc/api/vm.markdown
  4. 65
      doc/blog/release/v0.10.7.md
  5. 18
      src/node_crypto.cc
  6. 18
      src/string_bytes.cc
  7. 4
      test/simple/test-buffer.js
  8. 16
      test/simple/test-crypto.js

2
AUTHORS

@ -452,4 +452,6 @@ Kevin Locke <kevin@kevinlocke.name>
Daniel Moore <polaris@northhorizon.net> Daniel Moore <polaris@northhorizon.net>
Robert Kowalski <rok@kowalski.gd> Robert Kowalski <rok@kowalski.gd>
Benoit Vallée <github@benoitvallee.net> Benoit Vallée <github@benoitvallee.net>
Ryuichi Okumura <okuryu@okuryu.com>
Brandon Frohs <bfrohs@gmail.com>
Nick Sullivan <nick@sullivanflock.com> Nick Sullivan <nick@sullivanflock.com>

13
ChangeLog

@ -60,6 +60,19 @@
* zlib: allow passing options to convenience methods (Kyle Robinson Young) * zlib: allow passing options to convenience methods (Kyle Robinson Young)
2013.05.17, Version 0.10.7 (Stable), d2fdae197ac542f686ee06835d1153dd43b862e5
* uv: upgrade to v0.10.7
* npm: Upgrade to 1.2.21
* crypto: Don't ignore verify encoding argument (isaacs)
* buffer, crypto: fix default encoding regression (Ben Noordhuis)
* timers: fix setInterval() assert (Ben Noordhuis)
2013.05.14, Version 0.10.6 (Stable), 5deb1672f2b5794f8be19498a425ea4dc0b0711f 2013.05.14, Version 0.10.6 (Stable), 5deb1672f2b5794f8be19498a425ea4dc0b0711f
* module: Deprecate require.extensions (isaacs) * module: Deprecate require.extensions (isaacs)

4
doc/api/vm.markdown

@ -13,8 +13,8 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run
## Caveats ## Caveats
The `vm` module has many known issues and edge cases. If you run into The `vm` module has many known issues and edge cases. If you run into
issues or unexpected behavior, please consult issues or unexpected behavior, please consult [the open issues on
[the open issues on GitHub](https://github.com/joyent/node/issues/search?q=vm). GitHub](https://github.com/joyent/node/search?q=vm+state%3Aopen&type=Issues).
Some of the biggest problems are described below. Some of the biggest problems are described below.
### Sandboxes ### Sandboxes

65
doc/blog/release/v0.10.7.md

@ -0,0 +1,65 @@
date: Fri May 17 14:36:03 PDT 2013
version: 0.10.7
category: release
title: Node v0.10.7 (Stable)
slug: node-v0-10-7-stable
2013.05.17, Version 0.10.7 (Stable)
* uv: upgrade to v0.10.7
* npm: Upgrade to 1.2.21
* crypto: Don't ignore verify encoding argument (isaacs)
* buffer, crypto: fix default encoding regression (Ben Noordhuis)
* timers: fix setInterval() assert (Ben Noordhuis)
Source Code: http://nodejs.org/dist/v0.10.7/node-v0.10.7.tar.gz
Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.7/node-v0.10.7.pkg
Windows Installer: http://nodejs.org/dist/v0.10.7/node-v0.10.7-x86.msi
Windows x64 Installer: http://nodejs.org/dist/v0.10.7/x64/node-v0.10.7-x64.msi
Windows x64 Files: http://nodejs.org/dist/v0.10.7/x64/
Linux 32-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-linux-x86.tar.gz
Linux 64-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-linux-x64.tar.gz
Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-sunos-x86.tar.gz
Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-sunos-x64.tar.gz
Other release files: http://nodejs.org/dist/v0.10.7/
Website: http://nodejs.org/docs/v0.10.7/
Documentation: http://nodejs.org/docs/v0.10.7/api/
Shasums:
```
95d64001ccd5a17c2c25f1ae4b0358b6131e7cb8 node-v0.10.7-darwin-x64.tar.gz
c34f991cc0752679002f763b2b3c8927babb08d8 node-v0.10.7-darwin-x86.tar.gz
673c287bcf671eced6aa94637b7c91e5149f4c56 node-v0.10.7-linux-x64.tar.gz
9f14d4f9add721148f0c15f093d3e6b1fa3820c9 node-v0.10.7-linux-x86.tar.gz
1fb7dc4195a9dd228039f5f7ca2cb9f7c35b105a node-v0.10.7-sunos-x64.tar.gz
d84cd8afb50df44483b9dab0c65d5c81f07ac4a2 node-v0.10.7-sunos-x86.tar.gz
d7794a7da103d639fdec4b9e7236a5a0a4330297 node-v0.10.7-x86.msi
0524ad9268095c9ed435708268e6aad7968309f7 node-v0.10.7.pkg
f2bde505faf6ffed3084c8e550a9e6d4311f13d5 node-v0.10.7.tar.gz
5f50384766dd5435dba4989d95032452754150bf node.exe
809f12f84c8495d101ce6ae443890e8533695ab0 node.exp
5a7355e2f75ae3f72deab75f4c9f93e4e5325584 node.lib
6e45953bd7488a4236c43fea93b05da0854158a7 node.pdb
fc5e3b2b1c74e53f1d214a9e2d5af30fe5247381 x64/node-v0.10.7-x64.msi
aa67bbd421f26b37fa09ce30d5e626106677853e x64/node.exe
b289989a156d4d7055554962e6f00ba3e380aeea x64/node.exp
0dbecc5007c9e28ad488d2058157f8360eaed958 x64/node.lib
e4b63472787a3db6a3d85237e8c7fb4d973f797b x64/node.pdb
```

18
src/node_crypto.cc

@ -68,6 +68,14 @@ namespace crypto {
using namespace v8; using namespace v8;
// Forcibly clear OpenSSL's error stack on return. This stops stale errors
// from popping up later in the lifecycle of crypto operations where they
// would cause spurious failures. It's a rather blunt method, though.
// ERR_clear_error() isn't necessarily cheap either.
struct ClearErrorOnReturn {
~ClearErrorOnReturn() { ERR_clear_error(); }
};
static Persistent<String> errno_symbol; static Persistent<String> errno_symbol;
static Persistent<String> syscall_symbol; static Persistent<String> syscall_symbol;
static Persistent<String> subject_symbol; static Persistent<String> subject_symbol;
@ -927,13 +935,6 @@ int Connection::HandleBIOError(BIO *bio, const char* func, int rv) {
int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) { int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) {
// Forcibly clear OpenSSL's error stack on return. This stops stale errors
// from popping up later in the lifecycle of the SSL connection where they
// would cause spurious failures. It's a rather blunt method, though.
// ERR_clear_error() isn't necessarily cheap either.
struct ClearErrorOnReturn {
~ClearErrorOnReturn() { ERR_clear_error(); }
};
ClearErrorOnReturn clear_error_on_return; ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence unused variable warning. (void) &clear_error_on_return; // Silence unused variable warning.
@ -2925,6 +2926,7 @@ Handle<Value> Verify::VerifyFinal(const Arguments& args) {
ssize_t hlen = StringBytes::Size(args[1], encoding); ssize_t hlen = StringBytes::Size(args[1], encoding);
// only copy if we need to, because it's a string. // only copy if we need to, because it's a string.
unsigned char* hbuf; unsigned char* hbuf;
if (args[1]->IsString()) { if (args[1]->IsString()) {
@ -3214,6 +3216,8 @@ Handle<Value> DiffieHellman::ComputeSecret(const Arguments& args) {
return ThrowError("Not initialized"); return ThrowError("Not initialized");
} }
ClearErrorOnReturn clear_error_on_return;
(void) &clear_error_on_return; // Silence compiler warning.
BIGNUM* key = NULL; BIGNUM* key = NULL;
if (args.Length() == 0) { if (args.Length() == 0) {

18
src/string_bytes.cc

@ -63,16 +63,15 @@ static inline size_t base64_decoded_size_fast(size_t size) {
} }
static inline size_t base64_decoded_size(const char* src, size_t size) { static inline size_t base64_decoded_size(const char* src, size_t size) {
size = base64_decoded_size_fast(size); if (size == 0)
return 0;
const char* end = src + size; if (src[size - 1] == '=')
// check for trailing padding (1 or 2 bytes) size--;
if (size > 0) { if (size > 0 && src[size - 1] == '=')
if (end[-1] == '=') size--; size--;
if (size > 0 && end[-2] == '=') size--;
}
return size; return base64_decoded_size_fast(size);
} }
@ -551,8 +550,7 @@ Local<Value> StringBytes::Encode(const char* buf,
Local<String> val; Local<String> val;
switch (encoding) { switch (encoding) {
case BUFFER: case BUFFER:
return scope.Close( return scope.Close(Buffer::New(buf, buflen)->handle_);
Buffer::New(static_cast<const char*>(buf), buflen)->handle_);
case ASCII: case ASCII:
if (contains_non_ascii(buf, buflen)) { if (contains_non_ascii(buf, buflen)) {

4
test/simple/test-buffer.js

@ -971,6 +971,10 @@ assert.throws(function() {
} }
})(); })();
// Make sure byteLength properly checks for base64 padding
assert.equal(Buffer.byteLength('aaa=', 'base64'), 2);
assert.equal(Buffer.byteLength('aaaa==', 'base64'), 3);
// Regression test for #5482: should throw but not assert in C++ land. // Regression test for #5482: should throw but not assert in C++ land.
assert.throws(function() { assert.throws(function() {
Buffer('', 'buffer'); Buffer('', 'buffer');

16
test/simple/test-crypto.js

@ -698,10 +698,21 @@ var secret3 = dh3.computeSecret(key2, 'hex', 'base64');
assert.equal(secret1, secret3); assert.equal(secret1, secret3);
// Run this one twice to make sure that the dh3 clears its error properly
(function() {
var c = crypto.createDecipher('aes-128-ecb', '');
assert.throws(function() { c.final('utf8') }, /wrong final block length/);
})();
assert.throws(function() { assert.throws(function() {
dh3.computeSecret(''); dh3.computeSecret('');
}, /key is too small/i); }, /key is too small/i);
(function() {
var c = crypto.createDecipher('aes-128-ecb', '');
assert.throws(function() { c.final('utf8') }, /wrong final block length/);
})();
// Create a shared using a DH group. // Create a shared using a DH group.
var alice = crypto.createDiffieHellmanGroup('modp5'); var alice = crypto.createDiffieHellmanGroup('modp5');
var bob = crypto.createDiffieHellmanGroup('modp5'); var bob = crypto.createDiffieHellmanGroup('modp5');
@ -858,11 +869,6 @@ assert.equal(-1, crypto.getHashes().indexOf('SHA1'));
assert.equal(-1, crypto.getHashes().indexOf('SHA')); assert.equal(-1, crypto.getHashes().indexOf('SHA'));
assertSorted(crypto.getHashes()); assertSorted(crypto.getHashes());
(function() {
var c = crypto.createDecipher('aes-128-ecb', '');
assert.throws(function() { c.final('utf8') }, /invalid public key/);
})();
// Base64 padding regression test, see #4837. // Base64 padding regression test, see #4837.
(function() { (function() {
var c = crypto.createCipher('aes-256-cbc', 'secret'); var c = crypto.createCipher('aes-256-cbc', 'secret');

Loading…
Cancel
Save