|
92 | 92 | #define MBEDTLS_ERR_SSL_CANNOT_READ_EARLY_DATA -0x7B80 |
93 | 93 | /** |
94 | 94 | * 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(). |
100 | 101 | */ |
101 | 102 | #define MBEDTLS_ERR_SSL_RECEIVED_EARLY_DATA -0x7C00 |
102 | 103 | /** Not possible to write early data */ |
@@ -5101,6 +5102,21 @@ int mbedtls_ssl_close_notify(mbedtls_ssl_context *ssl); |
5101 | 5102 | * \note This API is server specific. |
5102 | 5103 | * |
5103 | 5104 | * \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. |
5104 | 5120 | * |
5105 | 5121 | * \note This function behaves mainly as mbedtls_ssl_read(). The |
5106 | 5122 | * specification of mbedtls_ssl_read() relevant to TLS 1.3 |
|
0 commit comments