Commit Graph

7156 Commits (ee77a6a953c65ff1fddf4017496387c42dd84d63)

Author SHA1 Message Date
Bert Belder 709e935239 openssl: use dummy OPENSSL_cpuid_setup function
Use a empty implementation for function OPENSSL_cpuid_setup to resolve link
error. We should figure out how to geenrate platform specific implementation
of OPENSSL_cpuid_setup by leveraging crypto/*cpuid.pl.

This patch is taken from Chromium.
2012-09-12 05:23:58 +02:00
Bert Belder 9fc84fdad9 openssl: don't read user input from the TTY 2012-09-12 05:23:56 +02:00
Ben Noordhuis 988a164cd8 openssl: fix uninitialized memory access
ASN1_STRING_to_UTF8() passes an ASN1_STRING to ASN1_STRING_set() but
forgot to initialize the `length` field.

Fixes the following valgrind error:

  $ valgrind -q --track-origins=yes --num-callers=19 \
      out/Debug/node test/simple/test-tls-client-abort.js
  ==2690== Conditional jump or move depends on uninitialised value(s)
  ==2690==    at 0x784B69: ASN1_STRING_set (asn1_lib.c:382)
  ==2690==    by 0x809564: ASN1_mbstring_ncopy (a_mbstr.c:204)
  ==2690==    by 0x8090F0: ASN1_mbstring_copy (a_mbstr.c:86)
  ==2690==    by 0x782F1F: ASN1_STRING_to_UTF8 (a_strex.c:570)
  ==2690==    by 0x78F090: asn1_string_canon (x_name.c:409)
  ==2690==    by 0x78EF17: x509_name_canon (x_name.c:354)
  ==2690==    by 0x78EA7D: x509_name_ex_d2i (x_name.c:210)
  ==2690==    by 0x788058: ASN1_item_ex_d2i (tasn_dec.c:239)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x7890D4: asn1_template_noexp_d2i (tasn_dec.c:746)
  ==2690==    by 0x788CB6: asn1_template_ex_d2i (tasn_dec.c:607)
  ==2690==    by 0x78877A: ASN1_item_ex_d2i (tasn_dec.c:448)
  ==2690==    by 0x787C93: ASN1_item_d2i (tasn_dec.c:136)
  ==2690==    by 0x78F5E4: d2i_X509 (x_x509.c:141)
  ==2690==    by 0x7C9B91: PEM_ASN1_read_bio (pem_oth.c:81)
  ==2690==    by 0x7CA506: PEM_read_bio_X509 (pem_x509.c:67)
  ==2690==    by 0x703C9A: node::crypto::SecureContext::AddRootCerts(v8::Arguments const&) (node_crypto.cc:497)
  ==2690==  Uninitialised value was created by a stack allocation
  ==2690==    at 0x782E89: ASN1_STRING_to_UTF8 (a_strex.c:560)
2012-09-12 05:23:54 +02:00
Bert Belder c23ac14cba openssl: backward compatibility after x509 hash function change
There are many symbolic links under /etc/ssl/certs created by using hash of
the pem certificates in order for OpenSSL to find those certificate.
Openssl has a tool to help you create hash symbolic links. (See tools/c_rehash)
However the new openssl changed the hash algorithm, Unless you compile/install
the latest openssl library and re-create all related symbolic links, the new
openssl can not find some certificates because the links of those certificates
were created by using old hash algorithm, which causes some tests failed.

This patch gives a way to find a certificate according to its hash by using both
new algorithm and old algorithm.

crbug.com/111045 is used to track this issue.

This patch is taken from the Chromium project.
2012-09-12 05:23:52 +02:00
Ben Noordhuis 2fad7a8c1b openssl: apply upstream sha1-armv4-large.pl patch
This is a back-port of r22768: sha1-armv4-large.pl: comply with ABI.
2012-09-12 05:23:51 +02:00
Bert Belder 1d9b4ace8a openssl: support handshake cut-through
Enables SSL3+ clients to send application data immediately following the
Finished message even when negotiating full-handshakes.  With this patch,
clients can negotiate SSL connections in 1-RTT even when performing
full-handshakes.

This patch is taken from the Android Open Source Project.
2012-09-12 05:23:49 +02:00
Bert Belder ff22a0cb15 openssl: reduce memory consumption
SSL records may be as large as 16K, but are typically < 2K.  In
addition, a historic bug in Windows allowed records to be as large
32K.  OpenSSL statically allocates read and write buffers (34K and
18K respectively) used for processing records.

With this patch, OpenSSL statically allocates 4K + 4K buffers, with
the option of dynamically growing buffers to 34K + 4K, which is a
saving of 44K per connection for the typical case.

This patch is taken from the Android Open Source Project.
2012-09-12 05:23:47 +02:00
Ben Noordhuis 4870a4e3da doc: http: expand request.headers documentation 2012-09-12 02:46:53 +02:00
Bert Belder b61ae54e18 openssl: upgrade to vanilla openssl 1.0.1c 2012-09-12 00:40:55 +02:00
isaacs 362189a5d3 Now working on 0.8.10 2012-09-11 11:59:37 -07:00
isaacs d80de98e91 blog: Post for 0.8.9 2012-09-11 11:59:10 -07:00
isaacs 72d3124841 Merge branch 'v0.8.9-release' into v0.8 2012-09-11 11:58:35 -07:00
isaacs b88c3902b2 2012.09.11, Version 0.8.9 (Stable)
* v8: upgrade to 3.11.10.22

* GYP: upgrade to r1477

* npm: Upgrade to 1.1.61

* npm: Don't create world-writable files (isaacs)

* windows: fix single-accept mode for shared server sockets (Bert Belder)

* windows: fix uninitialized memory access in uv_update_time() (Bert Belder)

* windows: don't throw when a signal handler is attached (Bert Belder)

* unix: fix memory leak in udp (Ben Noordhuis)

* unix: map errno ESPIPE (Ben Noordhuis)

* unix, windows: fix memory corruption in fs-poll.c (Ben Noordhuis)

* sunos: fix os.cpus() on x86_64 (Ben Noordhuis)

* child process: fix processes with IPC channel don't emit 'close' (Bert Belder)

* build: add a "--dest-os" option to force a gyp "flavor" (Nathan Rajlich)

* build: set `process.platform` to "sunos" on SunOS (Nathan Rajlich)

* build: fix `make -j` fails after `make clean` (Bearice Ren)

* build: fix openssl configuration for "arm" builds (Nathan Rajlich)

* tls: support unix domain socket/named pipe in tls.connect (Shigeki Ohtsu)

* https: make https.get() accept a URL (koichik)

* http: respect HTTP/1.0 TE header (Ben Noordhuis)

* crypto, tls: Domainify setSNICallback, pbkdf2, randomBytes (Ben Noordhuis)

* stream.pipe: Don't call destroy() unless it's a function (isaacs)
2012-09-11 11:08:07 -07:00
isaacs 1c2982b94f Update doc and test for sunos/solaris switch 2012-09-11 10:57:25 -07:00
Ben Noordhuis c8c638a841 buffer: change prototype of Data() and Length()
Make Buffer:Data() and Buffer::Length() accept a Value instead of an Object.
2012-09-11 18:33:30 +02:00
isaacs 6e0b8b169c doc: Fork me image should be full url 2012-09-11 08:45:25 -07:00
isaacs e35cec5c05 doc: Put current version on homepage 2012-09-11 08:43:31 -07:00
isaacs 005ae23250 doc: Add Node Dublin to community page 2012-09-11 08:43:28 -07:00
Ben Noordhuis eaf1343100 crypto: remove legacy openssl compatibility code
Remove code that works around a padding bug in older versions of openssl, the
bundled version of openssl contains the bug fix.
2012-09-11 15:42:04 +02:00
Ben Noordhuis 98d53ac51e test: add AES-256 padding crypto test 2012-09-11 15:40:39 +02:00
isaacs 41e1b171ec stream.pipe: Don't call destroy() unless it's a function 2012-09-10 16:00:27 -07:00
isaacs 54a4c639e9 npm: Upgrade to 1.1.61 2012-09-10 09:11:54 -07:00
Ben Noordhuis 5d9968f53d installer: don't install header files
They are no longer necessary now that node-waf has been removed. People need to
switch to node-gyp.
2012-09-10 01:31:13 +02:00
Nathan Rajlich 608898c15b configure: add a "--dest-os" option to force a gyp "flavor"
This makes cross-compiling easier. i.e. from my mac:

    ./configure --dest-cpu=arm --dest-os=linux
2012-09-09 11:41:05 -07:00
Nathan Rajlich dba47aefa5 docs: fix typo in Buffer#toJSON() docs 2012-09-09 11:15:45 -07:00
Nathan Rajlich a4ef01df07 buffer: implement Buffer.prototype.toJSON()
Returns an Array-representation of the Buffer.
Closes #3905.
2012-09-09 11:04:16 -07:00
Nathan Rajlich fb383a0ad0 util: make util.inspect() work when "hasOwnProperty" is overwritten 2012-09-08 15:09:59 -07:00
Ben Noordhuis 9a3521cb25 http: respect HTTP/1.0 TE header
A HTTP/1.0 client does not support 'Transfer-Encoding: chunked' unless it
explicitly requests it by sending a 'TE: chunked' header.

Before this commit, node.js always disabled chunked encoding for HTTP/1.0
clients. Now it will scan for the TE header and turn on chunked encoding if
requested and applicable.

Fixes #940.
2012-09-08 21:43:57 +02:00
Pooya Karimian 0087bc6370 cluster.worker description and examples ere missing from the top level of docs 2012-09-06 22:00:05 +02:00
Fedor Indutny 052e63f27f v8: fix semaphore on MacOS
Landed upstream: https://chromiumcodereview.appspot.com/10867009/
2012-09-06 16:07:40 +02:00
Bert Belder c5e554dc7e v8: reapply floating patches 2012-09-06 15:58:37 +02:00
Bert Belder 4899116d4b v8: upgrade to 3.11.10.22 2012-09-06 15:58:09 +02:00
Fedor Indutny 8e0c830cd0 tls: async session storage 2012-09-05 02:01:54 +04:00
Ben Noordhuis 790d651f0d http: make http.ServerResponse emit 'end'
This used to be the internal 'finish' event. Make it public so API users will
know when the response has been sent completely.

Fixes #3855.
2012-09-04 22:07:48 +02:00
Bert Belder 6174ea6b4c doc: don't use &apos;
Ref: #3964
2012-09-04 21:15:39 +02:00
Ben Noordhuis 7b6d3cea2c build: add ninja support to Makefile 2012-09-04 16:04:01 +02:00
Timothy J Fontaine d3135e0f57 build: add configure option to build with ninja 2012-09-04 16:04:01 +02:00
Ben Noordhuis 2efa3ae64f installer: reapply b21c8e0b, honor --without-npm
This bug was already fixed in the v0.8 branch but git skips the patch when
merging v0.8 into master. Reapply it manually.

Fixes #3961.
2012-09-04 15:08:32 +02:00
Ben Noordhuis 972cdf82f1 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/uv/include/uv.h
	src/node_crypto.cc
2012-09-04 15:02:20 +02:00
Ben Noordhuis 19a432260c test: add extra checks in simple/test-cli-eval 2012-09-04 14:41:08 +02:00
Ben Noordhuis 83b1dda12f cli: make argument to -p optional 2012-09-04 14:39:31 +02:00
Atsuya Takagi 9f57e422cf doc: fix typo in api/cluster 2012-09-04 00:41:40 +02:00
Ben Noordhuis 7dfa587d18 crypto, tls: make setSNICallback() compatible with domains 2012-09-03 23:33:02 +02:00
Ben Noordhuis 7d0543c128 crypto: make pbkdf2() compatible with domains 2012-09-03 23:33:02 +02:00
Ben Noordhuis d1eff9ab68 crypto: make randomBytes() compatible with domains
Don't execute the callback in the context of the global object.

MakeCallback() tries to apply the active domain to the callback. If the user
polluted the global object with a 'domain' property, as in the code example
below, MakeCallback() will try to apply that.

Example:

    domain = {};                // missing var keyword is intentional
    crypto.randomBytes(8, cb);  // TypeError: undefined is not a function

Fixes #3956.
2012-09-03 23:33:02 +02:00
Bert Belder ea1cba6246 windows: don't blow when a signal handler is attached
Blowing up when the user attaches a signal handler makes no sense. Also,
in Node 0.10 signals will be supported, so allow people to get used to
it.
2012-09-03 19:05:40 +02:00
Ben Noordhuis f03c3203a1 cli: make -p equivalent to -pe
Fixes #3938.
2012-09-03 16:42:20 +02:00
koichik 7f404e3509 buffer: added support for writing NaN and Infinity
to writeDoubleBE(), writeDoubleLE(), writeFloatBE() and writeFloatLE().
Fixes #3934.
2012-09-02 21:01:43 +09:00
koichik 37f0eb8df3 Revert "buffer: added support for writing NaN and Infinity"
This reverts commit 6b9425fe37.
2012-09-02 20:59:50 +09:00
Ben Noordhuis 870307de75 crypto: fix build error on OS X
pthread_t is a pointer type on OS X but an unsigned long on most other
platforms. Use a C style cast because reinterpret_cast nor static_cast
work in all cases.
2012-09-02 13:49:15 +02:00