hannestschofenig / mbedtls

An open source, portable, easy to use, readable and flexible SSL library
https://tls.mbed.org
Apache License 2.0
15 stars 8 forks source link

[0-RTT][RFC] Create new API for sending early data #387

Open jesiegel1 opened 2 years ago

jesiegel1 commented 2 years ago

Description

This PR adds a new API for sending early data, building off the work done in https://github.com/hannestschofenig/mbedtls/pull/369.

Background

Currently, to send early data the client application calls mbedtls_ssl_set_early_data() before the handshake begins, with a pointer to the early data buffer. Once set, the early data buffer cannot be changed during the handshake, limiting the client application to a single early data payload and reducing the opportunity to take full advantage of early data.

Consider a streaming app for example, where real-time data is generated simultaneously with the handshake. The new API will support streaming early data throughout the duration of the handshake in accordance with the standard:

Clients are permitted to "stream" 0-RTT data until they receive the server's Finished, only then sending the EndOfEarlyData message, followed by the rest of the handshake.

Status

DRAFT, solicit feedback on design.

Requires Backporting

NO

Additional comments

Todos

Steps to test or reproduce

ssl-opt.sh -f 'early data'