Skip to content

Commit

Permalink
Merge r1796343 from trunk:
Browse files Browse the repository at this point in the history
mod_ssl: fix ctx passed to ssl_io_filter_error()

Consistently pass the expected bio_filter_in_ctx_t
to ssl_io_filter_error(). 

Submitted By: Yann Ylavic



Submitted by: covener
Reviewed by: covener, ylavic, jim


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1796854 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
jimjag committed May 30, 2017
1 parent cd8065c commit 54e0c85
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ Changes with Apache 2.4.26
*) core: EBCDIC fixes for interim responses with additional headers.
[Eric Covener]

*) mod_ssl: Consistently pass the expected bio_filter_in_ctx_t
to ssl_io_filter_error(). [Yann Ylavic]

*) mod_env: when processing a 'SetEnv' directive, warn if the environment
variable name includes a '='. It is likely a configuration error.
PR 60249 [Christophe Jaillet]
Expand Down
6 changes: 0 additions & 6 deletions STATUS
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]

*) mod_ssl: Consistently pass the expected bio_filter_in_ctx_t
to ssl_io_filter_error(). [Yann Ylavic]
trunk patch: http://svn.apache.org/r1796343
2.4.x patch: svn merge -c 1796343 ^/httpd/httpd/trunk . (modulo CHANGES)
+1: covener, ylavic, jim

*) core: Deprecate ap_get_basic_auth_pw() and add
ap_get_basic_auth_components().
trunk patch: http://svn.apache.org/r1796348
Expand Down
15 changes: 8 additions & 7 deletions modules/ssl/ssl_engine_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -936,20 +936,21 @@ static apr_status_t ssl_filter_write(ap_filter_t *f,
* establish an outgoing SSL connection. */
#define MODSSL_ERROR_BAD_GATEWAY (APR_OS_START_USERERR + 1)

static void ssl_io_filter_disable(SSLConnRec *sslconn, ap_filter_t *f)
static void ssl_io_filter_disable(SSLConnRec *sslconn,
bio_filter_in_ctx_t *inctx)
{
bio_filter_in_ctx_t *inctx = f->ctx;
SSL_free(inctx->ssl);
sslconn->ssl = NULL;
inctx->ssl = NULL;
inctx->filter_ctx->pssl = NULL;
}

static apr_status_t ssl_io_filter_error(ap_filter_t *f,
static apr_status_t ssl_io_filter_error(bio_filter_in_ctx_t *inctx,
apr_bucket_brigade *bb,
apr_status_t status,
int is_init)
{
ap_filter_t *f = inctx->f;
SSLConnRec *sslconn = myConnConfig(f->c);
apr_bucket *bucket;
int send_eos = 1;
Expand All @@ -962,7 +963,7 @@ static apr_status_t ssl_io_filter_error(ap_filter_t *f,
"trying to send HTML error page");
ssl_log_ssl_error(SSLLOG_MARK, APLOG_INFO, sslconn->server);

ssl_io_filter_disable(sslconn, f);
ssl_io_filter_disable(sslconn, inctx);
f->c->keepalive = AP_CONN_CLOSE;
if (is_init) {
sslconn->non_ssl_request = NON_SSL_SEND_REQLINE;
Expand Down Expand Up @@ -1513,7 +1514,7 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f,
* rather than have SSLEngine On configured.
*/
if ((status = ssl_io_filter_handshake(inctx->filter_ctx)) != APR_SUCCESS) {
return ssl_io_filter_error(f, bb, status, is_init);
return ssl_io_filter_error(inctx, bb, status, is_init);
}

if (is_init) {
Expand Down Expand Up @@ -1567,7 +1568,7 @@ static apr_status_t ssl_io_filter_input(ap_filter_t *f,

/* Handle custom errors. */
if (status != APR_SUCCESS) {
return ssl_io_filter_error(f, bb, status, 0);
return ssl_io_filter_error(inctx, bb, status, 0);
}

/* Create a transient bucket out of the decrypted data. */
Expand Down Expand Up @@ -1752,7 +1753,7 @@ static apr_status_t ssl_io_filter_output(ap_filter_t *f,
inctx->block = APR_BLOCK_READ;

if ((status = ssl_io_filter_handshake(filter_ctx)) != APR_SUCCESS) {
return ssl_io_filter_error(f, bb, status, 0);
return ssl_io_filter_error(inctx, bb, status, 0);
}

while (!APR_BRIGADE_EMPTY(bb) && status == APR_SUCCESS) {
Expand Down

0 comments on commit 54e0c85

Please sign in to comment.