Skip to content

Commit 8f41108

Browse files
ssl: Add early_data_count field
Signed-off-by: Ronald Cron <[email protected]>
1 parent 0ee2e4a commit 8f41108

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

include/mbedtls/ssl.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1843,7 +1843,8 @@ struct mbedtls_ssl_context {
18431843
* within a single datagram. */
18441844
#endif /* MBEDTLS_SSL_PROTO_DTLS */
18451845

1846-
#if defined(MBEDTLS_SSL_EARLY_DATA) && defined(MBEDTLS_SSL_SRV_C)
1846+
#if defined(MBEDTLS_SSL_EARLY_DATA)
1847+
#if defined(MBEDTLS_SSL_SRV_C)
18471848
/*
18481849
* One of:
18491850
* MBEDTLS_SSL_EARLY_DATA_NO_DISCARD
@@ -1852,6 +1853,8 @@ struct mbedtls_ssl_context {
18521853
*/
18531854
uint8_t MBEDTLS_PRIVATE(discard_early_data_record);
18541855
#endif
1856+
uint32_t MBEDTLS_PRIVATE(early_data_count); /*!< Number of received/written early data bytes */
1857+
#endif /* MBEDTLS_SSL_EARLY_DATA */
18551858

18561859
/*
18571860
* Record layer (outgoing data)

library/ssl_tls.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ static int ssl_handshake_init(mbedtls_ssl_context *ssl)
11051105
#if defined(MBEDTLS_SSL_SRV_C)
11061106
ssl->discard_early_data_record = MBEDTLS_SSL_EARLY_DATA_NO_DISCARD;
11071107
#endif
1108+
ssl->early_data_count = 0;
11081109
#endif /* MBEDTLS_SSL_EARLY_DATA */
11091110

11101111
/* Initialize structures */

0 commit comments

Comments
 (0)