Skip to content

Commit fa45464

Browse files
tls13: early data: Improve documentation
Signed-off-by: Ronald Cron <[email protected]>
1 parent 872d538 commit fa45464

File tree

1 file changed

+21
-5
lines changed

1 file changed

+21
-5
lines changed

include/mbedtls/ssl.h

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,12 @@
9292
#define MBEDTLS_ERR_SSL_CANNOT_READ_EARLY_DATA -0x7B80
9393
/**
9494
* Early data has been received as part of an on-going handshake.
95-
* This error code can be returned only on server side. This error code can be
96-
* returned by mbedtls_ssl_handshake(), mbedtls_ssl_handshake_step(),
97-
* mbedtls_ssl_read() and mbedtls_ssl_write() if early data has been received
98-
* as part of the handshake sequence they triggered. To read the early
99-
* data, call mbedtls_ssl_read_early_data().
95+
* This error code can be returned only on server side if and only if early
96+
* data has been enabled by means of the mbedtls_ssl_conf_early_data() API.
97+
* This error code can then be returned by mbedtls_ssl_handshake(),
98+
* mbedtls_ssl_handshake_step(), mbedtls_ssl_read() or mbedtls_ssl_write() if
99+
* early data has been received as part of the handshake sequence they
100+
* triggered. To read the early data, call mbedtls_ssl_read_early_data().
100101
*/
101102
#define MBEDTLS_ERR_SSL_RECEIVED_EARLY_DATA -0x7C00
102103
/** Not possible to write early data */
@@ -5101,6 +5102,21 @@ int mbedtls_ssl_close_notify(mbedtls_ssl_context *ssl);
51015102
* \note This API is server specific.
51025103
*
51035104
* \note Early data is defined in the TLS 1.3 specification, RFC 8446.
5105+
* IMPORTANT NOTE from section 2.3 of the specification:
5106+
*
5107+
* The security properties for 0-RTT data are weaker than
5108+
* those for other kinds of TLS data. Specifically:
5109+
* - This data is not forward secret, as it is encrypted
5110+
* solely under keys derived using the offered PSK.
5111+
* - There are no guarantees of non-replay between connections.
5112+
* Protection against replay for ordinary TLS 1.3 1-RTT data
5113+
* is provided via the server’s Random value, but 0-RTT data
5114+
* does not depend on the ServerHello and therefore has
5115+
* weaker guarantees. This is especially relevant if the
5116+
* data is authenticated either with TLS client
5117+
* authentication or inside the application protocol. The
5118+
* same warnings apply to any use of the
5119+
* early_exporter_master_secret.
51045120
*
51055121
* \note This function behaves mainly as mbedtls_ssl_read(). The
51065122
* specification of mbedtls_ssl_read() relevant to TLS 1.3

0 commit comments

Comments
 (0)