1
0
mirror of https://github.com/apache/httpd.git synced 2025-06-07 20:02:05 +03:00

129 Commits

Author SHA1 Message Date
Jeff Trawick
8a0bef5873 mod_ssl uses free() inappropriately in several places, to free
memory which has been previously allocated inside OpenSSL.
Such memory should be freed with OPENSSL_free(), not with free().

Submitted by: Nadav Har'El <nyh@math.technion.ac.il>,
              Madhusudan Mathihalli <madhusudan_mathihalli@hp.com>
Reviewed by:  Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97307 13f79535-47bb-0310-9956-ffa450edef68
2002-10-25 21:44:28 +00:00
Ryan Bloom
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
Ryan Bloom
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
Cliff Woolley
67891efa2f fix the infinite recursion problem with HTTP-on-the-HTTPS port.
Reported by:  Paul J. Reder
Submitted by: Ryan Bloom


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95604 13f79535-47bb-0310-9956-ffa450edef68
2002-06-11 04:54:01 +00:00
Doug MacEachern
295e115b4a in case there is actually a cert chain in the cache, we should be
using the value of SSL_get_peer_certificate(ssl) to verify as it will
have been removed from the chain before it was put in the cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95603 13f79535-47bb-0310-9956-ffa450edef68
2002-06-11 03:45:54 +00:00
Doug MacEachern
db7a29e3b7 PR:
Obtained from:
Submitted by:
Reviewed by:
allow POST method over SSL when per-directory client cert
authentication is used with 'SSLOptions +OptRenegotiate' enabled
and a client cert was found in the ssl session cache.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95602 13f79535-47bb-0310-9956-ffa450edef68
2002-06-11 03:19:27 +00:00
Doug MacEachern
5f0320d1c1 PR:
Obtained from:
Submitted by:
Reviewed by:
'SSLOptions +OptRengotiate' will use client cert in from the ssl
session cache when there is no cert chain in the cache.  prior to
the fix this situation would result in a FORBIDDEN response and
error message "Cannot find peer certificate chain"


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95601 13f79535-47bb-0310-9956-ffa450edef68
2002-06-11 03:12:33 +00:00
Ryan Bloom
37f858acc6 Remove all special mod_ssl URIs. This also fixes the bug where
redirecting (.*) will allow an SSL protected page to be viewed
without SSL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95501 13f79535-47bb-0310-9956-ffa450edef68
2002-06-04 07:12:26 +00:00
Jeff Trawick
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
Justin Erenkrantz
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
Justin Erenkrantz
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
Justin Erenkrantz
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
Doug MacEachern
7bb6d7d1ee PR:
Obtained from:
Submitted by:
Reviewed by:
avoid the error_log message: [error] mod_ssl: Certificate Verification: Error ...
if SSLProxyVerify is not configured or set to "none".
the verify callback does not happen in the server context when
SSLVerify is not configured or set to "none".


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94444 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 02:31:04 +00:00
Doug MacEachern
140006b5b1 add/use EVP_PKEY_reference_inc and X509_reference_inc compat macros
to get these changes working with sslc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94341 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 08:11:44 +00:00
Doug MacEachern
663baf331b pass sc to myCtxConfig macro
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94337 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 06:38:10 +00:00
Doug MacEachern
97b59112b8 make it possible for proxy to use CRL callback
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94336 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 06:36:56 +00:00
Doug MacEachern
0d93dc2686 change sc->server references to myCtxConfig, so proxy can use the
verify callback.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94332 13f79535-47bb-0310-9956-ffa450edef68
2002-03-30 06:03:08 +00:00
Doug MacEachern
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
Doug MacEachern
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
Doug MacEachern
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
Doug MacEachern
aeb7f9eb0b add configure checks for ssl functions:
-SSL_set_state: macro in OpenSSL, might be a function in a patched sslc
-SSL_set_cert_store: patch submitted to OpenSSL, might be applied to
OpenSSL or sslc


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94223 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 17:02:56 +00:00
Doug MacEachern
e6392769aa 2nd arg to SSL_set_cipher_list in sslc is char *
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94205 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 03:11:22 +00:00
Doug MacEachern
66419ef565 sslc 1.x SSL_set_verify only takes 2 args
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94204 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 03:09:11 +00:00
Doug MacEachern
7f4a6ff760 sslc adds a second, unused param to X509_verify_cert
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94202 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 03:02:10 +00:00
Doug MacEachern
ebe92b6f8b add modssl_session_get_time() function to give mod_ssl what it needs
from SSL_SESSION_get_time() if using OpenSSL or sslc.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94195 13f79535-47bb-0310-9956-ffa450edef68
2002-03-27 01:28:20 +00:00
Doug MacEachern
7c1521f253 per-dir SSLCACertificate{File,Path} cannot use SSL_CTX_set_cert_store
as the 1.x based module does, since the function is not thread-safe.
a patch has been submitted to OpenSSL to support SSL_set_cert_store
which is thread safe.  this feature is enabled by default in the
current 1.x based module, we only enable it if the SSL_set_cert_store
function is available.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94179 13f79535-47bb-0310-9956-ffa450edef68
2002-03-26 16:57:49 +00:00
Cliff Woolley
5a52f372e4 Fix a possibly-uninitialized warning and a boolean logic bug
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93992 13f79535-47bb-0310-9956-ffa450edef68
2002-03-18 03:19:30 +00:00
Roy T. Fielding
845cbfd508 Update our copyright for this year.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93918 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 20:48:07 +00:00
Doug MacEachern
7d097d17ad generalize session logging into ssl_session_log() function
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93906 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 17:02:45 +00:00
Doug MacEachern
ed35c47220 SSL_SESSION_id2sz() was NOT THREAD SAFE. it returned a pointer to a
static variable.  fixed.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93899 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 06:41:46 +00:00
Doug MacEachern
ccaced8c5d SSL_SESSION_id2sz() is somewhat expensive, make sure we only call it
if SSLLogLevel >= info


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93898 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 06:12:24 +00:00
Doug MacEachern
5de4869446 cleanup logging of CRL, includes ridding of some malloc/frees
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93897 13f79535-47bb-0310-9956-ffa450edef68
2002-03-13 05:30:43 +00:00
Doug MacEachern
63e70cd522 cleanup tmp key callbacks. each had assigned the same (1024 bit) value
in 3 different places.  the old code did nothing special in the case
of the export flag either.

add an ssl_log in each to trace when keys are being handed out.

add some XXX comments.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93885 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 23:42:53 +00:00
Doug MacEachern
d9d26c6b82 for the sake of readablity,
change: SSL_TKPIDX_{DH,RSA}{512,1024}
to:     SSL_TMP_KEY_{DH,RSA}_{512,1024}


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93883 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 23:05:33 +00:00
Doug MacEachern
72814e709a dropping hungarian notation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93851 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 04:41:57 +00:00
Doug MacEachern
1fcbc73b13 various style fixups / general changes to make code more readable.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93848 13f79535-47bb-0310-9956-ffa450edef68
2002-03-12 01:40:02 +00:00
Doug MacEachern
5f33a419b4 don't allocate SSLConnRec unless ssl is enabled on this vhost.
also provides a shorter shortcut for mod_ssl hooks to decline if ssl
is not enabled.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93823 13f79535-47bb-0310-9956-ffa450edef68
2002-03-10 00:22:07 +00:00
Cliff Woolley
0f45e62dcd Forward port of changes in mod_ssl for Apache 1.3 up through mod_ssl
version 2.8.7-1.3.23.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93564 13f79535-47bb-0310-9956-ffa450edef68
2002-02-25 04:23:03 +00:00
Cliff Woolley
7b7ec65b73 Silence a gcc warning about cpType being possibly used uninitialized,
and constify it while I'm at it.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93188 13f79535-47bb-0310-9956-ffa450edef68
2002-02-03 01:50:58 +00:00
Martin Kraemer
9aaf89fa5c Use symbolic names
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93130 13f79535-47bb-0310-9956-ffa450edef68
2002-01-31 14:55:05 +00:00
Doug MacEachern
f2e97102ce rewrite of mod_ssl input filter for better performance and less memory usage
PR:
Obtained from:
Submitted by:
Reviewed by:	Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92873 13f79535-47bb-0310-9956-ffa450edef68
2002-01-17 00:54:33 +00:00
Doug MacEachern
c53456b4c1 mod_ssl adjustments to help with using toolkits other than OpenSSL:
Use SSL functions/macros instead of directly dereferencing SSL
  structures wherever possible.
  Add type-casts for the cases where functions return a generic pointer.
  Add $SSL/include to configure search path.
PR:
Obtained from:
Submitted by:	Madhusudan Mathihalli <madhusudan_mathihalli@hp.com>
Reviewed by:	dougm


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92800 13f79535-47bb-0310-9956-ffa450edef68
2002-01-10 04:55:19 +00:00
Doug MacEachern
4e29aa9d4d get rid of warning introduced by previous patch
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92245 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 07:30:30 +00:00
Doug MacEachern
d06327e27b the client cert X509_NAME_oneline() is only used if SSLFakeBasicAuth
is happening.  so avoid calling that unless needed and just stash a
pointer to the client cert for the boolean checks that the client
provided a cert.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92240 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 07:07:36 +00:00
Doug MacEachern
6dd4b15f65 avoid a call to X509_NAME_oneline() and ASN1_INTEGER_get() in
ssl_callback_SSLVerify_CRL() unless SSLLogLevel >= info, otherwise the
expense is unused.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92238 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 06:52:18 +00:00
Doug MacEachern
6259b77f33 get rid of ssl_log_applies() function. it does more than we need and
what should be done with a macro.  it was only used once anyhow.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92237 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 06:34:53 +00:00
Doug MacEachern
a2daa5ab2b ssl_callback_SSLVerify() was calling (the expensive) X509_NAME_oneline()
function and free() of the return value twice each, for logging
regardless of SSLLogLevel.  changed to happen only if SSLLogLevel >= trace
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92236 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 06:27:41 +00:00
Doug MacEachern
29ba8b4f1d ssl_util_getmodconfig() and ssl_util_getmodconfig_ssl() show up high
in the gprof profile.  there's no need for the "global" SSLModConfigRec
to live in the s->process->pool userdata table.  we now just point the
SSLSrvConfigRec in each server_rec.module_config to the SSLModConfigRec
so we can access it directly which is much faster.
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92234 13f79535-47bb-0310-9956-ffa450edef68
2001-11-29 05:45:48 +00:00
Doug MacEachern
e11207af62 remove setting of ap::{http::method,default::port} r->notes.
these notes are unused, they handled by hooks.

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92210 13f79535-47bb-0310-9956-ffa450edef68
2001-11-28 04:24:07 +00:00
Doug MacEachern
758b54d0fd don't bother setting the ssl info callback unless SSLLogLevel >= info
PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92151 13f79535-47bb-0310-9956-ffa450edef68
2001-11-24 00:40:15 +00:00