• Manuel Pégourié-Gonnard's avatar
    DTLS: avoid dropping too many records · e2e25e74
    Manuel Pégourié-Gonnard authored
    When the peer retransmits a flight with many record in the same datagram, and
    we already saw one of the records in that datagram, we used to drop the whole
    datagram, resulting in interoperability failure (spurious handshake timeouts,
    due to ignoring record retransmitted by the peer) with some implementations
    (issues with Chrome were reported).
    
    So in those cases, we want to only drop the current record, and look at the
    following records (if any) in the same datagram. OTOH, this is not something
    we always want to do, as sometime the header of the current record is not
    reliable enough.
    
    This commit introduces a new return code for ssl_parse_header() that allows to
    distinguish if we should drop only the current record or the whole datagram,
    and uses it in mbedtls_ssl_read_record()
    
    fixes #345
    e2e25e74