Branch: Tag:

2014-08-24

2014-08-24 12:11:46 by Henrik Grubbström (Grubba) <grubba@grubba.org>

SSL: Improved support for renegotiation.

415:    PACKET_handshake : PRI_urgent,    PACKET_heartbeat : PRI_urgent,    PACKET_application_data : PRI_application ])[packet->content_type]; +  +  if ((state & CONNECTION_local_closing) && (priority >= PRI_application)) { +  SSL3_DEBUG_MSG("send_packet: Ignoring application packet during close.\n"); +  return; +  } +  +  if ((packet->content_type == PACKET_handshake) && +  (priority == PRI_application)) { +  // Assume the packet is either hello_request or client_hello, +  // and that we want to renegotiate. +  expect_change_cipher = 0; +  certificate_state = 0; +  state = [int(0..0)|ConnectionState](state | CONNECTION_handshaking); +  handshake_state = STATE_wait_for_hello; +  } +     SSL3_DEBUG_MSG("SSL.Connection->send_packet: type %d, pri %d, %O\n",    packet->content_type, priority, packet->fragment[..5]);    switch (priority)
496:    "Closing connection.\n"), PRI_application);   }    + //! Renegotiate the connection. + void send_renegotiate(); +    //! Send an application data packet. If the data block is too large   //! then as much as possible of the beginning of it is sent. The size   //! of the sent data is returned.