1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-10 02:02:49 +03:00
Commit Graph

175 Commits

Author SHA1 Message Date
Daniel Earl Poirier
6b803976f2 Fix a number of typos and misspellings. Reported by Ville Skytta.
PR48496.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1029134 13f79535-47bb-0310-9956-ffa450edef68
2010-10-30 17:56:13 +00:00
Stefan Fritsch
a527986832 remove more unused variables
revove some obsolete comments

netware file is untested


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@982050 13f79535-47bb-0310-9956-ffa450edef68
2010-08-03 22:12:19 +00:00
Stefan Fritsch
0d11ddb595 - Introduce ap_log_cserror to allow mod_ssl to associate log messages to
different servers than c->base_server.
- Adjust the scope of some mod_ssl trace logging from server to conn.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@954611 13f79535-47bb-0310-9956-ffa450edef68
2010-06-14 19:59:05 +00:00
Stefan Fritsch
ba0d30294e Replace LogLevelDebugDump with TRACE log levels
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951904 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:10:23 +00:00
Stefan Fritsch
01b9f2e551 - Be less verbose at levels INFO and DEBUG in mod_proxy* and mod_ssl
- Add some trace logging to core and http


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951900 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:07:12 +00:00
Stefan Fritsch
af4c0f4923 Use new loglevel accessor macros to simplify code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951896 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 17:01:29 +00:00
Stefan Fritsch
7d6bd86673 Introduce SSLLOG_MARK for use with ssl_log_ssl_error(). This will allow to
redefine APLOG_MARK later.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951194 13f79535-47bb-0310-9956-ffa450edef68
2010-06-03 22:57:00 +00:00
Joe Orton
c9897ccf0c Further mitigation for the TLS renegotation attack, CVE-2009-3555:
* modules/ssl/ssl_engine_kernel.c (has_buffered_data): New function.
  (ssl_hook_Access): Forcibly disable keepalive for the connection if
  there is any buffered data readable from the input filter stack.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_input): Ensure that the
  BIO uses blocking operations when invoked outside direct control of
  the httpd filter stack.

Thanks to Hartmut Keil <Hartmut.Keil adnovum.ch> for proposing this
technique.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@891282 13f79535-47bb-0310-9956-ffa450edef68
2009-12-16 15:59:49 +00:00
Joe Orton
39d5d9507b SECURITY: Partial fix for CVE-2009-3555:
Reject client-initiated renegotiations; this is sufficient to prevent
the attack for any configuration which does not require renegotiation
due to per-directory/per-location access control configuration.

Configuration with per-directory/per-location access control
requirements (such as "SSLVerifyClient require") are still vulnerable
to CVE-2009-3555 with this patch applied (if using OpenSSL <= 0.9.8k).

* modules/ssl/ssl_private.h (SSLConnRec): Add reneg_state field.
  (ssl_callback_Info): Renamed from ssl_callback_LogTracingState.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_callbacks): Install
  the (renamed) info callback unconditionally.

* modules/ssl/ssl_engine_io.c (ssl_filter_ctx_t): Add config pointer
  to SSLConnRec.
  (bio_filter_out_write, bio_filter_in_read): Fail with
  APR_ECONNABORTED if the reneg state is set to RENEG_ABORT.

* modules/ssl/ssl_engine_kernel.c (log_tracing_state): Factored out
  of ssl_callback_LogTracingState.
  (ssl_callback_Info): New function.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833582 13f79535-47bb-0310-9956-ffa450edef68
2009-11-06 22:33:19 +00:00
Guenter Knauf
158ed01bff fixed wrong 3rd parameter passed to apr_brigade_split_line().
Problem showed up with Sun Studio; mentioned by Jie Gao on the list.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@819373 13f79535-47bb-0310-9956-ffa450edef68
2009-09-27 18:53:33 +00:00
Joe Orton
efcb56a2f4 Fix hung SSL handshake if a particularly long CA list is configured:
* modules/ssl/ssl_engine_io.c (bio_filter_in_read): Flush pending
  output unconditionally since OpenSSL is known to not flush correctly
  at all times, and it should be cheap even in cases where it is
  unnecessary.

PR: 46952


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@788715 13f79535-47bb-0310-9956-ffa450edef68
2009-06-26 14:22:20 +00:00
Joe Orton
781f39a68a * modules/ssl/ssl_engine_io.c (bio_filter_out_ctrl): Switch
implementation of BIO_CTRL_PENDING and BIO_CTRL_WPENDING, to return
  zero and pending-bytes-to-write respectively.

PR: 46952
Submitted by: David Smith <David.Smith cern.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@787722 13f79535-47bb-0310-9956-ffa450edef68
2009-06-23 15:42:02 +00:00
Joe Orton
b87a8928d4 * module/ssl/ssl_engine_io.c: Comment bio_filter_out_ctx_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@787644 13f79535-47bb-0310-9956-ffa450edef68
2009-06-23 11:53:33 +00:00
Ruediger Pluem
c719980d2d * Optimize access to server_rec.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@771455 13f79535-47bb-0310-9956-ffa450edef68
2009-05-04 21:37:09 +00:00
Ruediger Pluem
da160114d6 * Set SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN to on by default.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769815 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 16:18:21 +00:00
Ruediger Pluem
506ed9e89e * Improve and simplify the implementation of SSLProxyCheckPeerExpire by
directly using X509_get_notBefore(), X509_get_notAfter() and
  X509_cmp_current_time().
  Thanks to jorton for the pointer.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@769809 13f79535-47bb-0310-9956-ffa450edef68
2009-04-29 16:12:20 +00:00
Ruediger Pluem
e468a9fae6 * Add SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN directives to enable
stricter checking of remote server certificates.

  (docs/manual/mod/mod_ssl.xml)
    Documentation of SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/proxy/mod_proxy_http.c)
    Set the hostname of the request URL as note on the connection.

  (modules/ssl/ssl_private.h)
    Add proxy_ssl_check_peer_expire and proxy_ssl_check_peer_cn fields to
    the SSLSrvConfigRec.

  (modules/ssl/ssl_engine_config.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.

  (modules/ssl/ssl_engine_io.c)
    Check whether the remote servers certificate is expired / if there is a
    mismatch between the requested hostanme and the remote server certificates
    CN field.
    Be able to parse ASN1 times.

  (modules/ssl/mod_ssl.c)
    Directives stuff for SSLProxyCheckPeerExpire and SSLProxyCheckPeerCN.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@760866 13f79535-47bb-0310-9956-ffa450edef68
2009-04-01 12:07:47 +00:00
Ruediger Pluem
9e39ba015a * Store the correct server_rec in the connection record configuration and
adjust the remaining part of mod_ssl to use this server_rec instead of
  c->base_server.

  modules/ssl/ssl_private.h:
  - server_rec member to SSLConnRec struct
  - Add macros to extract data from connection_rec
    mySrvFromConn(c)
    mySrvConfigFromConn(c)
    myModConfigFromConn(c)
  modules/ssl/ssl_engine_io.c
  modules/ssl/ssl_util_ocsp.c
  modules/ssl/ssl_engine_kernel.c
  modules/ssl/mod_ssl.c
  modules/ssl/ssl_engine_log.c
  - Use the new macros to extract data fron connection_rec
    and use the server_rec stored in SSLConnRec instead of
    c->base_server whereever appropriate.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757463 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 17:37:38 +00:00
Joe Orton
b06785833f mod_ssl: Make the size of the per-dir-reneg request-body buffer
configurable, by popular demand:

* modules/ssl/ssl_private.h: Define DEFAULT_RENEG_BUFFER_SIZE.
  (SSLDirConfigRec): Add nRenegBufferSize field.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLRenegBufferSize): New
  function.
  (ssl_config_perdir_create, ssl_config_perdir_merge): Handle
  nRenegBufferSize.

* modules/ssl/ssl_engine_io.c (ssl_io_buffer_fill): Take max buffer
  size as an argument rather than compile-time constant.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Pass
  nRenegBufferSize to ssl_io_buffer_fill.

* modules/ssl/mod_ssl.c (ssl_config_cmds): Add SSLRenegBufferSize.

PR: 39243


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726109 13f79535-47bb-0310-9956-ffa450edef68
2008-12-12 20:20:40 +00:00
Joe Orton
98ab70975b * modules/ssl/ssl_engine_io.c (ssl_io_input_getline): Document
interface.
  (ssl_io_filter_input): For GETLINE mode, pull lines directly from
  the char_buffer if possible, to avoid unnecessarily copying the
  entire buffer once per invocation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683283 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:45:48 +00:00
Joe Orton
feabec3902 * modules/ssl/ssl_engine_io.c (char_buffer_read): Use memmove in place
of memcpy since the buffers can overlap; add explanatory comment.

PR: 45444


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@683280 13f79535-47bb-0310-9956-ffa450edef68
2008-08-06 14:37:09 +00:00
Joe Orton
a9f0192ada * modules/ssl/ssl_engine_io.c (ssl_io_filter_error): Remove "fish",
left for debugging purposes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645623 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 17:26:22 +00:00
Joe Orton
35e43a1051 Clean up some more error handling in mod_ssl:
* modules/ssl/ssl_engine_io.c (ssl_filter_io_shutdown): Remove
  redundant return value (which was always success).
  (ssl_io_filter_handshake): Return APR_ECONNABORTED on handshake
  failure, rather than success.
  (ssl_io_filter_output): Ignore ssl_filter_io_shutdown return
  value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645584 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 16:03:49 +00:00
Joe Orton
5cd1598f98 Clean up some error handling in mod_ssl:
* modules/ssl/ssl_engine_io.c: Define new error codes in the APR status
  code range, MODSSL_ERROR_BAD_GATEWAY and MODSSL_ERROR_HTTP_ON_HTTPS;
  use these HTTP_* constants directly as apr_status_t values.
  (ssl_io_filter_error): Use new constants.
  (ssl_io_filter_handshake): Return purely an APR status value rather
  than a mixture of HTTP_* constants, OpenSSL error codes, and APR
  status values.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645549 13f79535-47bb-0310-9956-ffa450edef68
2008-04-07 15:05:14 +00:00
Joe Orton
ad857cdbdc * modules/ssl/ssl_engine_io.c (ssl_io_input_add_filter,
ssl_io_filter_init): Don't clear f->r here after adding connection
  filters since ap_add_*_filter now guarantee to do it internally.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600477 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 11:01:51 +00:00
Joe Orton
a8e34cd7dc * modules/ssl/ssl_engine_io.c (ssl_io_filter_handshake): Renamed from
ssl_io_filter_connect since the function performs a handshake in
either client or server mode, not a "connect".  No functional change.
(both callers updated)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@592552 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 20:49:09 +00:00
Joe Orton
c15016e058 mod_ssl: Fix forever-broken TLS upgrade support; perform the upgrade
in the post_read_request hook rather than in a filter, and fix the
filter insertion issue:

* modules/ssl/ssl_engine_kernel.c (upgrade_connection): New function,
mostly moved from ssl_io_filter_Upgrade.
(ssl_hook_ReadReq): Call upgrade_connection to upgrade to TLS if
required.

* modules/ssl/ssl_engine_io.c (ssl_io_filter_Upgrade): Remove
function.
(ssl_io_input_add_filter, ssl_io_filter_init): Take a request_rec
pointer and pass to ap_add_*_filter to ensure the filter chain
is modified correctly; remove it from the filter afterwards.
(ssl_io_filter_register): Drop UPGRADE_FILTER registration.

* modules/ssl/mod_ssl.c (ssl_init_ssl_connection): Take a request_rec
pointer, pass to ssl_io_filter_init.
(ssl_hook_pre_connection): Pass NULL request_rec pointer to above.
(ssl_hook_Insert_Filter): Remove function.
(ssl_register_hooks): Drop insert_filter hook.

* modules/ssl/ssl_private.h: Update prototypes.

PR: 41231


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@592446 13f79535-47bb-0310-9956-ffa450edef68
2007-11-06 15:02:32 +00:00
Joe Orton
bbebc9339e Fix handling of buffered request body for per-location SSL
renegotiation when an internal redirect occurs:

* modules/ssl/ssl_engine_io.c (ssl_io_buffer_fill): Remove
protocol-level filters before inserting the buffering filter.
(ssl_io_filter_buffer): Return an EOS if invoked with an empty
brigade; do not remove the filter after exhausting the buffer.
(ssl_io_filter_buffer): Increase the type of the buffer filter to be
AP_FTYPE_PROTOCOL.

PR: 43738


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@591393 13f79535-47bb-0310-9956-ffa450edef68
2007-11-02 16:45:46 +00:00
Paul Querna
dc08a1050d Fixup style nitpicks:
- Empty lines should not have spaces
 - Declare static functions in http_core.c at the top.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546632 13f79535-47bb-0310-9956-ffa450edef68
2007-06-12 20:55:57 +00:00
Paul Querna
83a3e2a77f Add a clogging_input_filters variable to the conn_rec, enabling the Event MPM to know when its running with an input filter that buffers its own data, like mod_ssl.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@546328 13f79535-47bb-0310-9956-ffa450edef68
2007-06-12 00:32:24 +00:00
Joe Orton
bc522e757b * modules/ssl/ssl_engine_io.c (ssl_io_buffer_fill): Remove subpool; it
cannot be destroyed before r->pool so serves no purpose.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@478141 13f79535-47bb-0310-9956-ffa450edef68
2006-11-22 12:11:57 +00:00
Roy T. Fielding
de659cbed0 update license header text
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@420983 13f79535-47bb-0310-9956-ffa450edef68
2006-07-11 20:33:53 +00:00
William A. Rowe Jr
7e18e19091 New SSLLogLevelDebugDump [ None (default) | IO (not bytes) | Bytes ]
configures the I/O Dump of SSL traffic, when LogLevel is set to Debug.
  The default is none as this is far greater debugging resolution than 
  the typical administrator is prepared to untangle.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@416265 13f79535-47bb-0310-9956-ffa450edef68
2006-06-22 06:13:07 +00:00
Colm MacCarthaigh
dd95d7c37c Update the copyright year in all .c, .h and .xml files
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@395228 13f79535-47bb-0310-9956-ffa450edef68
2006-04-19 12:11:27 +00:00
Martin Kraemer
1d42526e3e Fix SSL Protocol hexdumps for EBCDIC systems
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@349906 13f79535-47bb-0310-9956-ffa450edef68
2005-11-30 08:01:35 +00:00
Jim Jagielski
5061d9fa92 No functional Change: Removing trailing whitespace. This also
means that "blank" lines consisting of just spaces or
tabs are now really blank lines


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332306 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:11:44 +00:00
Jim Jagielski
5d2fae4818 No functional change: simple detabbing of indented code.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@332305 13f79535-47bb-0310-9956-ffa450edef68
2005-11-10 15:05:51 +00:00
Joe Orton
23a3c20db2 Implement a (bounded) buffer of request body data to provide a limited
but safe fix for the mod_ssl renegotiation-vs-requests-with-bodies
bug:

* modules/ssl/ssl_private.h (ssl_io_buffer_fill): Add prototype.

* modules/ssl/ssl_engine_io.c (ssl_io_buffer_fill,
ssl_io_filter_buffer): New functions.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): If a
renegotiation is needed, and the request has a non-zero
content-length, or a t-e header (and 100-continue was not requested),
call ssl_io_buffer_fill to set aside the request body data if
possible, then proceed with the negotiation.

PR: 12355


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@290965 13f79535-47bb-0310-9956-ffa450edef68
2005-09-22 15:38:14 +00:00
Joe Orton
d2ed0fd309 * modules/ssl/ssl_engine_io.c (ssl_io_filter_init): Initialize the
nobuffer flag to zero since the structure is palloc'ed not pcalloc'ed.

PR: 35279


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@189971 13f79535-47bb-0310-9956-ffa450edef68
2005-06-10 15:13:59 +00:00
Justin Erenkrantz
905cdf9f0b Update copyright year to 2005 and standardize on current copyright owner line.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@151408 13f79535-47bb-0310-9956-ffa450edef68
2005-02-04 20:28:49 +00:00
Joe Orton
b1391e12be * modules/ssl/ssl_engine_io.c (bio_filter_out_flush): Fail if the
connection was reset.

PR: 32699


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@125166 13f79535-47bb-0310-9956-ffa450edef68
2005-01-14 14:16:58 +00:00
Joe Orton
c1f1265c2b * modules/ssl/ssl_engine_io.c (bio_filter_out_flush): Revert the
passed-brigade-reuse "fix" which is currently unnecessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111962 13f79535-47bb-0310-9956-ffa450edef68
2004-12-15 11:17:22 +00:00
Joe Orton
d0127de8e8 * modules/ssl/ssl_engine_io.c (ssl_io_filter_cleanup): Fix segfaults
from using ap_log_cerror from a c->pool cleanup; the debug message
triggers too often anyway so just remove it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111959 13f79535-47bb-0310-9956-ffa450edef68
2004-12-15 10:08:09 +00:00
Joe Orton
16bfea9b63 * modules/ssl/ssl_engine_io.c (ssl_io_filter_Upgrade): Simplify the
Upgrade header check; allow upgrades on any method; don't drop the
ap_pass_brigade return value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@111159 13f79535-47bb-0310-9956-ffa450edef68
2004-12-07 22:49:54 +00:00
Joe Orton
db21c0932f * modules/ssl/ssl_engine_io.c (ssl_io_filter_Upgrade): Remove the
unnecessary check of the Connection request header.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109499 13f79535-47bb-0310-9956-ffa450edef68
2004-12-02 13:34:48 +00:00
Paul Querna
ab67a07bb0 Use a case insensitive compare when looking for 'Upgrade'.
The first client I tested was sending 'upgrade'.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@109447 13f79535-47bb-0310-9956-ffa450edef68
2004-12-02 04:25:52 +00:00
Joe Orton
0369bbbc93 Fix handling of non-blocking reads in mod_ssl (triggered by recent
change to mod_proxy_http):

* modules/ssl/ssl_engine_io.c (bio_filter_in_read): Return an error if
the read would block so that the SSL_read() caller checks for
SSL_ERROR_WANT_READ, rather than 0, which is treated like EOF.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105768 13f79535-47bb-0310-9956-ffa450edef68
2004-11-14 17:20:01 +00:00
Joe Orton
413c2f1a13 * modules/ssl/ssl_engine_io.c, modules/ssl/ssl_engine_kernel.c,
modules/mod_ssl.c: Switch to using ap_log_cerror() in place of
ap_log_error() everywhere that the conn_rec * is available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105739 13f79535-47bb-0310-9956-ffa450edef68
2004-11-10 13:35:28 +00:00
Joe Orton
4d1d856e9d * modules/ssl/ssl_engine_io.c (ssl_io_filter_connect): Return
502 not 501 if SSL_connect() fails for a proxy connection.

PR: 31083


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105252 13f79535-47bb-0310-9956-ffa450edef68
2004-09-22 16:34:20 +00:00
Joe Orton
63b4ad0dcb * modules/ssl/ssl_engine_io.c (ssl_io_input_read): Fix rollback
handling for AP_MODE_SPECULATIVE.

PR: 30134


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104687 13f79535-47bb-0310-9956-ffa450edef68
2004-08-17 16:31:23 +00:00