botan icon indicating copy to clipboard operation
botan copied to clipboard

Retransmission of Flight 5 fixed in dTLS

Open pstanisz opened this issue 3 years ago • 5 comments

This change shall fix the issue: https://github.com/randombit/botan/issues/2498

In case of any delay during the dTLS handshake and retransmission of the Flight 5 messages by the client, the server might receive Flight 5 messages few times. First time it finishes the handshake, for next (retransmitted) messages it re-creates the pending_state. This prevents from further communication, even if the dTLS connection is well established.

pstanisz avatar Mar 12 '21 22:03 pstanisz

Thank you. I'll review this shortly. The CI failure looks to be related to this change - the SendHalfHelloRequest tests from BoringSSL's suite are now failing.

randombit avatar Mar 14 '21 14:03 randombit

I think it's OK to just disable SendHalfHelloRequest* tests (in src/bogo_shim/config.json); this test is verifying a behavior that is not spec mandated but just how BoringSSL happens to behave.

It would be nice though if there was some test of the reflight behavior though. We can get though via the BoringSSL suite but this requires building timeout support for DTLS, right now all of the DTLS retransmit tests are disabled for this reason.

randombit avatar Mar 14 '21 18:03 randombit

Thank you for comments @randombit. Currently the fix is just verified manually with Botan & openssl, hope that at some point it would be possible to extend the DTLS retransmission testing with Bogo.

pstanisz avatar Mar 14 '21 20:03 pstanisz

Not good, another test failed: DTLS-SendExtraFinished*. I'll try to look what is happening, maybe the fix causes some other issue(s)

pstanisz avatar Mar 14 '21 20:03 pstanisz

IMHO deduplication should be done in Handshake_Reassembly - otherwise we have to add a new code path for each type of message which is hard to maintain. https://github.com/randombit/botan/blob/master/src/lib/tls/tls_handshake_io.cpp#L245 might be relevant.

nametoolong avatar Mar 21 '21 03:03 nametoolong