Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix early data send and receive on client and server #376

Open
wants to merge 1 commit into
base: tls13-prototype
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions library/ssl_tls13_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -313,15 +313,8 @@ static int ssl_write_early_data_write( mbedtls_ssl_context* ssl,
{
memcpy( buf, ssl->early_data_buf, ssl->early_data_len );

#if defined(MBEDTLS_SSL_USE_MPS)
*olen = ssl->early_data_len;
MBEDTLS_SSL_DEBUG_BUF( 3, "Early Data", buf, ssl->early_data_len );
#else
buf[ssl->early_data_len] = MBEDTLS_SSL_MSG_APPLICATION_DATA;
*olen = ssl->early_data_len + 1;

MBEDTLS_SSL_DEBUG_BUF( 3, "Early Data", ssl->out_msg, *olen );
#endif /* MBEDTLS_SSL_USE_MPS */
}

return( 0 );
Expand Down
2 changes: 1 addition & 1 deletion library/ssl_tls13_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1913,7 +1913,7 @@ static int ssl_early_data_fetch( mbedtls_ssl_context *ssl,
}

*buf = ssl->in_msg;
*buflen = ssl->in_hslen;
*buflen = ssl->in_msglen;

cleanup:

Expand Down
1 change: 1 addition & 0 deletions tests/ssl-opt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ run_test "TLS 1.3, TLS1-3-AES-256-GCM-SHA384, ext PSK, early data status - ac
"$P_CLI nbio=2 debug_level=5 force_version=tls1_3 force_ciphersuite=TLS1-3-AES-256-GCM-SHA384 key_exchange_modes=psk early_data=1 psk=010203 psk_identity=0a0b0c" \
0 \
-c "early data status = 2" \
-s "15 bytes early data received: early data test"

requires_config_enabled MBEDTLS_SSL_PROTO_TLS1_3_EXPERIMENTAL
requires_config_enabled MBEDTLS_DEBUG_C
Expand Down