/[Apache-SVN]/httpd/httpd/branches/2.2.x/modules/ssl/ssl_engine_io.c
ViewVC logotype

Diff of /httpd/httpd/branches/2.2.x/modules/ssl/ssl_engine_io.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- httpd/httpd/branches/2.2.x/modules/ssl/ssl_engine_io.c	2009/11/07 00:56:12	833621
+++ httpd/httpd/branches/2.2.x/modules/ssl/ssl_engine_io.c	2009/11/07 00:56:23	833622
@@ -103,6 +103,7 @@ typedef struct {
     ap_filter_t        *pInputFilter;
     ap_filter_t        *pOutputFilter;
     int                nobuffer; /* non-zero to prevent buffering */
+    SSLConnRec         *config;
 } ssl_filter_ctx_t;
 
 typedef struct {
@@ -193,7 +194,13 @@ static int bio_filter_out_read(BIO *bio,
 static int bio_filter_out_write(BIO *bio, const char *in, int inl)
 {
     bio_filter_out_ctx_t *outctx = (bio_filter_out_ctx_t *)(bio->ptr);
-
+    
+    /* Abort early if the client has initiated a renegotiation. */
+    if (outctx->filter_ctx->config->reneg_state == RENEG_ABORT) {
+        outctx->rc = APR_ECONNABORTED;
+        return -1;
+    }
+    
     /* when handshaking we'll have a small number of bytes.
      * max size SSL will pass us here is about 16k.
      * (16413 bytes to be exact)
@@ -466,6 +473,12 @@ static int bio_filter_in_read(BIO *bio,
     if (!in)
         return 0;
 
+    /* Abort early if the client has initiated a renegotiation. */
+    if (inctx->filter_ctx->config->reneg_state == RENEG_ABORT) {
+        inctx->rc = APR_ECONNABORTED;
+        return -1;
+    }
+
     /* XXX: flush here only required for SSLv2;
      * OpenSSL calls BIO_flush() at the appropriate times for
      * the other protocols.
@@ -1724,6 +1737,8 @@ void ssl_io_filter_init(conn_rec *c, SSL
 
     filter_ctx = apr_palloc(c->pool, sizeof(ssl_filter_ctx_t));
 
+    filter_ctx->config          = myConnConfig(c);
+
     filter_ctx->nobuffer        = 0;
     filter_ctx->pOutputFilter   = ap_add_output_filter(ssl_io_filter,
                                                    filter_ctx, NULL, c);

 

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26