Ticket #285: lighttpd-1.5-ssl-dos.patch

File lighttpd-1.5-ssl-dos.patch, 1.2 kB (added by hoffie, 6 months ago)

similar patch against svn trunk (1.5)

  • src/connections.c

     
    14861486#ifdef USE_OPENSSL 
    14871487                        if (srv_sock->is_ssl) { 
    14881488                                int ret; 
     1489                                ERR_clear_error(); 
    14891490                                switch ((ret = SSL_shutdown(con->sock->ssl))) { 
    14901491                                case 1: 
    14911492                                        /* ok */ 
  • src/network_openssl.c

     
    4040        UNUSED(srv); 
    4141        UNUSED(con); 
    4242 
     43        ERR_clear_error(); 
    4344        do { 
    4445                int oerrno; 
    4546                b = chunkqueue_get_append_buffer(cq); 
     
    8586                                } else { 
    8687                                        switch(oerrno) { 
    8788                                        case EPIPE: 
     89                                                ERR_clear_error(); 
    8890                                        case ECONNRESET: 
    8991                                                return NETWORK_STATUS_CONNECTION_CLOSE; 
    9092                                        default: 
     
    183185                         * checking toSend and not calling SSL_write() is simpler 
    184186                         */ 
    185187 
     188                        ERR_clear_error(); 
    186189                        if (toSend != 0 && (r = SSL_write(sock->ssl, offset, toSend)) <= 0) { 
    187190                                unsigned long err; 
    188191 
     
    287290 
    288291                                close(ifd); 
    289292 
     293                                ERR_clear_error(); 
    290294                                if ((r = SSL_write(sock->ssl, s, toSend)) <= 0) { 
    291295                                        unsigned long err; 
    292296