Commit Graph

133 Commits

Author SHA1 Message Date
Dmitry Stogov
424aebbf36 Added support for ext/openssl 2014-05-07 01:09:42 +04:00
Daniel Lowrey
f1aa39c1af Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug #66840: Fix broken build when extension built separately
2014-04-13 15:19:23 -06:00
Daniel Lowrey
0e023e9784 Bug #66840: Fix broken build when extension built separately 2014-04-13 15:17:50 -06:00
Anatol Belski
dd7ecf2c5b fix ZTS 2014-03-10 12:24:32 +01:00
Daniel Lowrey
1f5459572e Merge branch 'PHP-5.6'
* PHP-5.6:
  Add encrypted server SNI support
  Raise timeout to 2s, reworded ssl timeout warning
  Refactor + reorganize openssl files
2014-03-05 10:23:54 -07:00
Daniel Lowrey
fad14e3180 Add encrypted server SNI support
- New "SNI_server_certs" context option maps host names to
  appropriate certs should client handshakes advertise the
  SNI extension:

    $ctx = stream_context_create(["ssl" => [
        "local_cert" => "/path/to/cert.pem",
        "SNI_server_certs" => [
            "domain1.com" => "/path/to/domain1.pem",
            "*.domain2.com" => "/path/to/domain2.pem",
            "domain3.com" => "/path/to/domain3.pem"
        ]
    ]]);

- Prefixing a "*." will utilize the matching cert if a client
  requests the primary host name or any subdomain thereof. So
  in the above example our "domain2.pem" will be used for both
  requests to "domain2.com" -and- "subdomain.domain2.com"
- The "SNI_server_certs" ctx option has no effect for client
  streams.
- SNI support is enabled by default as of 5.6 for both servers
  and clients. Servers must specify the "SNI_server_certs" array
  to actually use the SNI extension, though.
- If the `"SNI_enabled" => false` ctx option is also passed then
  "SNI_server_certs" has no effect.
- While supporting SNI by itself is enough to successfully
  negotiate the TLS handshake with many clients, servers MUST
  still specify a "local_cert" ctx option or run the risk of
  connection failures from clients that do not support the SNI
  extension.
2014-03-05 10:03:33 -07:00
datibbaw
020e161966 Raise timeout to 2s, reworded ssl timeout warning 2014-03-05 10:03:23 -07:00
Daniel Lowrey
27849c998a Refactor + reorganize openssl files
- All streams-related code now lives in xp_ssl.c. Previously
  stream code was split across both openssl.c and xp_ssl.c
- Folded superfluous php_openssl_structs.h into xp_ssl.c
- Server-specific options now set on SSL_CTX instead of SSL
- Deprecate SNI_server_name ctx option
- Miscellaneous refactoring
2014-03-05 10:03:11 -07:00
Daniel Lowrey
41bde3f0a7 Merge branch 'PHP-5.6'
* PHP-5.6:
  Capture peer cert even if verify fails
  Windows cert verify improvements + leak fixes
2014-03-02 10:39:03 -07:00
Daniel Lowrey
c126c16479 Capture peer cert even if verify fails
Previously the "capture_peer_cert" SSL context option only
captured the peer's certificate if the verification routine
succeeded.

By also capturing the on verify failure applications have the
ability to parse the cert and ask users whether they wish to
proceed given the information presented by the peer.
2014-03-02 10:35:52 -07:00
Daniel Lowrey
b3b709f1fc Merge branch 'PHP-5.6'
* PHP-5.6:
  Prevent implicit function declaration when TLSEXT unavailable
2014-02-25 19:12:49 -07:00
Daniel Lowrey
2bc0dbab44 Prevent implicit function declaration when TLSEXT unavailable 2014-02-25 19:12:33 -07:00
Anatol Belski
38d02db86d Merge branch 'PHP-5.6'
* PHP-5.6:
  fix linkage
  More openssl UPGRADING updates
  Fix build against older OpenSSL libs
  Update NEWS/UPGRADING with openssl additions
2014-02-21 23:14:48 +01:00
Anatol Belski
5b6ef90bc0 fix linkage
"extern inline" looks like tricky case for portability, but extern
is required with VS. So reduce the case to a starndard one to avoid
unporbatibily.
2014-02-21 23:09:16 +01:00
Daniel Lowrey
a27db7d2da Fix build against older OpenSSL libs 2014-02-21 13:01:04 -07:00
Daniel Lowrey
c3d76441d5 Fix build against older OpenSSL libs 2014-02-21 12:16:23 -07:00
Daniel Lowrey
1268bd6045 Merge branch 'PHP-5.6'
* PHP-5.6:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 09:15:53 -07:00
Daniel Lowrey
5389d0963c Merge branch 'reneg-limit' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'reneg-limit' of https://github.com/rdlowrey/php-src:
  Mitigate client-initiated SSL renegotiation DoS
2014-02-21 09:13:55 -07:00
Daniel Lowrey
b6edbd5897 Mitigate client-initiated SSL renegotiation DoS 2014-02-21 06:31:56 -07:00
Anatol Belski
04a10be9db Merge branch 'PHP-5.6'
* PHP-5.6:
  C89 compat
2014-02-21 11:24:18 +01:00
Anatol Belski
f51555ca58 C89 compat 2014-02-21 11:23:42 +01:00
Daniel Lowrey
86d9235de5 Merge branch 'PHP-5.6'
* PHP-5.6:
  Improve OpenSSL compile flag compatibility, minor updates
  Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests
  Improve server forward secrecy, refactor client SNI
  Add 'honor_cipher_order' server context option
  Add 'capture_session_meta' context option
  Disable TLS compression by default in both clients and servers
  Release ssl buffers
  Add openssl_get_cert_locations() function
  Explicitly set cert verify depth if not specified
  Strengthen default cipher list
2014-02-20 17:46:54 -07:00
Daniel Lowrey
9f94e0b51c Improve OpenSSL compile flag compatibility, minor updates 2014-02-20 17:23:34 -07:00
Daniel Lowrey
3a9829af20 Use crypto method flags; add tlsv1.0 wrapper; add wrapper tests 2014-02-20 17:10:06 -07:00
Daniel Lowrey
d0c9207cff Improve server forward secrecy, refactor client SNI 2014-02-20 17:10:06 -07:00
Daniel Lowrey
742fc5fb35 Add 'honor_cipher_order' server context option 2014-02-20 17:10:06 -07:00
Daniel Lowrey
081c8e9d92 Add 'capture_session_meta' context option 2014-02-20 17:10:06 -07:00
Daniel Lowrey
b98b093d73 Disable TLS compression by default in both clients and servers 2014-02-20 17:10:06 -07:00
Daniel Lowrey
b9ba011c0f Release ssl buffers 2014-02-20 17:10:06 -07:00
Daniel Lowrey
4921c1f0ce Fix segfault accessing context when no context assigned
Conflicts:
	ext/openssl/xp_ssl.c
2014-02-14 10:33:43 -07:00
Daniel Lowrey
8582353700 Fix segfault accessing context when no context assigned 2014-02-14 10:24:08 -07:00
Daniel Lowrey
6c1cdd0814 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed SNI failure from missing Z_STRVAL_PP
2014-02-04 19:13:50 -07:00
Daniel Lowrey
99fa59054d Fixed SNI failure from missing Z_STRVAL_PP 2014-02-04 19:11:56 -07:00
Daniel Lowrey
0893a13e32 Remove #if PHP_VERSION_ID version checks 2014-02-01 08:13:53 -07:00
Daniel Lowrey
05c309f2d8 Remove #if PHP_VERSION_ID version checks 2014-02-01 08:01:13 -07:00
Daniel Lowrey
58293fb533 Use master-agnostic zend_is_true checks 2014-01-31 14:18:31 -07:00
Daniel Lowrey
43432c12f1 Fixed build breakage from b4b4d9697f 2014-01-29 17:57:59 -07:00
Daniel Lowrey
b4b4d9697f Verify peers by default in client socket operations 2014-01-28 10:05:56 -07:00
Xinchen Hui
c081ce628f Bump year 2014-01-03 11:08:10 +08:00
Anatol Belski
39a2dcdeac Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed bug #65486 mysqli_poll() is broken on Win x64
2013-12-12 10:46:21 +01:00
Anatol Belski
da62fd5ed8 Fixed bug #65486 mysqli_poll() is broken on Win x64
While this issue is visible in mysqli_poll() functions, the cause
lays deeper in the stream to socket casting API. On Win x64 the
SOCKET datatype is a 64 or 32 bit unsigned, while on Linux/Unix-like
it's 32 bit signed integer. The game of casting 32 bit var to/from
64 bit pointer back and forth is the best way to break it.

Further more, while socket and file descriptors are always integers
on Linux, those are different things using different APIs on Windows.
Even though using integer instead of SOCKET might work on Windows, this
issue might need to be revamped more carefully later. By this time
this patch is tested well with phpt and apps and shows no regressions,
neither in mysqli_poll() nor in any other parts.
2013-12-12 10:17:01 +01:00
Michael Wallner
3f2fba4c34 Merge branch 'updated_tls_support' of https://github.com/rdlowrey/php-src
* 'updated_tls_support' of https://github.com/rdlowrey/php-src:
  Added support for TLSv1.1 and TLSv1.2

Conflicts:
	ext/openssl/xp_ssl.c
2013-10-17 15:27:15 +02:00
Michael Wallner
dd3a4c303b Merge branch 'PHP-5.5'
* PHP-5.5:
  Revert "TLS news"
  Revert "Added support for TLSv1.1 and TLSv1.2"
2013-10-17 15:22:07 +02:00
Michael Wallner
8aaecef524 Revert "Added support for TLSv1.1 and TLSv1.2"
This reverts commit 2aaa3d538a.
2013-10-17 15:20:38 +02:00
Michael Wallner
5a7ca69e56 Merge branch 'PHP-5.5'
* PHP-5.5:
  Added support for TLSv1.1 and TLSv1.2

Conflicts:
	ext/openssl/xp_ssl.c
2013-10-17 14:53:50 +02:00
Daniel Lowrey
2aaa3d538a Added support for TLSv1.1 and TLSv1.2
Conflicts:
	ext/openssl/xp_ssl.c
2013-10-17 14:49:44 +02:00
Daniel Lowrey
2ddefbd2b3 Added support for TLSv1.1 and TLSv1.2 2013-10-08 14:09:17 -04:00
Martin Jansen
ce2789558a Streams for ssl:// transports can now be configured to use a specific
crypto method (SSLv3, SSLv2 etc.) by calling

stream_context_set_option($ctx, "ssl", "crypto_method", $crypto_method)

where $crypto_method can be one of STREAM_CRYPTO_METHOD_SSLv2_CLIENT,
STREAM_CRYPTO_METHOD_SSLv3_CLIENT, STREAM_CRYPTO_METHOD_SSLv23_CLIENT
or STREAM_CRYPTO_METHOD_TLS_CLIENT. SSLv23 remains the default crypto
method.

This change makes it possible to fopen() SSL URLs that are only
provided using SSL v3.
2013-09-21 21:26:40 +02:00
Christopher Jones
3c166c4758 Merge branch 'PHP-5.5'
* PHP-5.5:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/gmp/gmp.c
2013-08-14 20:47:00 -07:00
Christopher Jones
39612afc72 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Reduce (some) compile noise of 'unused variable' and 'may be used uninitialized' warnings.

Conflicts:
	ext/dba/libinifile/inifile.c
2013-08-14 20:43:25 -07:00