Commit Graph

208 Commits

Author SHA1 Message Date
a1fc8722b5 Merge r1294306 from trunk:
Initialize EC temporary key on server startup, as for DH and
RSA. This fixes a race condition that could lead to a crash with threaded
MPMs.

Submitted by: sf
Reviewed/backported by: jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1308862 13f79535-47bb-0310-9956-ffa450edef68
2012-04-03 12:37:57 +00:00
76d3f10e99 Add cleanup for SSLProxyMachineCertificateChainFile during init
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1242097 13f79535-47bb-0310-9956-ffa450edef68
2012-02-08 21:11:54 +00:00
77568d0a46 Merge r1225476:
Don't use #ifdef inside macro calls

The behavior is undefined according to C99 6.10.3.11 and it breaks with
xlc on AIX

PR: 52394


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1225477 13f79535-47bb-0310-9956-ffa450edef68
2011-12-29 08:59:44 +00:00
6eb443666c merge r1222921 from trunk:
SSLProtocol: allow explicit control of TLSv1.1 and TLSv1.2 flavors when
compiled against OpenSSL 1.0.1 or later. Update documentation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1222922 13f79535-47bb-0310-9956-ffa450edef68
2011-12-24 06:43:48 +00:00
ea32bc39c2 merge r1222917 from trunk:
Set OPENSSL_NO_SSL_INTERN when compiling against OpenSSL 1.0.1
or later, so that mod_ssl retains binary compatibility with future
versions when internal structures are changed. Use API functions
where available, and fall back to direct access for OpenSSL up
to 1.0.0, where needed.

Remove SSL_make_ciphersuite() from ssl_util_ssl.[ch], as it was
never used by any released version of mod_ssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1222920 13f79535-47bb-0310-9956-ffa450edef68
2011-12-24 06:35:20 +00:00
9fe3c24de9 backport r1213399 from trunk:
logging adjustments:
- consistently call ssl_log_ssl_error after ap_log_error etc.
- ssl_init_ConfigureServer: add vhost_id to log message


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1213400 13f79535-47bb-0310-9956-ffa450edef68
2011-12-12 20:05:27 +00:00
f082f40cb7 backport r1213380 from trunk:
Streamline TLS session ticket key handling (added in r1200040):
- drop the SSLTicketKeyDefault directive, and only support a single
  ticket key per server/vhost
- rename the SSLTicketKeyFile directive to SSLSessionTicketKeyFile,
  remove the keyname parameter
- move ticket key parameters from SSLSrvConfigRec to modssl_ctx_t
- configure the tlsext_ticket_key_cb only when in server mode
- add documentation for SSLSessionTicketKeyFile


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1213395 13f79535-47bb-0310-9956-ffa450edef68
2011-12-12 19:51:05 +00:00
9dcd56857e Merge r1211680:
Various fixes for log message tags:

- Remove tags in ssl_log_ssl_error() and ssl_log_cert_error()
- Instead add tags to various ssl_log_xerror, ssl_log_cxerror
  calls (ssl_log_rxerror is unused).
- likewise for modssl_proxy_info_log()

- Fix spelling of APLOG_NOERRNO in coccinelle script
- add support for ssl_log_*error and ap_log_cserror

- add some more tags missing due to APLOG_NOERRNO spelling error

- Remove tags from example modules (we don't want people to blindly copy
  those)



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1211682 13f79535-47bb-0310-9956-ffa450edef68
2011-12-07 22:36:29 +00:00
b6ae8ca44a Backport r1209766, r1210252, r1210284:
Add lots of unique tags to error log messages

ssl_util.c: Downgrade some dynamic locking messages from level DEBUG
to TRACE1-3


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1210287 13f79535-47bb-0310-9956-ffa450edef68
2011-12-05 00:08:01 +00:00
1bd368ce2e merge r1203491 from trunk:
drop SSLv2 support (set SSL_OP_NO_SSLv2 for any new SSL_CTX)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1203495 13f79535-47bb-0310-9956-ffa450edef68
2011-11-18 05:29:50 +00:00
8b2e0e56c2 Add support for RFC 5077 TLS Session tickets. This adds two new directives:
* SSLTicketKeyFile: To store the private information for the encryption of the ticket.
* SSLTicketKeyDefault To set the default, otherwise the first listed token is used.  This enables key rotation across servers.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1200040 13f79535-47bb-0310-9956-ffa450edef68
2011-11-09 23:37:37 +00:00
a3ffb7e3df Remove some ap_add_version_component() calls that don't provide any information
because the modules don't have separate version numbers anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1199532 13f79535-47bb-0310-9956-ffa450edef68
2011-11-08 23:37:13 +00:00
5c005263d5 Fix a potential NULL pointer dereference found by clang.
Add a AP_DEBUG_ASSERT to quiet a clang false positive.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1180329 13f79535-47bb-0310-9956-ffa450edef68
2011-10-08 07:41:50 +00:00
fb5cf8f74f If MaxMemFree is set, set SSL_MODE_RELEASE_BUFFERS in mod_ssl.
Always set SSL_MODE_RELEASE_BUFFERS in ab.

PR: 51618
Submitted by: Cristian Rodríguez <crrodriguez opensuse org>, Stefan Fritsch


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1178079 13f79535-47bb-0310-9956-ffa450edef68
2011-10-01 19:48:14 +00:00
2160d8594c In ssl_check_public_cert(), also take dNSNames in the subjectAltName
extension into account when checking the cert against the configured
ServerName. PR 32652, PR 47051.

Replace SSL_X509_getCN() by SSL_X509_getIDs(), which returns an array
of a cert's DNS-IDs and CN-IDs (terms as coined by RFC 6125).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1176752 13f79535-47bb-0310-9956-ffa450edef68
2011-09-28 06:52:39 +00:00
c4736a5326 Final update to SSLProxyMachineCertificateChainFile
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175946 13f79535-47bb-0310-9956-ffa450edef68
2011-09-26 16:39:00 +00:00
8a52dc2610 replace another occurence of X509_NAME_oneline by SSL_X509_NAME_to_string
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1175905 13f79535-47bb-0310-9956-ffa450edef68
2011-09-26 15:24:23 +00:00
427c85bd23 Cleanup effort in prep for GA push:
Trim trailing whitespace... no func change



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1174751 13f79535-47bb-0310-9956-ffa450edef68
2011-09-23 13:39:32 +00:00
f1937c9534 Style cleanup
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172562 13f79535-47bb-0310-9956-ffa450edef68
2011-09-19 10:48:45 +00:00
362f424e78 Log better information and prevent leak of an X509 structure for SSLProxyMachineCertificateChainFile
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1172010 13f79535-47bb-0310-9956-ffa450edef68
2011-09-17 16:25:17 +00:00
47cf15b852 Modify SSLProxyMachineCertificateChainFile to use X509 instead of X509_INFO and use openssl to construct the chain
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1170833 13f79535-47bb-0310-9956-ffa450edef68
2011-09-14 20:16:02 +00:00
b4db4c2cdd * Silence compiler warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1165200 13f79535-47bb-0310-9956-ffa450edef68
2011-09-05 08:23:01 +00:00
2c24630059 Revamp CRL checking for client and remote servers:
- completely delegate CRL processing to OpenSSL
- introduce a new [Proxy]CARevocationCheck directive
- drop ssl_callback_SSLVerify_CRL from ssl_engine_kernel.c
- remove X509_STORE from modssl_ctx_t
- drop CRL store helper functions from ssl_util_ssl.c
- avoid sending "certificate_expired" SSL alerts to peers
  when the nextUpdate field of a CRL is in the past


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1165056 13f79535-47bb-0310-9956-ffa450edef68
2011-09-04 15:57:03 +00:00
e5df36d18a Add SSLProxyMachineCertificateChainFile directive and documentation for bug 50812
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1160863 13f79535-47bb-0310-9956-ffa450edef68
2011-08-23 19:35:07 +00:00
6a6c22af52 Enforce OpenSSL 0.9.7 or later at compile time (#error out otherwise).
Remove some more unneeded defines from ssl_private.h.

At runtime, warn when mod_ssl is started with an OpenSSL version
older than the one it was originally compiled against.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1157575 13f79535-47bb-0310-9956-ffa450edef68
2011-08-14 17:37:03 +00:00
7bd59fd67a Remove the ssl_toolkit_compat layer, which is no longer needed
after support for non-OpenSSL toolkits has been dropped.

Replace macros by their value proper where feasible, and keep
those definitions in ssl_private.h which depend on specific
OpenSSL versions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154687 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:34:31 +00:00
1eb818742f Drop support for the RSA BSAFE SSL-C toolkit from configure,
and remove #ifdef'ed code from mod_ssl and ab where applicable.

Consensus for dropping support for SSL/TLS toolkits other
than OpenSSL was reached on dev@httpd in June 2010 (message
with ID <20100602162310.GA11156@redhat.com> and follow-ups).


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154683 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:29:09 +00:00
ded32d4e37 mod_ssl, ab: Support OpenSSL compiled without SSLv2 support
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1090367 13f79535-47bb-0310-9956-ffa450edef68
2011-04-08 17:56:20 +00:00
03d6bcb14f Error messages like "theoretically shouldn't happen" are incredibly
unhelpful, particularly when they do happen with some regularity.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1031057 13f79535-47bb-0310-9956-ffa450edef68
2010-11-04 16:15:03 +00:00
7b9471c76f handle the ca_list == NULL case correctly (which can only happen with out
of memory, anyway)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1027239 13f79535-47bb-0310-9956-ffa450edef68
2010-10-25 19:13:20 +00:00
59d4757c65 Make sure to always log an error if loading of CA certificates fails
PR: 40312
Submitted by: Paul Tiemann <issues apache org ourdetour com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026906 13f79535-47bb-0310-9956-ffa450edef68
2010-10-24 22:14:15 +00:00
d658afdd1c Consistently use loglevel emerg before ssl_die()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1026903 13f79535-47bb-0310-9956-ffa450edef68
2010-10-24 21:57:08 +00:00
cdb0073eec Make sure OCSP Stapling Mutex is initiliased if we need it.
PR 49498


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023821 13f79535-47bb-0310-9956-ffa450edef68
2010-10-18 14:45:19 +00:00
2783b4e8fa Fix stupid typos.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023533 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 17:52:38 +00:00
25ff6f51f1 Avoid use of deprecated RSA_generate_key() function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1023521 13f79535-47bb-0310-9956-ffa450edef68
2010-10-17 16:30:13 +00:00
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
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
cb97d06489 * sc->fips is only defined if we have HAVE_FIPS
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@926614 13f79535-47bb-0310-9956-ffa450edef68
2010-03-23 15:25:40 +00:00
f78ddd0f6c Fix BOOL fips handling for UNSET values, and hack a vc compiler warning
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@926000 13f79535-47bb-0310-9956-ffa450edef68
2010-03-22 08:47:26 +00:00
7eb4e714ae Introduce SSLFIPS directive to support OpenSSL FIPS_mode; permits all
builds of mod_ssl to use 'SSLFIPS off' for portability, but the proper
build of openssl is required for 'SSLFIPS on'.  

PR: 46270  
Submitted by: Dr Stephen Henson <steve openssl.org>, wrowe



git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@925980 13f79535-47bb-0310-9956-ffa450edef68
2010-03-22 06:53:41 +00:00
1d17660c10 fix comment typo
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907880 13f79535-47bb-0310-9956-ffa450edef68
2010-02-09 01:59:59 +00:00
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
4b0455e133 * Use correct #ifndef's to compile again on openssl 0.9.8 and fix compiler
warnings.

Noted by: sf


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@835046 13f79535-47bb-0310-9956-ffa450edef68
2009-11-11 20:27:10 +00:00
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
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
b2cb650f61 Add support for OCSP "stapling":
* modules/ssl/ssl_util_stapling.c: New file.

* modules/ssl/config.m4, modules/ssl/mod_ssl.dsp: Build it.

* modules/ssl/ssl_toolkit_compat.h: Define HAVE_OCSP_STAPLING if
  OpenSSL is of suitable version (>= 0.9.8g) and capability (TLS
  extension support enabled).

* modules/ssl/mod_ssl.c: Add config directives.

* modules/ssl/ssl_private.h: Add prototypes for new functions.
  (SSLModConfigRec): Add fields for stapling socache instance and
  associated mutex.
  (modssl_ctx_t): Add config fields for stapling.

* modules/ssl/ssl_engine_init.c (ssl_init_Module, ssl_init_Child):
  Call the stapling initialization functions.

* modules/ssl/ssl_engine_config.c: Add config hooks.

* modules/ssl/ssl_scache.c: Create, initialize and destroy the socache
  instance for OCSP responses.

Submitted by: Dr Stephen Henson <shenson oss-institute.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@829619 13f79535-47bb-0310-9956-ffa450edef68
2009-10-25 17:21:10 +00:00
cea543cf79 removed another obsolete cast. Mentioned by Peter Sylvester.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@798989 13f79535-47bb-0310-9956-ffa450edef68
2009-07-29 17:42:49 +00:00
3175d7782f removed obsolete cast. Mentioned by Peter Sylvester.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@798274 13f79535-47bb-0310-9956-ffa450edef68
2009-07-27 20:22:59 +00:00
7d5d67750c Clean up more compiler emits. Add CHANGES entry, credit Kasper for the OpenSSL STACK fix
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@749466 13f79535-47bb-0310-9956-ffa450edef68
2009-03-02 23:17:53 +00:00
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