1
0
mirror of https://github.com/apache/httpd.git synced 2025-08-07 04:02:58 +03:00

233 Commits

Author SHA1 Message Date
Ruediger Pluem
32f02f6e0a * Add missing prototype
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1161005 13f79535-47bb-0310-9956-ffa450edef68
2011-08-24 08:41:12 +00:00
Daniel Ruggeri
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
Kaspar Brand
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
Kaspar Brand
2453c22a1a Enforce OpenSSL 0.9.7 as a minimum requirement in configure, and
remove #ifdef'ed code which was relevant for earlier versions only.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1154688 13f79535-47bb-0310-9956-ffa450edef68
2011-08-07 10:36:57 +00:00
Kaspar Brand
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
Kaspar Brand
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
Stefan Fritsch
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
Joe Orton
32c4496dd3 * modules/ssl/ssl_private.h: Drop some redundant/unused macros; pick
up stdlib.h.

* modules/ssl/ssl_engine_pphrase.c (ssl_pphrase_Handle),
  modules/ssl/ssl_engine_vars.c: Stop pretending mod_ssl has a version
  independent of the rest of the server.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1082202 13f79535-47bb-0310-9956-ffa450edef68
2011-03-16 16:51:46 +00:00
Joe Orton
d928f735f8 * modules/ssl/ssl_engine_pphrase.c (ssl_pphrase_Handle): Simplify to
calculate hash index only once per loop iteration; no (intended)
  functional change.  Add comments and tweak a log message.

* modules/ssl/ssl_private.h: Add comments.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1069765 13f79535-47bb-0310-9956-ffa450edef68
2011-02-11 12:05:31 +00:00
Joe Orton
1f97575296 * modules/ssl/ssl_private.h: Clarify comment on modssl_pk_server_t.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1069725 13f79535-47bb-0310-9956-ffa450edef68
2011-02-11 09:48:00 +00:00
Joe Orton
271de81e7c * modules/ssl/ssl_engine_config.c, modules/ssl/ssl_private.h: Add
config hooks for OCSP response time skew, maximum age, timeout.

* modules/ssl/ssl_engine_ocsp.c (verify_ocsp_status): Respect
  config settings for above.

* docs/: Update accordingly.

Submitted by: Kaspar Brand <httpd-dev.2011 velox.ch>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1059917 13f79535-47bb-0310-9956-ffa450edef68
2011-01-17 13:27:03 +00:00
Stefan Fritsch
7403827278 Change the format of the SSL_{CLIENT,SERVER}_{I,S}_DN variables
to be RFC 2253 compatible, convert non-ASCII characters to UTF8, and 
escape other special characters with backslashes. The old format can
still be used with the LegacyDNStringFormat argument to SSLOptions.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1054323 13f79535-47bb-0310-9956-ffa450edef68
2011-01-01 23:56:24 +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
Stephen Henson
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
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
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
9d791e0e60 Fix some modules to make them compile with per-module loglevels.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@951894 13f79535-47bb-0310-9956-ffa450edef68
2010-06-06 16:56:08 +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
William A. Rowe Jr
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
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
William A. Rowe Jr
54e9063b80 Style guides at httpd are pretty clear, macro values are UPCASE, please?
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@907472 13f79535-47bb-0310-9956-ffa450edef68
2010-02-07 20:25:21 +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
Jeff Trawick
2e9668a33d Replace AcceptMutex, LockFile, RewriteLock, SSLMutex, SSLStaplingMutex,
and WatchdogMutexPath with a single Mutex directive.  Add APIs to
simplify setup and user customization of APR proc and global mutexes.  
(See util_mutex.h.)  Build-time setting DEFAULT_LOCKFILE is no longer
respected; set DEFAULT_REL_RUNTIMEDIR instead.

Some existing modules, such as mod_ldap and mod_auth_digest gain 
configurability for their mutexes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883540 13f79535-47bb-0310-9956-ffa450edef68
2009-11-23 23:17:51 +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
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
Daniel Earl Poirier
04fd4abf90 Fix a lot of doxygen warnings. Thanks to Brad Hards for the patch.
I added a few more fixes, and there are still more that might
need a doxygen expert.

PR: 48061
Submitted by: Brad Hards
Reviewed by: poirier


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@830527 13f79535-47bb-0310-9956-ffa450edef68
2009-10-28 13:25:49 +00:00
Joe Orton
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
Joe Orton
229ca83b8f * modules/ssl/ssl_util_ocsp.c (send_request,
modssl_dispatch_ocsp_request): Take timeout as argument, as pass through.
  
* modules/ssl/ssl_engine_ocsp.c (verify_ocsp_status): Pass server timeout
  to modssl_dispatch_ocsp_request.

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


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@815719 13f79535-47bb-0310-9956-ffa450edef68
2009-09-16 10:56:31 +00:00
Ruediger Pluem
8627001684 * As proposed by wrowe on list always define SSLStrictSNIVHostCheck, but error
out if we are not compiled against an SNI capable OpenSSL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@770907 13f79535-47bb-0310-9956-ffa450edef68
2009-05-02 07:47:59 +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
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
Jeff Trawick
e0eb7d1eef Introduce a new set of APIs to allow MPMs to be proper modules instead
of integral parts which share global variables, functions, and macros
with the rest of httpd.

Converted now:
  prefork, worker, event, simple, WinNT*

*WinNT hasn't been built or tested, and relies on a hack to include the
WinNT mpm.h to disable Unixy MPM support routines in mpm_common.c


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@757853 13f79535-47bb-0310-9956-ffa450edef68
2009-03-24 15:43:59 +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
5a83c545be * modules/ssl/ssl_private.h: Add a big fat warning about
the SSLModConfigRec lifetime.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@724802 13f79535-47bb-0310-9956-ffa450edef68
2008-12-09 18:11:36 +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
Sander Temme
e35f22e5a5 Move struct definition out of the header file since it is only used in this source file
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@687819 13f79535-47bb-0310-9956-ffa450edef68
2008-08-21 18:19:21 +00:00
Sander Temme
c31e8fbb73 Implement dynamic mutex callbacks for the benefit of OpenSSL.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@687550 13f79535-47bb-0310-9956-ffa450edef68
2008-08-21 04:20:21 +00:00
Joe Orton
759da80c79 Session cache interface redesign, Part 9:
Switch mod_ssl to use the ap_socache interface.

* modules/ssl/ssl_scache_shmcb.c, modules/ssl/ssl_scache_memcache.c,
  modules/ssl/ssl_scache_dc.c, modules/ssl/ssl_scache_dbm.c: Remove
  files.

* modules/ssl/mod_ssl.c (modssl_register_scache): Remove function.

* modules/ssl/ssl_private.h: Remove modssl_sesscache_provider etc.
  (SSLModConfigRec): Switch to using socache types.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLSessionCache): Switch to
  use socache provider.

* modules/ssl/ssl_engine_mutex.c, modules/ssl/ssl_scache.c: Switch to
  using socache constants.

* modules/ssl/config.m4: Drop distache/memcache configuration, remove
  old objects.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@645940 13f79535-47bb-0310-9956-ffa450edef68
2008-04-08 14:21:24 +00:00
Joe Orton
0bd3fe5704 Session cache interface redesign, Part 7:
Clean up provider interface, removing use of mod_ssl-specific types:

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Replace BOOL
  with apr_status_t, UCHAR with unsigned char; use 'unsigned int' for
  idlen; constify id arguments; remove pool argument from ->status.

* modules/ssl/ssl_scache_dc.c, modules/ssl/ssl_scache_memcache,
  modules/ssl/ssl_scache_shmcb.c, modules/ssl_scache_dbm.c: Update
  accordingly.

* modules/ssl/ssl_scache.c (ssl_scache_retrieve, ssl_scache_store):
  Adjust for BOOL->apr_status_t change.
  (ssl_ext_status_hook): Update for dropped pool argument.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@633526 13f79535-47bb-0310-9956-ffa450edef68
2008-03-04 16:14:10 +00:00
Joe Orton
735b3b7b43 Session cache interface redesign, Part 6:
Move mutex handling up out of the session cache providers:

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Add name and 
  flags fields.  Define MODSSL_SESSCACHE_FLAG_NOTMPSAFE constant.

* modules/ssl/ssl_scache.c (ssl_scache_store, ssl_scache_retrieve,
  ssl_scache_remove, ssl_ext_status_hook): Lock and release the mutex
  around provider calls, if necessary.

* modules/ssl/ssl_engine_mutex.c (ssl_mutex_init): Do nothing if no
  session cache is configured, or the session cache does not require a
  mutex.  Otherwise, fail if no mutex is configured and the session
  cache *does* require a mutex.
  (ssl_mutex_on, ssl_mutex_off): Remove checks for mutex mode;
  functions now invoked only if necessary.

* modules/ssl/ssl_scache_dc.c, modules/ssl/ssl_scache_memcache: Set
  name and flags fields in provider structures.

* modules/ssl/ssl_scache_shmcb.c, modules/ssl_scache_dbm.c: Remove
  mutex handling through; set name and flags fields in provider
  structures; mark both as unsafe for concurrent access in flags.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@631297 13f79535-47bb-0310-9956-ffa450edef68
2008-02-26 16:57:56 +00:00
Joe Orton
b6317ebc81 Session cache interface redesign, Part 5:
Use the ap_provider interface for session cache storage providers.

* modules/ssl/mod_ssl.c (modssl_register_scache): New function.
  (ssl_register_hooks): Call it.

* modules/ssl/ssl_private.h: Define MODSSL_SESSCACHE_PROVIDER_GROUP
  and MODSSL_SESSCACHE_PROVIDER_VERSION constants.
  Remove ssl_scmode_t type.  Change nSessionCacheMode in
  SSLModConfigRec into a long sesscache_mode, storing the OpenSSL
  SSL_SESS_CACHE_* flags directly.

* modules/ssl/ssl_engine_config.c (ssl_config_global_create): Set
  sesscache_mode to SSL_SESS_CACHE_OFF by default.
  (ssl_cmd_SSLSessionCache): Remove ifdef spaghetti; fetch configured
  session cache by provider name.  Set mc->sesscache_mode for
  configured providers.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_session_cache): Use the
  configured mode flags directly from mc->sesscache_mode.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@631000 13f79535-47bb-0310-9956-ffa450edef68
2008-02-25 21:28:09 +00:00
Joe Orton
09e2a2f67a Session cache interface redesign, Part 4:
Move provider-specific configuration handling down into the provider
code.  Eliminate all use of SSLModConfigRec within provider code.

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Add 'create'
  function which creates and configures the cache provider, before
  initialisation.  Change 'init' function to take the context pointer
  as an input parameter, and reorder to be first.

* modules/ssl/ssl_scache.c (ssl_scache_init): Adjust accordingly.

* modules/ssl/ssl_scache_memcache.c (struct context): Add servers
  field.
  (ssl_scache_mc_create): New function.
  (ssl_scache_mc_init): Use servers from context not SSLModConfigRec.

* modules/ssl/ssl_scache_dbm.c (struct context): Define.
  (ssl_scache_dbm_create): New function.
  (ssl_scache_dbm_init, ssl_scache_dbm_kill): Adjust to use filename
  and pool from context.
  (ssl_scache_dbm_store, ssl_scache_dbm_retrieve,
  ssl_scache_dbm_status): Use filename from context.  Use context pool
  for temp storage of the DBM object, and clear before use.
  (ssl_scache_dbm_expire): Remove static tLast; use last_expiry from
  context.  Use context pool for temp storage and clear before use.

* modules/ssl/ssl_scache_dc.c (struct context): Add target field.
  (ssl_scache_dc_init, ssl_scache_dc_status): Use target from context.

* modules/ssl/ssl_scache_shmcb.c (struct context): Add data_file,
  shm_size fields.
  (ssl_scache_shmcb_create): New function; moved argument parsing
  logic from ssl_cmd_SSLSessionCache
  (ssl_scache_shmcb_init, ssl_scache_shmcb_status): Use config from
  context.

* modules/ssl/ssl_engine_config.c (ssl_config_global_create): Remove
  handling of old provider-specific fields.
  (ssl_cmd_SSLSessionCache): Call provider ->create function to parse
  the argument and create provider-specific context structure.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630974 13f79535-47bb-0310-9956-ffa450edef68
2008-02-25 20:09:38 +00:00
Joe Orton
c4739e5855 * modules/ssl/ssl_private.h: Specify extern storage for
modssl_sesscache_provider objects.

Found by: rpluem


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630795 13f79535-47bb-0310-9956-ffa450edef68
2008-02-25 10:36:25 +00:00
Joe Orton
33c310cec6 Session cache interface redesign, Part 3:
Move provider-private context out of SSLModConfigRec and into an
opaque context pointer.  Use real error propagation in the ->init
functions rather than ssl_die().

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Take a
  context out-parameter from ->init, and return an apr_status_t.
  Add context pointer as first arg for the other function types.
  (SSLModConfigRec): Remove tSessionCacheData* fields; add
  sesscache_context field.

* modules/ssl/ssl_scache.c (ssl_scache_init): Move once-per-process
  invocation check back into here.  
  (ssl_scache_*): Adjust to use context pointer.

* modules/ssl/ssl_scache_shmcb.c, modules/ssl/ssl_scache_dc.c,
  modules/ssl/ssl_scache_dbm.c: Adjust all implementations to use
  opaque context pointer.

* modules/ssl/ssl_scache_memcache.c: Move memcache context into the
  context structure rather than using global state.

* modules/ssl/ssl_engine_config.c: Remove handling of
  pSessionCacheData* fields in SSLModConfigRec.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630323 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 21:09:40 +00:00
Joe Orton
db8d709066 Move SSL session data deserialization up out of the session cache
storage providers; includes a significant change to the shmcb storage
structure:

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Change
  retrieve function to take dest/destlen output buffer, to take a
  constant id paramater, and to return a BOOL.

* modules/ssl/ssl_scache.c (ssl_scache_retrieve): Update accordingly,
  perform SSL deserialization here.

* modules/ssl/ssl_scache_dc.c (ssl_scache_dc_retrieve),
  modules/ssl/ssl_scache_dbm.c (ssl_scache_dbm_retrieve),
  modules/ssl/ssl_scache_memcache.c (ssl_scache_mc_retrieve):
  Update accordingly.

* modules/ssl/ssl_scache_shmcb.c: Store the whole ID in the cache
  before the data, so that each index can be compared against the
  requested ID without deserializing the data.  This requires approx
  20% extra storage per session in the common case, though should
  reduce CPU overhead in some retrieval paths.
  (SHMCBIndex): Replace s_id2 field with id_len.
  (shmcb_cyclic_memcmp): New function.
  (ssl_scache_shmcb_init): Change the heuristics to allow for increase
  in per-session storage requirement.
  (ssl_scache_shmcb_retrieve): Drop requirement on ID length.
  (shmcb_subcache_store): Store the ID in the cyclic buffer.
  (shmcb_subcache_retrieve, shmcb_subcache_remove): Compare against
  the stored ID rather than deserializing the data.
  (ssl_scache_shmcb_retrieve, ssl_scache_shmcb_store): Update
  accordingly.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630307 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 19:58:39 +00:00
Joe Orton
9662049374 Move SSL session data serialization up out of the session cache
storage providers:

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Change
  'store' interface to take a data/length pair rather than an
  SSL_SESSION pointer.

* modules/ssl/ssl_scache.c (ssl_scache_store): Serialize the SSL 
  session here and pass down the raw DER.

* modules/ssl/ssl_scache_dc.c, modules/ssl_scache_mc.c,
  modules/ssl_scache_shmcb.c, modules/ssl_scache_dbm.c: Adjust ->store
  implementations accordingly, removing the four sets of identical
  code doing the i2d dance.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630168 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 12:00:49 +00:00
Joe Orton
fb38ad47ec Re-implement the SSL session cache abstraction using a vtable; first
step towards use of the ap_provider interface:

* modules/ssl/ssl_private.h (modssl_sesscache_provider): Add new
  vtable type.
  (SSLModConfigRec): Reference the vtable here.
  Replace all the ssl_scache_* prototypes with provider vtable objects.

* modules/ssl/ssl_scache.c (ssl_scache_init, ssl_scache_kill, 
  ssl_scache_retrieve, ssl_scache_store, ssl_scache_remove,
  ssl_ext_status_hook): Use callbacks from vtable rather than ifdef
  spaghetti.

* modules/ssl/ssl_engine_init.c (ssl_init_ctx_session_cache):
  Only install the OpenSSL callbacks if a vtable is configured.

* modules/ssl/ssl_engine_config.c (ssl_cmd_SSLSessionCache): Set up
  vtable pointer.

* modules/ssl/ssl_scache_dc.c, modules/ssl_scache_mc.c: Adjust to make
  implementations static, and add vtable definition.

* modules/ssl_scache_shmcb.c: Likewise; also move the init
  one-per-process requirement down here.

* modules/ssl_scache_dbm.c: Likewise; also (temporarily) use a local
  subpool in the store callback.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@630163 13f79535-47bb-0310-9956-ffa450edef68
2008-02-22 11:36:51 +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