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

185 Commits

Author SHA1 Message Date
Stefan Fritsch
a71d0d72cb Avoid unnecessary renegotiations with SSLVerifyDepth 0.
PR: 48215
Submitted by: Kaspar Brand <asfbugz velox ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1137394 13f79535-47bb-0310-9956-ffa450edef68
2011-06-19 18:03:55 +00:00
Stefan Fritsch
48345b21d0 Avoid some memory allocations by using apr_table_setn where the string arguments
are allocated from the request pool and not modified later on.

Submitted by: Christophe JAILLET <christophe jaillet wanadoo fr>
PR: 51358


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1135084 13f79535-47bb-0310-9956-ffa450edef68
2011-06-13 11:04:29 +00:00
Stefan Fritsch
d1638d249f Remove unused variable
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090645 13f79535-47bb-0310-9956-ffa450edef68
2011-04-09 18:26:16 +00:00
Joe Orton
7075b21843 * modules/ssl/ssl_engine_kernel.c (ssl_hook_ReadReq): Compare SNI
hostname against Host header case-insensitively.

PR: 49491
Submitted by: Mayank Agrawal <magrawal.08 gmail.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082189 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:32:04 +00:00
Jeff Trawick
4598f1a7d4 fix some grammar mistakes, mostly in comments
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1080821 13f79535-47bb-0310-9956-ffa450edef68
2011-03-12 00:35:39 +00:00
Stephen Henson
8ac6f8e754 Stop warning, init should be an int.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040373 13f79535-47bb-0310-9956-ffa450edef68
2010-11-30 00:58:07 +00:00
Guenter Knauf
fe04f0b11f Removed unused var.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1040304 13f79535-47bb-0310-9956-ffa450edef68
2010-11-29 21:21:16 +00:00
Stefan Fritsch
35cdba6976 Replace ap_expr with a parser derived from mod_ssl's parser. Make mod_ssl use
the new parser. Rework ap_expr's public interface and provide hooks for modules
to add variables and functions.

The Netware and Windows build files still need to be adjusted


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1032073 13f79535-47bb-0310-9956-ffa450edef68
2010-11-06 14:31:16 +00:00
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
db980ab45e mod_ssl: Log certificate information if client cert verification
fails.

PR: 50094
Submitted by: Lassi Tuura <lat cern ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023226 13f79535-47bb-0310-9956-ffa450edef68
2010-10-16 09:51:44 +00:00
Stefan Fritsch
8afd97db5f Add authz providers for use with mod_authz_core and its RequireAny/RequireAll
containers:

'ssl' (equivalent to SSLRequireSSL)
'ssl-verify-client' (for use with 'SSLVerifyClient optional')
'ssl-require' (expressions with same syntax as SSLRequire)

We may decide to axe 'ssl-require' again in favor of the generic 'expr'
provider, depending on the development of the ap_expr parser.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002837 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 20:32:23 +00:00
Stefan Fritsch
f9ba292bfa Make the ssl expression parser thread-safe. It now requires bison instead of
yacc.

Also change the make file magic so that the real source file name is
embedded in the debug info.

The generated files have been created with flex 2.5.35/bison 2.4.1. The two
'no previous prototype' warnings are supposed to be fixed with the next flex
version.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1002824 13f79535-47bb-0310-9956-ffa450edef68
2010-09-29 19:42:03 +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
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
55b6450ecb * modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Dump the SSL
error stack if reneg fails; this will give a big hint for failures
  due to secure reneg.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@916733 13f79535-47bb-0310-9956-ffa450edef68
2010-02-26 16:05:11 +00:00
William A. Rowe Jr
dcac7e0552 Catch up ssl to socache store expiry change, and clarify what the code is doing
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907918 13f79535-47bb-0310-9956-ffa450edef68
2010-02-09 03:44:04 +00:00
Joe Orton
41d7f374af * modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup): Only set the
"ssl-secure-reneg" note if the server supports secure negotiation,
  so that a '0' value is unambiguous.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906491 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 14:28:15 +00:00
Joe Orton
08e1e0110b * modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup): Set
an "ssl-secure-reneg" note indicating whether the client
  supports the secure renegotiation TLS extension.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906485 13f79535-47bb-0310-9956-ffa450edef68
2010-02-04 14:10:55 +00:00
Joe Orton
ade83fa285 * modules/ssl/ssl_engine_vars.c (ssl_var_lookup_ssl): Add
SSL_SECURE_RENEG variable to indicate support for secure reneg.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Fixup_vars): Export
  SSL_SECURE_RENEG in the default set of variable.s


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906057 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03 14:11:19 +00:00
Joe Orton
f1e767fd68 New releases of OpenSSL will only allow secure renegotiation by
default.  Add an "SSLInsecureRenegotiation" directive to enable
renegotiation against unpatched clients, to ease transition:

* modules/ssl/ssl_private.h (struct SSLSrvConfigRec): Add
  insecure_reneg field.

* modules/ssl/ssl_engine_config.c (ssl_config_server_new,
  ssl_config_server_merge): Handle the insecure_reneg flag.
  (ssl_cmd_SSLInsecureRenegotiation): New function.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_protocol): Set the
  SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION option if insecure_reneg is
  enabled.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Log level of
  support for secure reneg.

* modules/ssl/mod_ssl.c: Add the directive definition.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@906039 13f79535-47bb-0310-9956-ffa450edef68
2010-02-03 13:38:09 +00:00
Stefan Fritsch
3560f2e015 Turn static function get_server_name_for_url() into public function
ap_get_server_name_for_url() and use it where appropriate. This fixes
mod_rewrite generating invalid URLs for redirects to IPv6 literal addresses.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@900022 13f79535-47bb-0310-9956-ffa450edef68
2010-01-16 20:32:09 +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
a256895c80 * modules/ssl/ssl_engine_kernel.c (ssl_callback_Info): Cast away the
constness of SSL * before calling SSL_get_state, to fix warning with
  older OpenSSLs.

Reported by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@881222 13f79535-47bb-0310-9956-ffa450edef68
2009-11-17 09:54:56 +00:00
Sander Temme
b90aee19b9 enable support for ECC keys and ECDH ciphers. Tested against
OpenSSL 1.0.0b3.  [Vipul Gupta vipul.gupta sun.com, Sander Temme]


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@834378 13f79535-47bb-0310-9956-ffa450edef68
2009-11-10 07:55:13 +00:00
Joe Orton
718a24dd45 * modules/ssl/ssl_engine_kernel.c (ssl_callback_Info): Add parentheses
around bitwise-and.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@833593 13f79535-47bb-0310-9956-ffa450edef68
2009-11-06 22:51:42 +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
Ruediger Pluem
b35eb008ea * Fix a regression from r724717 by reintroducing SSL_CLIENT_S_DN,
SSL_CLIENT_I_DN, SSL_SERVER_S_DN, SSL_SERVER_I_DN back to the environment
  variables to be set by mod_ssl.

Submitted by: Peter Sylvester <peter.sylvester edelweb.fr>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@820401 13f79535-47bb-0310-9956-ffa450edef68
2009-09-30 19:19:10 +00:00
Sander Temme
274263a214 Expose whether a request was served over an Initial or Resumed SSL session to the environment
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@779005 13f79535-47bb-0310-9956-ffa450edef68
2009-05-27 05:41:07 +00:00
Ruediger Pluem
80ccfe3613 * Add SSLStrictSNIVHostCheck to allow / disallow non SNI clients to connect to
name based virtual hosts.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768596 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 20:15:49 +00:00
Ruediger Pluem
06f79508fb * r->connection->aborted signals that the client aborted the connection, but
in this case *we* decide to close the connection so use
  r->connection->keepalive = AP_CONN_CLOSE


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768500 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 09:25:24 +00:00
Ruediger Pluem
7f3acaed7d * Add partial support for name based virtual hosting for non SNI clients.
Submitted by: Kaspar Brand <httpd-dev.2009 velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@768499 13f79535-47bb-0310-9956-ffa450edef68
2009-04-25 09:16:48 +00:00
Ruediger Pluem
74b86123c9 * Fix comment and optimize retrieval of loglevel.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@761181 13f79535-47bb-0310-9956-ffa450edef68
2009-04-02 06:41:50 +00:00
Ruediger Pluem
ceaa1fee2c * Do not allow name based virtual hosts in the case no hostname was
provided via SNI.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757720 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 10:56:55 +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
f67ffe3d58 Remove code to support per-dir-CA configuration which relies on a
function which was never included in OpenSSL:

* acinclude.m4: Remove test for fictional function.

* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Remove code.

* modules/ssl/ssl_engine_config.c (MODSSL_SET_CA): Remove unused
  macro.  (ssl_cmd_SSLCACertificatePath,
  ssl_cmd_SSLCACertificateFile): Fail if per-dir-CA is configured.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757380 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 11:45:00 +00:00
Ruediger Pluem
d5897d537b * If the SNI extension supplied a hostname. So don't accept requests with
either no hostname or a different hostname.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757373 13f79535-47bb-0310-9956-ffa450edef68
2009-03-23 10:51:00 +00:00
Sander Temme
e171af3118 The development trunk of OpenSSL has tightened up the type safety of the STACK construct
and the functions that manipulate it.  Make httpd trunk compile against OpenSSL HEAD
as well as OpenSSL 0.9.8j.  Also, get rid of some warnings.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@748396 13f79535-47bb-0310-9956-ffa450edef68
2009-02-27 05:16:18 +00:00
Ruediger Pluem
0f6f55ba57 * Correctly merge SSLRenegBufferSize directive.
PR: 46508
Submitted by: <tlhackque yahoo.com>
Reviewed by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@733465 13f79535-47bb-0310-9956-ffa450edef68
2009-01-11 12:58:08 +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
778a79de65 Improve mod_ssl's environment variable extraction to correctly handle
DNs with duplicate tags:

* modules/ssl/ssl_engine_vars.c:
  Augment the ssl_var_lookup_ssl_cert_dn_rec table with a flag
  to indicate whether RDNs of the given NID should be extracted
  to the environment.
  (extract_dn, modssl_var_extract_dns): New functions.

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

* modules/ssl/ssl_engine_kernel.c: Remove SSL_*_DN_ from the list
  of variables to insert into the environment.
  (ssl_hook_Fixup): Use modssl_var_extract_dns to insert the
  SSL_*_DN_ variables efficiently and accurately, handling
  certs with duplicate RDN tags correctly.

PR: 45875


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724717 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 14:41:21 +00:00
Guenter Knauf
556abbde28 Fix client verification problem with SNI and multicerts.
Submitted by: Kaspar Brand <asfbugz velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@662815 13f79535-47bb-0310-9956-ffa450edef68
2008-06-03 14:49:46 +00:00
Guenter Knauf
7e51838a64 changed comments; no functional change.
Submitted by Kaspar Brand.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630436 13f79535-47bb-0310-9956-ffa450edef68
2008-02-23 13:52:54 +00:00
Dirk-Willem van Gulik
e5efb68d5b Kasper Brand came across a flaw in the current implementation when CRL
information - i.e.  SSLCARevocationFile/SSLCARevocationPath - is set 
on a per-vhost basis (don't know how much sense it makes to have 
non-global CRLs, but anyway...).

The attached patch (47B2B1A7.1060009@velox.ch on httpd-dev) addresses 
this issue, and it also improves the logging behavior for an SNI 
enabled configuration (previously some of the messages would 
always go to the first vhost, or wouldn't appear at
all, depending on the LogLevel of the first vhost).

reviewed: dirkx



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@627699 13f79535-47bb-0310-9956-ffa450edef68
2008-02-14 10:24:04 +00:00
Guenter Knauf
495ec49226 Restructured server name indication support (PR 34607);
added missing client cert support.
Submitted by: Kaspar Brand <asfbugz velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@611216 13f79535-47bb-0310-9956-ffa450edef68
2008-01-11 16:04:26 +00:00
Guenter Knauf
2d9f0a8192 fixed code style, missing prototype warnings, disabled init for proxy, removed obsolete cast.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@607420 13f79535-47bb-0310-9956-ffa450edef68
2007-12-29 14:40:09 +00:00
Guenter Knauf
b47b9d2718 Added server name indication (RFC 4366) support (PR 34607).
Submitted by: Kaspar Brand <asfbugz velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@606190 13f79535-47bb-0310-9956-ffa450edef68
2007-12-21 13:16:21 +00:00
Joe Orton
cc1ddbbc85 * modules/ssl/ssl_engine_kernel.c (upgrade_connection): Calling
SSL_renegotiate makes no sense here; remove copied comment.  No
  functional change.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@601003 13f79535-47bb-0310-9956-ffa450edef68
2007-12-04 17:06:20 +00:00
Joe Orton
17fb5e70f7 * modules/ssl/ssl_engine_kernel.c (ssl_hook_ReadReq): For performing
TLS upgrade, require only the presence of a "TLS/1.0" token
  somewhere in the Upgrade request-header, rather than as the exact
  header value.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@600479 13f79535-47bb-0310-9956-ffa450edef68
2007-12-03 11:06:35 +00:00