Commit Graph

606 Commits

Author SHA1 Message Date
Chuan Ma
f413a77b3d Fix #66942: openssl_seal() memory leak
Fix #66952: memory leak in openssl_open()
2014-04-14 13:36:17 -07:00
Daniel Lowrey
0e023e9784 Bug #66840: Fix broken build when extension built separately 2014-04-13 15:17:50 -06:00
Remi Collet
89dc5924c9 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  NEWS
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
  Fix 5.5.10 NEWS
2014-03-14 09:52:47 +01:00
Remi Collet
e1d8c0a051 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  NEWS
  Fixed Bug #66833 Default digest algo is still MD5
2014-03-14 09:52:02 +01:00
Remi Collet
17f6391bf8 Fixed Bug #66833 Default digest algo is still MD5
Switch to SHA1, which match internal openssl hardcoded algo.

In most case, won't even be noticed
- priority on user input (default_md)
- fallback on system config
- fallback on this default value

Recent system reject MD5 digest, noticed in bug36732.phpt failure.

While SHA1 is better than MD5, SHA256 is recommenced,
and defined as default algo in provided configuration on
recent system (Fedora 21, RHEL-7, ...). But the idea is to
keep in sync with openssl internal value for PHP internal value.
2014-03-14 09:50:15 +01:00
Lior Kaplan
f120463efe Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Typo fix: sicret -> secret
2014-03-13 12:41:48 +02:00
Lior Kaplan
356c442558 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Typo fix: sicret -> secret
2014-03-13 12:40:14 +02:00
Michael Meyer
737c187013 Typo fix: sicret -> secret 2014-03-13 12:37:25 +02:00
Remi Collet
518a6ed95b Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-06 10:16:30 +01:00
Remi Collet
7d5c11c235 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Set default Digest Message to use SHA1 instead of MD5 in openssl tests as MD5 signature are now rejected by newer openssl Version.
2014-03-06 10:16:16 +01:00
Remi Collet
721b9a7c8d Set default Digest Message to use SHA1 instead of MD5 in openssl tests
as MD5 signature are now rejected by newer openssl Version.

Noticed in RHEL-7 and Fedora 21 build.
2014-03-06 10:14:08 +01: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
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
Chris Wright
e8995c8cb0 Windows cert verify improvements + leak fixes
- Clean up properly at all fail points in native Windows peer
  verification routine
- Bring certificate usages and chain flags into line with chromium
  implementation in windows environments
2014-03-02 10:30:21 -07:00
Anatol Belski
2c1385b7f5 remove pcntl leftover from the test code 2014-02-27 15:50:17 +01:00
Daniel Lowrey
d0a6f8c68e Deprecate CN_match in favor of peer_name in SSL contexts 2014-02-26 13:20:06 -07:00
Anatol Belski
9ab73c52ab restored that test part in ext/openssl to enable notify/wait 2014-02-26 13:37:20 +01:00
Anatol Belski
bcff8d1b26 remove echo 2014-02-26 12:41:36 +01:00
Anatol Belski
56cbe04381 fix stdin reading in new openssl tests 2014-02-26 11:27:24 +01:00
Anatol Belski
82a98f6e52 kick redundant include
this is already present from php.h
2014-02-26 11:23:43 +01:00
Daniel Lowrey
2bc0dbab44 Prevent implicit function declaration when TLSEXT unavailable 2014-02-25 19:12:33 -07:00
Daniel Lowrey
bab017ddfd Remove test case invalidated by openssl.cafile accessibility change 2014-02-25 13:02:13 -07:00
Daniel Lowrey
bd95716b8e Merge branch 'windowsPeerVerification' of https://github.com/DaveRandom/php-src into PHP-5.6
* 'windowsPeerVerification' of https://github.com/DaveRandom/php-src:
  Update openssl tests with new server/client test harness
  Add peer certificate verification on windows
2014-02-25 12:43:52 -07:00
Daniel Lowrey
f8fe09dcef Tolerate non-standard newlines when parsing stream CA files 2014-02-25 09:59:13 -07:00
Daniel Lowrey
a4c7ab8399 Remove openssl tests that shouldn't have survived last merge
These are .phpt files I meant to remove with the last batch as
the same functionality is now covered in other tests and these
are no longer needed.
2014-02-25 09:59:13 -07:00
Daniel Lowrey
47b5873c5d Change openssl directives to PHP_INI_PERDIR
Because openssl.cafile and openssl.capath have implications for
security these directives have been changed to PHP_INI_PERDIR
(previously PHP_INI_ALL)
2014-02-25 09:59:13 -07:00
Chris Wright
d6fb7b8f2e Update openssl tests with new server/client test harness 2014-02-25 16:51:50 +00:00
Chris Wright
480e4f8541 Add peer certificate verification on windows
Peer certificate verification on Windows using the native certificate store and the Windows API
2014-02-25 16:51:49 +00: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
c3d76441d5 Fix build against older OpenSSL libs 2014-02-21 12:16:23 -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
f51555ca58 C89 compat 2014-02-21 11:23:42 +01: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
df6bfe3be2 Add openssl_get_cert_locations() function 2014-02-20 17:10:06 -07:00
Daniel Lowrey
258d04df5c Explicitly set cert verify depth if not specified 2014-02-20 17:10:06 -07:00
Daniel Lowrey
225f534b1a Strengthen default cipher list 2014-02-20 17:10:06 -07:00
Daniel Lowrey
e272225e2a Merge branch 'bug-65538' of https://github.com/rdlowrey/php-src into PHP-5.6
* 'bug-65538' of https://github.com/rdlowrey/php-src:
  Add tests for Bug #65538
  Fix Bug #65538 (cafile now supports stream wrappers)
2014-02-19 04:17:33 -07:00
Daniel Lowrey
d9036d14f7 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Skip failing tests when EC unavailable (RHEL)
2014-02-19 04:01:57 -07:00
Daniel Lowrey
a7d3606650 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Skip failing tests when EC unavailable (RHEL)

Conflicts:
	ext/openssl/openssl.c
2014-02-19 04:01:08 -07:00
Daniel Lowrey
633f898f15 Skip failing tests when EC unavailable (RHEL) 2014-02-19 03:57:37 -07:00
Daniel Lowrey
4e4d319e62 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed broken build when EC unavailable
2014-02-17 19:38:49 -05:00