mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-25 09:02:48 +00:00
Merge pull request #6490 from xkqian/tls13_parse_early_data_indication_ee
The internal CI merge job ran successfully.
This commit is contained in:
commit
1d1d53622f
@ -2060,6 +2060,21 @@ static int ssl_tls13_parse_encrypted_extensions( mbedtls_ssl_context *ssl,
|
||||
|
||||
break;
|
||||
#endif /* MBEDTLS_SSL_ALPN */
|
||||
|
||||
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
||||
case MBEDTLS_TLS_EXT_EARLY_DATA:
|
||||
|
||||
if( extension_data_len != 0 )
|
||||
{
|
||||
/* The message must be empty. */
|
||||
MBEDTLS_SSL_PEND_FATAL_ALERT( MBEDTLS_SSL_ALERT_MSG_DECODE_ERROR,
|
||||
MBEDTLS_ERR_SSL_DECODE_ERROR );
|
||||
return( MBEDTLS_ERR_SSL_DECODE_ERROR );
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* MBEDTLS_SSL_EARLY_DATA */
|
||||
|
||||
default:
|
||||
MBEDTLS_SSL_PRINT_EXT(
|
||||
3, MBEDTLS_SSL_HS_ENCRYPTED_EXTENSIONS,
|
||||
@ -2102,6 +2117,14 @@ static int ssl_tls13_process_encrypted_extensions( mbedtls_ssl_context *ssl )
|
||||
MBEDTLS_SSL_PROC_CHK(
|
||||
ssl_tls13_parse_encrypted_extensions( ssl, buf, buf + buf_len ) );
|
||||
|
||||
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
||||
if( ssl->handshake->received_extensions &
|
||||
MBEDTLS_SSL_EXT_MASK( EARLY_DATA ) )
|
||||
{
|
||||
ssl->early_data_status = MBEDTLS_SSL_EARLY_DATA_STATUS_ACCEPTED;
|
||||
}
|
||||
#endif
|
||||
|
||||
mbedtls_ssl_add_hs_msg_to_checksum( ssl, MBEDTLS_SSL_HS_ENCRYPTED_EXTENSIONS,
|
||||
buf, buf_len );
|
||||
|
||||
|
@ -301,7 +301,7 @@ run_test "TLS 1.3 m->G: EarlyData: basic check, good" \
|
||||
-c "NewSessionTicket: early_data(42) extension received." \
|
||||
-c "ClientHello: early_data(42) extension exists." \
|
||||
-c "EncryptedExtensions: early_data(42) extension received." \
|
||||
-c "EncryptedExtensions: early_data(42) extension ( ignored )." \
|
||||
-c "EncryptedExtensions: early_data(42) extension exists." \
|
||||
-s "Parsing extension 'Early Data/42' (0 bytes)" \
|
||||
-s "Sending extension Early Data/42 (0 bytes)" \
|
||||
-s "early data accepted"
|
||||
@ -322,7 +322,7 @@ run_test "TLS 1.3 m->G: EarlyData: no early_data in NewSessionTicket, good" \
|
||||
-C "NewSessionTicket: early_data(42) extension received." \
|
||||
-c "ClientHello: early_data(42) extension does not exist." \
|
||||
-C "EncryptedExtensions: early_data(42) extension received." \
|
||||
-C "EncryptedExtensions: early_data(42) extension ( ignored )."
|
||||
-C "EncryptedExtensions: early_data(42) extension exists."
|
||||
|
||||
#TODO: OpenSSL tests don't work now. It might be openssl options issue, cause GnuTLS has worked.
|
||||
skip_next_test
|
||||
|
Loading…
x
Reference in New Issue
Block a user