Skip to content

Commit 0fefcc1

Browse files
committed
Merge remote-tracking branch ry/v0.10 into master
Conflicts: AUTHORS ChangeLog src/node_crypto.cc src/node_version.h
2 parents d820b64 + 3a2b503 commit 0fefcc1

8 files changed

Lines changed: 116 additions & 24 deletions

File tree

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,4 +452,6 @@ Kevin Locke <[email protected]>
452452
Daniel Moore <[email protected]>
453453
Robert Kowalski <[email protected]>
454454
Benoit Vallée <[email protected]>
455+
Ryuichi Okumura <[email protected]>
456+
Brandon Frohs <[email protected]>
455457
Nick Sullivan <[email protected]>

ChangeLog

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,19 @@
6060
* zlib: allow passing options to convenience methods (Kyle Robinson Young)
6161

6262

63+
2013.05.17, Version 0.10.7 (Stable), d2fdae197ac542f686ee06835d1153dd43b862e5
64+
65+
* uv: upgrade to v0.10.7
66+
67+
* npm: Upgrade to 1.2.21
68+
69+
* crypto: Don't ignore verify encoding argument (isaacs)
70+
71+
* buffer, crypto: fix default encoding regression (Ben Noordhuis)
72+
73+
* timers: fix setInterval() assert (Ben Noordhuis)
74+
75+
6376
2013.05.14, Version 0.10.6 (Stable), 5deb1672f2b5794f8be19498a425ea4dc0b0711f
6477

6578
* module: Deprecate require.extensions (isaacs)

doc/api/vm.markdown

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ JavaScript code can be compiled and run immediately or compiled, saved, and run
1313
## Caveats
1414

1515
The `vm` module has many known issues and edge cases. If you run into
16-
issues or unexpected behavior, please consult
17-
[the open issues on GitHub](https://github.com/joyent/node/issues/search?q=vm).
16+
issues or unexpected behavior, please consult [the open issues on
17+
GitHub](https://github.com/joyent/node/search?q=vm+state%3Aopen&type=Issues).
1818
Some of the biggest problems are described below.
1919

2020
### Sandboxes

doc/blog/release/v0.10.7.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
date: Fri May 17 14:36:03 PDT 2013
2+
version: 0.10.7
3+
category: release
4+
title: Node v0.10.7 (Stable)
5+
slug: node-v0-10-7-stable
6+
7+
2013.05.17, Version 0.10.7 (Stable)
8+
9+
* uv: upgrade to v0.10.7
10+
11+
* npm: Upgrade to 1.2.21
12+
13+
* crypto: Don't ignore verify encoding argument (isaacs)
14+
15+
* buffer, crypto: fix default encoding regression (Ben Noordhuis)
16+
17+
* timers: fix setInterval() assert (Ben Noordhuis)
18+
19+
20+
Source Code: http://nodejs.org/dist/v0.10.7/node-v0.10.7.tar.gz
21+
22+
Macintosh Installer (Universal): http://nodejs.org/dist/v0.10.7/node-v0.10.7.pkg
23+
24+
Windows Installer: http://nodejs.org/dist/v0.10.7/node-v0.10.7-x86.msi
25+
26+
Windows x64 Installer: http://nodejs.org/dist/v0.10.7/x64/node-v0.10.7-x64.msi
27+
28+
Windows x64 Files: http://nodejs.org/dist/v0.10.7/x64/
29+
30+
Linux 32-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-linux-x86.tar.gz
31+
32+
Linux 64-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-linux-x64.tar.gz
33+
34+
Solaris 32-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-sunos-x86.tar.gz
35+
36+
Solaris 64-bit Binary: http://nodejs.org/dist/v0.10.7/node-v0.10.7-sunos-x64.tar.gz
37+
38+
Other release files: http://nodejs.org/dist/v0.10.7/
39+
40+
Website: http://nodejs.org/docs/v0.10.7/
41+
42+
Documentation: http://nodejs.org/docs/v0.10.7/api/
43+
44+
Shasums:
45+
46+
```
47+
95d64001ccd5a17c2c25f1ae4b0358b6131e7cb8 node-v0.10.7-darwin-x64.tar.gz
48+
c34f991cc0752679002f763b2b3c8927babb08d8 node-v0.10.7-darwin-x86.tar.gz
49+
673c287bcf671eced6aa94637b7c91e5149f4c56 node-v0.10.7-linux-x64.tar.gz
50+
9f14d4f9add721148f0c15f093d3e6b1fa3820c9 node-v0.10.7-linux-x86.tar.gz
51+
1fb7dc4195a9dd228039f5f7ca2cb9f7c35b105a node-v0.10.7-sunos-x64.tar.gz
52+
d84cd8afb50df44483b9dab0c65d5c81f07ac4a2 node-v0.10.7-sunos-x86.tar.gz
53+
d7794a7da103d639fdec4b9e7236a5a0a4330297 node-v0.10.7-x86.msi
54+
0524ad9268095c9ed435708268e6aad7968309f7 node-v0.10.7.pkg
55+
f2bde505faf6ffed3084c8e550a9e6d4311f13d5 node-v0.10.7.tar.gz
56+
5f50384766dd5435dba4989d95032452754150bf node.exe
57+
809f12f84c8495d101ce6ae443890e8533695ab0 node.exp
58+
5a7355e2f75ae3f72deab75f4c9f93e4e5325584 node.lib
59+
6e45953bd7488a4236c43fea93b05da0854158a7 node.pdb
60+
fc5e3b2b1c74e53f1d214a9e2d5af30fe5247381 x64/node-v0.10.7-x64.msi
61+
aa67bbd421f26b37fa09ce30d5e626106677853e x64/node.exe
62+
b289989a156d4d7055554962e6f00ba3e380aeea x64/node.exp
63+
0dbecc5007c9e28ad488d2058157f8360eaed958 x64/node.lib
64+
e4b63472787a3db6a3d85237e8c7fb4d973f797b x64/node.pdb
65+
```

src/node_crypto.cc

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ namespace crypto {
6868

6969
using namespace v8;
7070

71+
// Forcibly clear OpenSSL's error stack on return. This stops stale errors
72+
// from popping up later in the lifecycle of crypto operations where they
73+
// would cause spurious failures. It's a rather blunt method, though.
74+
// ERR_clear_error() isn't necessarily cheap either.
75+
struct ClearErrorOnReturn {
76+
~ClearErrorOnReturn() { ERR_clear_error(); }
77+
};
78+
7179
static Persistent<String> errno_symbol;
7280
static Persistent<String> syscall_symbol;
7381
static Persistent<String> subject_symbol;
@@ -927,13 +935,6 @@ int Connection::HandleBIOError(BIO *bio, const char* func, int rv) {
927935

928936

929937
int Connection::HandleSSLError(const char* func, int rv, ZeroStatus zs) {
930-
// Forcibly clear OpenSSL's error stack on return. This stops stale errors
931-
// from popping up later in the lifecycle of the SSL connection where they
932-
// would cause spurious failures. It's a rather blunt method, though.
933-
// ERR_clear_error() isn't necessarily cheap either.
934-
struct ClearErrorOnReturn {
935-
~ClearErrorOnReturn() { ERR_clear_error(); }
936-
};
937938
ClearErrorOnReturn clear_error_on_return;
938939
(void) &clear_error_on_return; // Silence unused variable warning.
939940

@@ -2925,6 +2926,7 @@ Handle<Value> Verify::VerifyFinal(const Arguments& args) {
29252926

29262927
ssize_t hlen = StringBytes::Size(args[1], encoding);
29272928

2929+
29282930
// only copy if we need to, because it's a string.
29292931
unsigned char* hbuf;
29302932
if (args[1]->IsString()) {
@@ -3214,6 +3216,8 @@ Handle<Value> DiffieHellman::ComputeSecret(const Arguments& args) {
32143216
return ThrowError("Not initialized");
32153217
}
32163218

3219+
ClearErrorOnReturn clear_error_on_return;
3220+
(void) &clear_error_on_return; // Silence compiler warning.
32173221
BIGNUM* key = NULL;
32183222

32193223
if (args.Length() == 0) {

src/string_bytes.cc

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,15 @@ static inline size_t base64_decoded_size_fast(size_t size) {
6363
}
6464

6565
static inline size_t base64_decoded_size(const char* src, size_t size) {
66-
size = base64_decoded_size_fast(size);
66+
if (size == 0)
67+
return 0;
6768

68-
const char* end = src + size;
69-
// check for trailing padding (1 or 2 bytes)
70-
if (size > 0) {
71-
if (end[-1] == '=') size--;
72-
if (size > 0 && end[-2] == '=') size--;
73-
}
69+
if (src[size - 1] == '=')
70+
size--;
71+
if (size > 0 && src[size - 1] == '=')
72+
size--;
7473

75-
return size;
74+
return base64_decoded_size_fast(size);
7675
}
7776

7877

@@ -551,8 +550,7 @@ Local<Value> StringBytes::Encode(const char* buf,
551550
Local<String> val;
552551
switch (encoding) {
553552
case BUFFER:
554-
return scope.Close(
555-
Buffer::New(static_cast<const char*>(buf), buflen)->handle_);
553+
return scope.Close(Buffer::New(buf, buflen)->handle_);
556554

557555
case ASCII:
558556
if (contains_non_ascii(buf, buflen)) {

test/simple/test-buffer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,10 @@ assert.throws(function() {
971971
}
972972
})();
973973

974+
// Make sure byteLength properly checks for base64 padding
975+
assert.equal(Buffer.byteLength('aaa=', 'base64'), 2);
976+
assert.equal(Buffer.byteLength('aaaa==', 'base64'), 3);
977+
974978
// Regression test for #5482: should throw but not assert in C++ land.
975979
assert.throws(function() {
976980
Buffer('', 'buffer');

test/simple/test-crypto.js

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,10 +698,21 @@ var secret3 = dh3.computeSecret(key2, 'hex', 'base64');
698698

699699
assert.equal(secret1, secret3);
700700

701+
// Run this one twice to make sure that the dh3 clears its error properly
702+
(function() {
703+
var c = crypto.createDecipher('aes-128-ecb', '');
704+
assert.throws(function() { c.final('utf8') }, /wrong final block length/);
705+
})();
706+
701707
assert.throws(function() {
702708
dh3.computeSecret('');
703709
}, /key is too small/i);
704710

711+
(function() {
712+
var c = crypto.createDecipher('aes-128-ecb', '');
713+
assert.throws(function() { c.final('utf8') }, /wrong final block length/);
714+
})();
715+
705716
// Create a shared using a DH group.
706717
var alice = crypto.createDiffieHellmanGroup('modp5');
707718
var bob = crypto.createDiffieHellmanGroup('modp5');
@@ -858,11 +869,6 @@ assert.equal(-1, crypto.getHashes().indexOf('SHA1'));
858869
assert.equal(-1, crypto.getHashes().indexOf('SHA'));
859870
assertSorted(crypto.getHashes());
860871

861-
(function() {
862-
var c = crypto.createDecipher('aes-128-ecb', '');
863-
assert.throws(function() { c.final('utf8') }, /invalid public key/);
864-
})();
865-
866872
// Base64 padding regression test, see #4837.
867873
(function() {
868874
var c = crypto.createCipher('aes-256-cbc', 'secret');

0 commit comments

Comments
 (0)