Commit Graph

221 Commits

Author SHA1 Message Date
e878bf757b * modules/ssl/ssl_engine_io.c (ssl_io_filter_disable,
ssl_io_filter_error): Clear the SSL * pointer in the SSLConnRec too.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102819 13f79535-47bb-0310-9956-ffa450edef68
2004-02-29 00:29:20 +00:00
3ca3524c31 Move mod_ssl-internal interfaces into ssl_private.h; allow mod_ssl.h
to be included even when mod_ssl is not enabled.

* Makefile.in (install-include): Only install mod_ssl.h.

* modules/ssl/ssl_private.h: New file.

* modules/ssl/mod_ssl.h: Move everything apart from than the optional
hook definitions into ssl_private.h.

* modules/ssl/*.c: Include ssl_private.h not mod_ssl.h

* modules/ssl/config.m4: Always add the mod_ssl directory to the
include path so other modules can find mod_ssl.h.

* modules/proxy/mod_proxy.c: Include mod_ssl.h to pick up the optional
hook definitions rather than copy'n'pasting them.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102803 13f79535-47bb-0310-9956-ffa450edef68
2004-02-28 18:06:35 +00:00
48c38a4533 Send the 'Close Alert' message to the peer upon closing a SSL session. This
required creating a new EOC (End-Of-Connection) bucket type to notify mod_ssl
that the connection is about to be closed.


Reviewed by: Joe Orton, Justin Erenkrantz


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102793 13f79535-47bb-0310-9956-ffa450edef68
2004-02-28 00:45:26 +00:00
0e34b8f5f4 * modules/ssl/ssl_engine_io.c (ssl_io_filter_disable): Don't leak an
SSL structure for each plain-HTTP-on-SSL-port request.

PR: 27106


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102770 13f79535-47bb-0310-9956-ffa450edef68
2004-02-25 10:54:29 +00:00
a688f06b19 fix name of The Apache Software Foundation
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102618 13f79535-47bb-0310-9956-ffa450edef68
2004-02-09 20:31:03 +00:00
0b6155c539 fix copyright dates according to the first check in
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102573 13f79535-47bb-0310-9956-ffa450edef68
2004-02-08 12:52:25 +00:00
4f02cb1e18 apply Apache License, Version 2.0
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102525 13f79535-47bb-0310-9956-ffa450edef68
2004-02-06 22:58:42 +00:00
812f43e569 * modules/ssl/ssl_engine_io.c (ssl_io_filter_output): Use non-blocking
bucket reads whilst data remains available; flush when a read returns
EAGAIN.  Fixes streaming nph- CGI scripts over SSL.

PR: 21944
Inspired by: Jeff Trawick


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102397 13f79535-47bb-0310-9956-ffa450edef68
2004-01-23 16:50:24 +00:00
fb07607180 update license to 2004.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102135 13f79535-47bb-0310-9956-ffa450edef68
2004-01-01 13:26:26 +00:00
4de16bd525 Fix format string warnings from gcc on amd64:
* modules/ssl/ssl_scache_dbm.c (ssl_scache_dbm_store):
Print apr_size_t using APR_SIZE_T_FMT.

* modules/ssl/ssl_engine_io.c (ssl_filter_write): Print difference
between sizes using APR_SSIZE_T_FMT, apr_size_t using APR_SIZE_T_FMT.

* modules/proxy/proxy_http.c (ap_proxy_http_request): Print
apr_uint64_t using APR_UINT64_T_HEX_FMT.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@102037 13f79535-47bb-0310-9956-ffa450edef68
2003-12-12 12:36:50 +00:00
c198e9b265 * ssl_engine_io.c (ssl_io_filter_connect): Check the
library code as well as the reason code when looking for the
plain-HTTP-request error.

Submitted by: Stephen Henson <steve@openssl.org>


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@101135 13f79535-47bb-0310-9956-ffa450edef68
2003-08-29 14:45:26 +00:00
eb49ea1f5c Prevent segfaults after SSL renegotiation failures.
* modules/ssl/ssl_engine_kernel.c (ssl_hook_Access): Set aborted flag
after renegotiation failure.

* modules/ssl/ssl_engine_io.c (ssl_filter_write, ssl_io_filter_output):
Don't dereference BIOs in filter_ctx when filter_ctx->pssl is NULL.
(ssl_filter_io_shutdown): Set aborted flag on abortive shutdown.

PR: 21370
Submitted by: Hartmut Keil <Hartmut.Keil@adnovum.ch>
Cleaned up by: Jeff Trawick, Joe Orton


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100720 13f79535-47bb-0310-9956-ffa450edef68
2003-07-21 12:02:40 +00:00
26f1ba8050 The patch below reverts the prior commit to eliminate SSL_set_state().
Some additional work or research is required in order to pass the
  perl-framework regressions, but I don't have the cycles and don't
  care to leave the broken code in cvs HEAD.

REVERTING: wrowe 2003/05/19 08:13:19

  Modified:    modules/ssl config.m4 ssl_engine_io.c ssl_engine_kernel.c
                        ssl_toolkit_compat.h
  Log:
    Drop SSL_set_state() in favor of a proper SSL_renegotiate() to begin
    rehandshaking the SSL connection, vis-a-vis ApacheSSL.

  Revision  Changes    Path
  1.15      +0 -1      httpd-2.0/modules/ssl/config.m4
  1.108     +1 -1      httpd-2.0/modules/ssl/ssl_engine_io.c
  1.93      +1 -1      httpd-2.0/modules/ssl/ssl_engine_kernel.c
  1.34      +0 -6      httpd-2.0/modules/ssl/ssl_toolkit_compat.h


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@100004 13f79535-47bb-0310-9956-ffa450edef68
2003-05-22 19:41:32 +00:00
1a6f1ae739 Drop SSL_set_state() in favor of a proper SSL_renegotiate() to begin
rehandshaking the SSL connection, vis-a-vis ApacheSSL.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99921 13f79535-47bb-0310-9956-ffa450edef68
2003-05-19 15:13:19 +00:00
9ba66751f2 Get the AP_ and APR_ prefixes right.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99879 13f79535-47bb-0310-9956-ffa450edef68
2003-05-16 21:16:35 +00:00
f066f6c662 Assure that we block on the read BIO when we invoke the read BIO for both
first-use cases (via ssl_io_input_add_filter) and when we are writing and
  need response from the client (via ssl_io_filter_output).  Both of these
  cases are always blocking.  [

PR: 19242
Submitted by:	David Deaves <David.Deaves@dd.id.au>, William Rowe


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99863 13f79535-47bb-0310-9956-ffa450edef68
2003-05-16 16:11:03 +00:00
067c217ce4 Reapply the fix *intended* by rev 1.79 in a safer manner. Prior to
all assignments and the final SSL_free(), free ssl_conn->client_cert
  to avoid leaks of this refcounted X509*.  Prereleasing refcounted
  objects is unsafe programming; fix applied to both branches.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@99252 13f79535-47bb-0310-9956-ffa450edef68
2003-04-05 19:04:44 +00:00
88ac014cc0 Fix a 64-bit porting issue.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98747 13f79535-47bb-0310-9956-ffa450edef68
2003-02-21 20:12:24 +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
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
3105040e0e Fix some possibly-uninitialized variables.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97617 13f79535-47bb-0310-9956-ffa450edef68
2002-11-23 21:19:03 +00:00
7ce4ae5b51 Turn DOWN the volume of these errors... they are low enough level notes
to land at loglevel INFO


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97439 13f79535-47bb-0310-9956-ffa450edef68
2002-11-07 06:26:48 +00:00
875f5df575 Per Justin's feedback, this still needed a little work to get the
four cases (block/nonblock read/nodata) straight.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97424 13f79535-47bb-0310-9956-ffa450edef68
2002-11-06 07:44:11 +00:00
0e489c76d2 Rule one of winsock and other one-offs (even unix EINTR) ... blocking
isn't necessarily blocking.  Should not have changed this in the prior
  commit, and adding the same retry to the -1/EAGAIN|EINTR case.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97423 13f79535-47bb-0310-9956-ffa450edef68
2002-11-06 07:29:36 +00:00
79c5523d2f errno? EINTR? what planet was this code on :-? Normalize the
ssl_io_filter_connect code to follow the filter read and write.
  Notice that it's buck ugly, but we will extract an rc first from
  the input BIO if it was written, and then try the output bio if
  it was APR_SUCCESS, during _connect processing.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97422 13f79535-47bb-0310-9956-ffa450edef68
2002-11-06 07:21:47 +00:00
dce6e3383f Merge the last of the 'filtering' functions into ssl_engine_io.c, merge
ssl_abort into what was ssl_hook_CloseConnection, clean out a bunch of
  now-static or private headers from mod_ssl.h, and final fix a very small
  but potent segfault if ->pssl is destroyed within our read loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97411 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 20:47:01 +00:00
fd0031d09f Actually, the APR_ECONNABORTED (EOS-only brigade) is the direction we
are contemplating for the next release, not the prior behavior
  (which was APR_SUCCESS for c->aborted.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97401 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 06:38:41 +00:00
e615292ccc With a last little bit of help from Justin, this should cause the
appropriate amount of tumolt and turmoil if our client has 'gone away'
  on us, sparing us of further processing (and potential 'renegotiations'
  with a non-existant client.)


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97400 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 03:38:14 +00:00
d9203ca5bc At least one doc I've seen says EOF+bytes is valid. This was a typo.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97399 13f79535-47bb-0310-9956-ffa450edef68
2002-11-05 03:16:33 +00:00
2c5b9e7d66 Appears we forgot to check the possibility of errors coming from the
write brigade passed down from the content generator through the body
  and protocol filters.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97397 13f79535-47bb-0310-9956-ffa450edef68
2002-11-04 19:41:52 +00:00
ef70d9e2f7 Rename the many flavors of filter_ctx (pRec, fctx etc) to filter_ctx,
wbio to bio_out, BIO new and free to create and destroy (to match OpenSSL),
  refactor the bio write code to stash errors in outctx->rc,
  fix the blocking read at EOF if we have some data to return,
  and preempt the nonblock read on GETLINE if we have the newline already.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97393 13f79535-47bb-0310-9956-ffa450edef68
2002-11-04 17:39:56 +00:00
f87ec93f2e Add some waypoints to understanding this code
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97374 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 10:37:06 +00:00
24aa081c2d Add some commentary on how we *think* the input filtering should be working
in mod_ssl.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97373 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 10:19:56 +00:00
35442600da I don't see how *len > wanted, but leave the check there.
Stick a comment in there as a 'Waldo was here' so that if I ever see this
again, I realize that I've actually thought about it and didn't think >
was necessary.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97372 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 09:42:09 +00:00
a75b148a5f Clean up the read pattern for cases when some data already exists.
Also return APR_SUCCESS once we've gathered any decrypted bytes.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97371 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 09:29:06 +00:00
e2742465a9 Distinguish inctx, outctx, frec [and b ??? looked like bucket to me!!!]
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97370 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:58:38 +00:00
62c675067d More nits spotted by Justin, and catch all the errors except SYSCALL
in the SSL logging section.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97369 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:48:35 +00:00
6a63226752 Suggestions by Justin, implemention by Will. Rename away all bogisity,
especially eliminating all of 'our' capitalized identifiers that were
  easily confused with library symbols; go with APR_STATUS_IS_EOF() just
  in case there is a platform result; fix a bogus *len = 0; reassignment
  and fold the two flavors of input context tracking into one.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97368 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:39:59 +00:00
b631a9cc71 Completely refactor the BIO-side client input handling for the SSL library.
Should eliminate many false spurious interrupt detected errors.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97367 13f79535-47bb-0310-9956-ffa450edef68
2002-11-01 08:35:19 +00:00
ea1784b444 Ugg. We need to use '%pp' not '%p' since ap_log_error uses apr_vsnprint(),
which has the overloaded '%p' format (not ANSI).

PR:
Obtained from:
Submitted by:
Reviewed by:


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@97252 13f79535-47bb-0310-9956-ffa450edef68
2002-10-17 13:25:08 +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
798c1dae43 Add a filter_init function to the filters so that a filter can execute
arbitrary code before the handlers are invoked.

This resolves an issue with incorrect 304s on If-Modified-Since mod_include
requests since ap_meets_conditions() is not aware that this is a dynamic
request and it is not possible to satisfy 304 for these requests (unless
xbithack full is on, of course).  When mod_include runs as a filter, it is
too late to set any flag since the handler is responsible for calling
ap_meets_conditions(), which it should do before generating any data.

If a module doesn't need to run such arbitrary code, it can just pass NULL
as the argument and all is well.

PR:	9673
Reviewed by:	Ryan Bloom and others


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95906 13f79535-47bb-0310-9956-ffa450edef68
2002-06-28 08:40:25 +00:00
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
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
5653644f78 PR:
Obtained from:
Submitted by:
Reviewed by:
ssl_io_input_read now returns APR_EOF if ssl_io_hook_read returns 0
bytes for a reason other than SSL_ERROR_WANT_READ.  this should
prevent a possible endless loop.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94519 13f79535-47bb-0310-9956-ffa450edef68
2002-04-07 06:32:21 +00:00
c1c583494e Get the HTTP-on-HTTPS hint to come through again. We're in AP_MODE_GETLINE
at this point, so the \r\n\r\n just confuses the http input filter.

One concern: this patch is only correct as long as we only ever call this
function while in AP_MODE_GETLINE.  Ideally we would account for the mode
and return the newlines if not in GETLINE mode, but at the moment it doesn't
seem to matter.

Reviewed by: Doug MacEachern


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94453 13f79535-47bb-0310-9956-ffa450edef68
2002-04-05 07:31:44 +00:00