Ticket #285: 06_all_lighttpd-1.4.19-closing_foreign_ssl_connections-dos.diff

File 06_all_lighttpd-1.4.19-closing_foreign_ssl_connections-dos.diff, 1.9 kB (added by hoffie, 4 months ago)

alternative, hopefully better patch (against 1.4.19, not svn!)

  • lighttpd-1.4.19/NEWS

    old new  
    88  * added support for If-Range: <date> (#1346) 
    99  * added support for matching $HTTP["scheme"] in configs 
    1010  * fixed initgroups() called after chroot (#1384) 
     11  * Fix #285 again: read error after SSL_shutdown (thx marton.illes@balabit.com) and clear the error queue before some other calls 
    1112  * fixed case-sensitive check for Auth-Method (#1456) 
    1213  * execute fcgi app without /bin/sh if used as argument to spawn-fcgi (#1428) 
    1314  * fixed a bug that made /-prefixed extensions being handled also when 
  • lighttpd-1.4.19/src/connections.c

    old new  
    199199 
    200200        /* don't resize the buffer if we were in SSL_ERROR_WANT_* */ 
    201201 
     202        ERR_clear_error(); 
    202203        do { 
    203204                if (!con->ssl_error_want_reuse_buffer) { 
    204205                        b = buffer_init(); 
     
    16691670#ifdef USE_OPENSSL 
    16701671                        if (srv_sock->is_ssl) { 
    16711672                                int ret; 
     1673                                ERR_clear_error(); 
    16721674                                switch ((ret = SSL_shutdown(con->ssl))) { 
    16731675                                case 1: 
    16741676                                        /* ok */ 
    16751677                                        break; 
    16761678                                case 0: 
     1679                                        ERR_clear_error(); 
    16771680                                        SSL_shutdown(con->ssl); 
    16781681                                        break; 
    16791682                                default: 
  • lighttpd-1.4.19/src/network_openssl.c

    old new  
    8585                         * 
    8686                         */ 
    8787 
     88                        ERR_clear_error(); 
    8889                        if ((r = SSL_write(ssl, offset, toSend)) <= 0) { 
    8990                                unsigned long err; 
    9091 
     
    187188 
    188189                                close(ifd); 
    189190 
     191                                ERR_clear_error(); 
    190192                                if ((r = SSL_write(ssl, s, toSend)) <= 0) { 
    191193                                        unsigned long err; 
    192194