Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 65538 invoked by uid 500); 18 Jan 2002 00:13:26 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 65527 invoked by uid 500); 18 Jan 2002 00:13:26 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 18 Jan 2002 00:13:25 -0000 Message-ID: <20020118001325.21869.qmail@icarus.apache.org> From: dougm@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/modules/ssl ssl_engine_io.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N dougm 02/01/17 16:13:25 Modified: modules/ssl ssl_engine_io.c Log: fix for SSLv2 requests Revision Changes Path 1.53 +15 -3 httpd-2.0/modules/ssl/ssl_engine_io.c Index: ssl_engine_io.c =================================================================== RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_io.c,v retrieving revision 1.52 retrieving revision 1.53 diff -u -r1.52 -r1.53 --- ssl_engine_io.c 17 Jan 2002 15:51:41 -0000 1.52 +++ ssl_engine_io.c 18 Jan 2002 00:13:25 -0000 1.53 @@ -292,6 +292,8 @@ } char_buffer_t; typedef struct { + SSL *ssl; + BIO *wbio; ap_filter_t *f; apr_status_t rc; ap_input_mode_t mode; @@ -354,8 +356,16 @@ int len = 0; apr_off_t readbytes = inl; - inbio->rc = APR_SUCCESS; + /* XXX: flush here only required for SSLv2; + * OpenSSL calls BIO_flush() at the appropriate times for + * the other protocols. + */ + if (SSL_version(inbio->ssl) == SSL2_VERSION) { + BIO_bucket_flush(inbio->wbio); + } + inbio->rc = APR_SUCCESS; + /* first use data already read from socket if any */ if ((len = char_buffer_read(&inbio->cbuf, in, inl))) { if ((len <= inl) || inbio->getline) { @@ -789,6 +799,8 @@ frec->pbioRead->ptr = &ctx->inbio; ctx->frec = frec; + ctx->inbio.ssl = ssl; + ctx->inbio.wbio = frec->pbioWrite; ctx->inbio.f = frec->pInputFilter; ctx->inbio.bb = apr_brigade_create(c->pool); ctx->inbio.bucket = NULL; @@ -825,13 +837,13 @@ filter = apr_palloc(c->pool, sizeof(SSLFilterRec)); - ssl_io_input_add_filter(filter, c, ssl); - filter->pOutputFilter = ap_add_output_filter(ssl_io_filter, filter, NULL, c); filter->pbioWrite = BIO_new(BIO_s_bucket()); filter->pbioWrite->ptr = BIO_bucket_new(filter, c); + + ssl_io_input_add_filter(filter, c, ssl); SSL_set_bio(ssl, filter->pbioRead, filter->pbioWrite); filter->pssl = ssl;