Commit Graph

75 Commits (17fbdc18b8cec0b6b2827d9e3c6360b694e6e9c3)

Author SHA1 Message Date
Fedor Indutny d6fd118727 deps: update openssl to 1.0.1g 2014-04-08 00:58:37 +04:00
Andrei Sedoi 884b25356f openssl: add missing configuration pieces for MIPS 2013-06-13 13:27:58 +02:00
Ben Noordhuis 2cf7e5de6f Revert "deps: downgrade openssl to v1.0.0f"
After much investigation it turns out that the affected servers are
buggy.  user-service.condenastdigital.com:443 in particular seems to
reject large TLS handshake records. Cutting down the number of
advertised ciphers or disabling SNI fixes the issue.

Similarly, passing { secureOptions: constants.SSL_OP_NO_TLSv1_2 }
seems to fix most connection issues with IIS servers.

Having to work around buggy servers is annoying for our users but not
a reason to downgrade OpenSSL. Therefore, revert it.

This reverts commit 4fdb8acdae.
2013-05-01 16:45:31 +02:00
Ben Noordhuis 4fdb8acdae deps: downgrade openssl to v1.0.0f
Several people have reported issues with IIS and Resin servers (or maybe
SSL terminators sitting in front of those servers) that are fixed by
downgrading OpenSSL. The AESNI performance improvements were nice but
stability is more important. Downgrade OpenSSL from 1.0.1e to 1.0.0f.

Fixes #5360 (and others).
2013-04-29 12:12:33 +02:00
Fedor Indutny 28c6e42ee7 openssl: disable HEARTBEAT TLS extension
Microsoft's IIS doesn't support it, and is not replying with ServerHello
after receiving ClientHello which contains it.

The good way might be allowing to opt-out this at runtime from
javascript-land, but unfortunately OpenSSL doesn't support it right now.

see #5119
2013-03-27 11:41:23 +04:00
Ben Noordhuis 690a8cce41 deps: fix openssl build on windows
Commit 8632af3 ("tools: update gyp to r1601") broke the Windows build.

Older versions of GYP link to kernel32.lib, user32.lib, etc. but that
was changed in r1584. See https://codereview.chromium.org/12256017

Fix the build by explicitly linking to the required libraries.
2013-03-24 22:53:11 +01:00
Bert Belder 01fa5ee21d win/openssl: mark assembled object files as seh safe
There are no unsafe structured exception handlers in object files
generated from hand-crafted assembly - because they contain no exception
handlers at all.
2013-03-05 19:39:45 +01:00
Scott Blomquist f054fec535 openssl: regenerate asm files for openssl 1.0.1e 2013-02-26 22:56:54 -08:00
Andrei Sedoi 17c6fe2e22 mips: fix openssl build 2013-02-26 17:03:07 +01:00
Ben Noordhuis 0dcbecd32b crypto: fix uninitialized memory access in openssl
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)
2013-02-20 17:01:47 +04:00
Bert Belder da945a7376 openssl: make perlasm target pentium or newer for masm outputs
When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble a couple of instructions. Bumping
the target to 686 solves this problem.
2013-02-20 17:00:29 +04:00
Bert Belder eb29c4b2e6 openssl: disable HT sidechannel attack mitigation
It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.
2013-02-20 16:49:03 +04:00
Fedor Indutny f317f5aee9 openssl: update to 1.0.1e 2013-02-20 16:48:20 +04:00
Ben Noordhuis 6ecb0cd65d openssl: clean up openssl.gyp
Remove obsolete build configuration that escaped the purge in 7eaea7f.
2012-12-24 16:02:13 +01:00
Bert Belder 7475982801 openssl: enable optimized asm code on x86 and x64 2012-12-20 15:02:59 +01:00
Bert Belder 5edbb53c45 openssl: regenerate asm files for openssl 1.0.1 2012-12-20 15:02:59 +01:00
Bert Belder 1b5c5b137d openssl: update makefile for asm files to work with openssl 1.0.1 2012-12-20 15:02:58 +01:00
Bert Belder 1d97db5acf openssl: disable HT sidechannel attack mitigation
It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.
2012-12-20 15:02:57 +01:00
Bert Belder aeae22cbb2 openssl: revert empty_OPENSSL_cpuid_setup.patch 2012-12-20 15:02:57 +01:00
Bert Belder 2e6180a62a openssl: make perlasm target pentium or newer for masm outputs
When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble a couple of instructions. Bumping
the target to 686 solves this problem.
2012-12-20 15:02:56 +01:00
Bert Belder 7eaea7f9e5 openssl: clean up and merge configuration files
This patch brings the openssl library that is built with gyp closer
to what the standard build system produces.

All opensslconf.h versions are now merged into a single file, which
makes it easier for compiled addons to locate this file.
2012-12-20 15:02:56 +01:00
isaacs 77ed12fe7a Merge remote-tracking branch 'ry/v0.8' into master
Conflicts:
	AUTHORS
	ChangeLog
	deps/uv/test/test-spawn.c
	deps/uv/uv.gyp
	src/cares_wrap.cc
	src/node.cc
	src/node_version.h
	test/simple/test-buffer.js
	tools/gyp/pylib/gyp/common.py
	tools/install.py
2012-12-13 16:57:58 -08:00
Ben Noordhuis f8999da514 build: avoid -Wno-old-style-declaration with gcc 4.2
Fixes the build on FreeBSD <= 9 with the default compiler.

Fixes #4186.
2012-12-03 02:21:32 +01:00
Bert Belder 9b22944b68 windows: fix the x64 debug build 2012-11-08 23:54:53 +01:00
Ben Noordhuis d0227b0308 Merge remote-tracking branch 'origin/v0.8'
Conflicts:
	deps/openssl/openssl.gyp
2012-10-21 23:06:48 +02:00
Ben Noordhuis 28b0cc08b8 Revert "Disable OpenSSL UI"
This reverts commit 1c88c3b3b5.

It breaks the "read a password from stdin" functionality that OpenSSL provides.

Fixes #4059, #4143.

Conflicts:

	deps/openssl/openssl.gyp
2012-10-15 23:40:15 +02:00
isaacs ae40f1c438 Merge remote-tracking branch 'ry/v0.8' into v0.8-merge
Conflicts:
	AUTHORS
	ChangeLog
	deps/openssl/openssl.gyp
	deps/uv/src/unix/linux/linux-core.c
	deps/uv/src/unix/process.c
	deps/uv/src/unix/stream.c
	deps/v8/src/arm/builtins-arm.cc
	deps/v8/src/arm/code-stubs-arm.cc
	deps/v8/src/arm/full-codegen-arm.cc
	lib/tls.js
	src/node_version.h
	test/simple/test-http-client-timeout-agent.js
2012-09-28 09:47:48 -07:00
Bert Belder d05d6a35b6 openssl: fix compilation issues on SmartOS x64
the SunOS linker is more strict than usual, so we have to be more
correct.
2012-09-25 13:48:14 -07:00
Bert Belder e0e9f0c15a openssl: use optimized asm code on x86 and x64 2012-09-25 08:51:05 -07:00
Bert Belder 823e807b5b openssl: add generated asm code 2012-09-25 08:51:04 -07:00
Bert Belder 62c3879cfa openssl: add 'clean' target to asm Makefile 2012-09-25 08:51:04 -07:00
Ben Noordhuis 202ecbc9c7 openssl: generate asm code with a Makefile 2012-09-25 08:51:04 -07:00
Bert Belder 66638a4435 openssl: disable HT sidechannel attack mitigation
It used to be off before. It's extremely unlikely that such an attack
would be a viable attack against node. And it makes AES much slower.
2012-09-25 08:51:03 -07:00
Bert Belder d2fb507556 openssl: revert empty_OPENSSL_cpuid_setup.patch 2012-09-25 08:51:03 -07:00
Bert Belder 09ac9d0b2c openssl: fix perlasm issue
When perlasm generates MASM code it sets the assembler target to 468.
In this mode MASM refuses to assemble the CPUID instruction. Bumping
the target to 586 solves this problem.
2012-09-25 08:51:03 -07:00
Bert Belder 3568edf711 openssl: add optimized bignum x64 asm code for windows 2012-09-25 08:51:02 -07:00
Bert Belder 9423aa995b openssl: fix the Windows x64 build 2012-09-17 17:54:59 -07:00
isaacs 22974a1acd openssl: Set flags to properly build on sunos 2012-09-17 17:54:59 -07:00
Shigeki Ohtsu 1bcf29ef33 openssl: disable EC_NISTP_64_GCC_128 on ia32
uint128_t won't work on 32-bit platform

Closes #4008.
2012-09-12 20:51:40 -07:00
Ben Noordhuis d3fa0dcb89 openssl: disable harmless compiler warnings
Compile with -Wno-missing-field-initializers and -Wno-old-style-declaration.
The warnings are harmless but they clutter the build output a great deal.
2012-09-12 17:57:22 +02:00
Bert Belder 4b8721aad0 openssl: remove obsolete patch files
These patches were provided by Android and Chromium. In this form they
are not useful. The ones that we need are landed as separate commits.

As of openssl 1.0.1c, three of them made it upstream:
  * npn.patch (Next Protocol Negotiation support)
  * tls_exporter.patch (RFC 5705 Keying Material Exporters for TLS)
  * openssl_no_dtls1.patch (minor bugfix)
2012-09-12 05:24:03 +02:00
Bert Belder 8d082d0f88 openssl: update the GYP build to work with openssl 1.0.1c 2012-09-12 05:24:01 +02:00
Bert Belder c4b9be7c5a openssl: replace symlinks by #include shims
Git for Windows can't create symlinks. This works too.
2012-09-12 05:23:59 +02:00
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