Hanno Becker 37f9532081 Implement future message buffering and loading
This commit implements future handshake message buffering
and loading by implementing ssl_load_buffered_message()
and ssl_buffer_message().

Whenever a handshake message is received which is
- a future handshake message (i.e., the sequence number
  is larger than the next expected one), or which is
- a proper fragment of the next expected handshake message,
ssl_buffer_message() is called, which does the following:
- Ignore message if its sequence number is too far ahead
  of the next expected sequence number, as controlled by
  the macro constant MBEDTLS_SSL_MAX_BUFFERED_HS.
- Otherwise, check if buffering for the message with the
  respective sequence number has already commenced.
  - If not, allocate space to back up the message within
    the buffering substructure of mbedtls_ssl_handshake_params.
    If the message is a proper fragment, allocate additional
    space for a reassembly bitmap; if it is a full message,
    omit the bitmap. In any case, fall throuh to the next case.
  - If the message has already been buffered, check that
    the header is the same, and add the current fragment
    if the message is not yet complete (this excludes the
    case where a future message has been received in a single
    fragment, hence omitting the bitmap, and is afterwards
    also received as a series of proper fragments; in this
    case, the proper fragments will be ignored).

For loading buffered messages in ssl_load_buffered_message(),
the approach is the following:
- Check the first entry in the buffering window (the window
  is always based at the next expected handshake message).
  If buffering hasn't started or if reassembly is still
  in progress, ignore. If the next expected message has been
  fully received, copy it to the input buffer (which is empty,
  as ssl_load_buffered_message() is only called in this case).
2018-08-17 16:52:08 +01:00
..
2018-05-25 14:54:14 +01:00
2017-07-27 21:44:33 +01:00
2018-06-18 10:30:30 +02:00
2018-07-25 15:42:26 +01:00
2017-09-06 17:51:14 +03:00
2017-10-10 19:04:27 +03:00
2018-05-15 09:21:57 +01:00
2018-07-24 16:43:20 +01:00
2018-07-24 16:43:20 +01:00
2015-09-04 14:21:07 +02:00
2018-05-25 14:54:14 +01:00
2015-09-04 14:21:07 +02:00
2017-10-29 17:53:52 +02:00
2018-04-11 20:27:32 -04:00
2018-07-24 16:43:20 +01:00
2018-05-15 09:21:57 +01:00