1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-16 15:00:58 +03:00
Commit Graph

119 Commits

Author SHA1 Message Date
2c999f855a * modules/ssl/ssl_engine_init.c (ssl_init_proxy_certs): Fail early
(rather than segfault later) if a client cert is configured which is
missing either the certificate or private key.

PR: 24030


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101878 13f79535-47bb-0310-9956-ffa450edef68
2003-11-25 12:35:45 +00:00
aa21671e13 switch to APR 1.0 API (which is still in flux)
because of the changes to the argument lists of apr_mmap_dup and apr_socket_create,
2.1-dev won't build with apr and apr-util's 0.9 branch anymore


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101154 13f79535-47bb-0310-9956-ffa450edef68
2003-09-03 19:27:12 +00:00
8606e3c92a Although we initialize mc->pid in the child init phase,
we haven't initialized it before initially performing
  our ssl_rand_seed() in the parent/postconfig phase.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100912 13f79535-47bb-0310-9956-ffa450edef68
2003-08-05 22:49:42 +00:00
1e0682040d Reaction to Jeff Trawick's observations that we are double-initializing
dynalinked OpenSSL Engines and Configs.  Move the library teardown code
  so that it is torn down in the proper order, corresponding to when the
  library itself was initialized.  And leave a little reminder that some
  memory diagnostics would be good if OpenSSL is built for malloc debugging.

Suggested by: Geoff Thorpe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100288 13f79535-47bb-0310-9956-ffa450edef68
2003-06-17 17:44:40 +00:00
282d19b590 Solve a pretty horrific bug in SSLCryptoDevice and other places where
the config cmd processors should be examining the SSL context.  We must
  initialize the SSL library before we can actually obtain any useful
  information from the SSL library.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100107 13f79535-47bb-0310-9956-ffa450edef68
2003-05-30 20:58:55 +00:00
fb9c4b137c Based on list discussion between myself and Geoff, it seems prudent
to check for both the existence of the openssl/engine.h header file
  and some 'expected function' such as ENGINE_init() (better suggestions
  are welcome.)  Also clear up some confusion; so long as we have
  ENGINE_load_builtin_engines() we should attempt to preload those.

  This patch protects all ENGINE-based code within the tests for the
  engine header and function, and changes a version test into a
  function test.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100104 13f79535-47bb-0310-9956-ffa450edef68
2003-05-30 18:41:53 +00:00
a5708f15e6 Roll away the SSL_EXPERIMENTAL_ENGINE test in favor of testing for the
ENGINE_init() function in config.m4, and rely on HAVE_ENGINE_INIT instead.

Reviewed by: Ben Laurie (concept)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99919 13f79535-47bb-0310-9956-ffa450edef68
2003-05-19 14:48:47 +00:00
e25454c894 Introduce a number of SSLC hints to mod_ssl, including the following
type overrides;

    MODSSL_CLIENT_CERT_CB_ARG_TYPE
    MODSSL_PCHAR_CAST      (for a host of non-void/const sslc values)
    modssl_read_bio_cb_fn  (for several callbacks with same prototypes)

  Declare callback functions appropriately.

  And protect us from indetermineant toolkits with
  #error "Unrecognized SSL Toolkit!"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99183 13f79535-47bb-0310-9956-ffa450edef68
2003-04-03 04:54:20 +00:00
27b6a574d3 DougM confirms Madhu's suspicions, this change was inadvertent.
Reverting to no longer skip the first cert in the chain.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98896 13f79535-47bb-0310-9956-ffa450edef68
2003-03-06 08:43:39 +00:00
742af25096 finished that boring job:
update license to 2003.

Happy New Year! ;-))


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98573 13f79535-47bb-0310-9956-ffa450edef68
2003-02-03 17:53:28 +00:00
8803963b14 After introducing tests in the cmds, we lose the absolute authority
of the CRYPTO_malloc_init() which must happen the moment we load the
  module and prior to *any* ssl library fn invocation.

  Moved the CRYPTO_malloc_init() into the ssl_register_hooks() function,
  the absolute first call made into any loaded module.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98252 13f79535-47bb-0310-9956-ffa450edef68
2003-01-13 17:10:42 +00:00
d0dd7a4711 All we care about is the type and name, just ask for the type and name.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98090 13f79535-47bb-0310-9956-ffa450edef68
2002-12-23 09:09:21 +00:00
2f62c790c7 After some productive feedback and no negative feedback, introduce
SSLEngine upgrade so that we can begin and continue to support these
  facilities.  This makes it simpler to keep this effort (while we have
  no known clients that support Connection: upgrade at this time), and
  begin refactoring more of SSL into smaller and tighter (and then optional)
  components.

  Submitted by: Ryan Bloom
  Reviewed by: William Rowe, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97912 13f79535-47bb-0310-9956-ffa450edef68
2002-12-14 07:46:45 +00:00
55149170fb Rearrange OpenSSL engine initialization to support RAND
redirection on crypto accelerator.

Submitted by:     Frederic DONNAT <frederic.donnat@zencod.com>
Reviewed by:	  Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97482 13f79535-47bb-0310-9956-ffa450edef68
2002-11-11 13:16:17 +00:00
ac212ecc65 Fix memory leak in mod_ssl from internal SSL library allocations
within SSL_get_peer_certificate and X509_get_pubkey.

Submitted by:	Zvi Har'El <rl@math.technion.ac.il>
Reviewed by:	Madhusudan Mathihalli <madhusudan_mathihalli@hp.com>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97344 13f79535-47bb-0310-9956-ffa450edef68
2002-10-29 21:12:34 +00:00
658c2437bd This stuff shouldn't have been committed. This is the SSL upgrade stuff,
and it was included in a commit that shouldn't have touched these files.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97201 13f79535-47bb-0310-9956-ffa450edef68
2002-10-14 04:15:58 +00:00
37f9061757 Fix a compile of compiler warnings. I don't know how these slipped past.
Also, uncomment a line of code that the last commit should have uncommented.
Randall found this line and the fix, but I forgot to uncomment this line
along with the fix.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97179 13f79535-47bb-0310-9956-ffa450edef68
2002-10-11 15:29:22 +00:00
2604f8bdbb Changes for deprecated apr_is_fnmatch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95976 13f79535-47bb-0310-9956-ffa450edef68
2002-07-08 17:43:34 +00:00
40735dc8cd make some small steps towards getting the post config hook
to return an error rather than exiting directly


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95567 13f79535-47bb-0310-9956-ffa450edef68
2002-06-07 12:51:49 +00:00
4a621ec661 The only remaining question ... are nested or strictly unnested locks
expected by OpenSSL?  Right now I've left it as _DEFAULT for the platform
  preference.  Very simple code really - the server_rec was superfluous.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95497 13f79535-47bb-0310-9956-ffa450edef68
2002-06-04 02:19:33 +00:00
d9e9c7de3b prevent possible segv in ssl_init_CheckServers if s->addrs is NULL.
for example: <VirtualHost *:>, for which the core only spits out a warning:
 Name or service not known: Cannot resolve host name *: --- ignoring!


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95158 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 18:21:12 +00:00
50bac91072 stop using APLOG_NOERRNO in calls to ap_log_[pr]error()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95150 13f79535-47bb-0310-9956-ffa450edef68
2002-05-17 11:24:17 +00:00
fafabb637f Remove SSLLog and SSLLogLevel directives in favor of having mod_ssl use the
standard ErrorLog directives.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95129 13f79535-47bb-0310-9956-ffa450edef68
2002-05-16 06:09:13 +00:00
d0214d5ae7 Change mod_ssl from using ssl_log() to ap_log_error().
The issue is that ssl_log doesn't handle apr_status_t result codes.  This
leads to a number of places (esp. with mutexes) where the error codes get
lost.  Rather than extending ssl_log further, since mod_ssl is part of
our core, migrate to ap_log_error.  This means that mod_ssl no longer
does its own logging.

Most uses of SSL_ADD_ERRNO are now mapped correctly to apr_status_t values
(mainly because the APIs that used to return errnos are now APRized and
have apr_status_t codes available).

SSL_LOG_TRACE and SSL_LOG_DEBUG were mapped to the APLOG_DEBUG values.
mod_ssl prints out a LOT of debugging information, so mod_ssl with LogLevel
Debug may not be a good idea - perhaps mod_ssl should be less chatty.

Numerous printf type collisions were also resolved.

(The ssl logging code itself will be removed in a subsequent commit.)

This has been discussed on dev@httpd, but the fact that there isn't
much to review besides the mindless changes, I'm going to commit now
and rely on CTR if I screwed up anything on the translation.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95127 13f79535-47bb-0310-9956-ffa450edef68
2002-05-16 05:17:11 +00:00
d28c4dae36 Stop using SSL_ADD_SSLERR option in ssl_log() and replace with new
ssl_log_ssl_error() function that wraps ap_log_error instead.

This begins the migration from ssl_log() -> ap_log_error().  Divorcing
ourselves from the SSL_ADD_SSLERR option is required to make the next
pass easier.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95122 13f79535-47bb-0310-9956-ffa450edef68
2002-05-15 23:10:33 +00:00
78ee6051f8 copy-n-pasto: need to use SSL_X509_INFO_load_*path* on pkp->cert_path
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94405 13f79535-47bb-0310-9956-ffa450edef68
2002-04-02 21:57:31 +00:00
51bbfbacd5 enable the verify callback for proxy
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94334 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 06:20:16 +00:00
9ee8bc12b5 implement proxy client certificate callback
(uses SSLProxyMachineCertificate{File,Cert} when downstream server
requires a client certificate)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94329 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 05:40:02 +00:00
5021db7bd6 load SSLProxyMachineCertificate{File,Path}
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94324 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 01:50:10 +00:00
5e1c0e2c15 add SSLProxyEngine directive. this was not required in the 1.x based
mod_ssl because the SSL_CTX was created and configured for *every*
request.  unlike in 2.0 where we configure the proxy SSL_CTX at
startup time, which is much better for performance.  but we don't want
to configure a proxy context for every vhost if it isn't going to be
used, for the same reasons we don't create a server context for every
vhost unless SSLEngine is on.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94314 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 17:56:33 +00:00
f8ce625de8 init proxy context
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94292 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 04:48:01 +00:00
a24fd6a181 cleanup the proxy context
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94288 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:59:27 +00:00
7b86fe98a0 change existing ssl_init_ctx() to ssl_init_ctx_protocol()
new ssl_init_ctx() inits the lot: protocol, session_cache, callbacks,
verify, cipher suite, crl, cert_chain

new ssl_init_server_ctx function inits everything for sc->server


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94285 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:20:58 +00:00
6d42555a01 proxy will have a different verify callback
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94283 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:09:59 +00:00
192828c57c proxy needs to use client ssl method
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94282 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:06:57 +00:00
ea4cfaae7c setup sc->proxy->sc
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94281 13f79535-47bb-0310-9956-ffa450edef68
2002-03-29 02:01:49 +00:00
78b02f8110 switch from SSLSrvConfigRec* to modssl_ctx_t* in the ssl_init_ctx*
functions


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94274 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 19:48:31 +00:00
1d76ab39ff breakup SSLSrvConfigRec in preparation for proxy support:
+ modssl_pk_server_t - certs/keys for the server
+ modssl_pk_proxy_t  - certs/keys for the proxy
+ modssl_auth_ctx_t  - stuff related to authentication that can also
                       be per-dir, used by both server and proxy
+ modssl_ctx_t       - context that can be used by both server and proxy
+ SSLSrvConfigRec    - now contains original stuff specific to the
                       server config and modssl_ctx_t *server, *proxy


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94267 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 18:50:07 +00:00
d5c395f0e7 de-hungarian-ize server config member names which are going to stay
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94264 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 17:11:12 +00:00
d40a4f8d8e remove error msg hint that is no longer true
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94261 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:51:52 +00:00
5a392794c4 fixup naming:
ssl_init_ctx_* will be used for both proxy and server
 ssl_init_server_* is specific to the server


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94260 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:46:28 +00:00
f69256ac13 move context callback setting to ssl_init_ctx_callbacks function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94259 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:40:01 +00:00
972e8bdafe move server cert/key initialization to ssl_init_server_certs function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94258 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:36:05 +00:00
44f93970ac copy DSA params to server server during key import
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94257 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:28:06 +00:00
0a76ba100d fix logic from last commit, need to always try importing _both_ rsa
and dsa


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94256 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:09:58 +00:00
1712e063a9 fold some duplication into generic ssl_server_import_key function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94255 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 02:01:03 +00:00
b63b80acf5 fold some duplication into generic ssl_server_import_cert function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94253 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:47:50 +00:00
886376b4cb move server cert checking into generic ssl_check_public_cert function.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94252 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:32:41 +00:00
e6f3b17fd0 move server specific init config checks into ssl_init_check_server
function (ssl_init_check_proxy will be different)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94250 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:14:53 +00:00
52d5e83027 break out certificate chain initialization into
ssl_init_cert_chain function


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94249 13f79535-47bb-0310-9956-ffa450edef68
2002-03-28 01:07:20 +00:00