aws / s2n-tls

An implementation of the TLS/SSL protocols
https://aws.github.io/s2n-tls/usage-guide/
Apache License 2.0
4.53k stars 708 forks source link

Add an API that returns whether a client used TLS False Start #2000

Open zz85 opened 4 years ago

zz85 commented 4 years ago

Problem:

TLS False Start is an optional behavior of TLS client that reduces latencies of requests by 1-RTT in TLS 1.2. Modern browsers and s2n on the server side support this behavior. Add an API that can help determine whether a client has connected with False Start.

Solution:

A description of the possible solution in terms of S2N architecture. Highlight and explain any potentially controversial design decisions taken.

Add

bool s2n_connection_has_false_started(conn)

When the server is handing Client Finished / Server CCS, peak into the receive buffer to see if there's application data. If so, a client has probably used False Start.

Requirements / Acceptance Criteria:

What must a solution address in order to solve the problem? How do we know the solution is complete?

Out of scope:

Is there anything the solution will intentionally NOT address? No

zz85 commented 4 years ago

onn->in is not hydrated by s2n_connection_recv_stuffer() even though there may be data after CLIENT FINISHED. this is because the state machine switches to write until SERVER_FINISHED is sent. since source buffers is not exposed, some options may be to have a peek api or attempt s2n_recv() prematurely, but this does not seem so straight forward or simple now.