mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-24 01:43:33 +00:00
tls13: cli: Fix setting of early data transform
Fix setting of early data transform when we do not send dummy CCS for middlebox compatibility. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
fb12d9204d
commit
297c608915
@ -1236,10 +1236,6 @@ int mbedtls_ssl_tls13_finalize_client_hello(mbedtls_ssl_context *ssl)
|
|||||||
const mbedtls_ssl_ciphersuite_t *ciphersuite_info;
|
const mbedtls_ssl_ciphersuite_t *ciphersuite_info;
|
||||||
|
|
||||||
if (ssl->early_data_status == MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED) {
|
if (ssl->early_data_status == MBEDTLS_SSL_EARLY_DATA_STATUS_REJECTED) {
|
||||||
#if defined(MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE)
|
|
||||||
mbedtls_ssl_handshake_set_state(
|
|
||||||
ssl, MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO);
|
|
||||||
#endif
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(
|
MBEDTLS_SSL_DEBUG_MSG(
|
||||||
1, ("Set hs psk for early data when writing the first psk"));
|
1, ("Set hs psk for early data when writing the first psk"));
|
||||||
|
|
||||||
@ -1294,6 +1290,15 @@ int mbedtls_ssl_tls13_finalize_client_hello(mbedtls_ssl_context *ssl)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE)
|
||||||
|
mbedtls_ssl_handshake_set_state(
|
||||||
|
ssl, MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO);
|
||||||
|
#else
|
||||||
|
MBEDTLS_SSL_DEBUG_MSG(
|
||||||
|
1, ("Switch to early data keys for outbound traffic"));
|
||||||
|
mbedtls_ssl_set_outbound_transform(
|
||||||
|
ssl, ssl->handshake->transform_earlydata);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_EARLY_DATA */
|
#endif /* MBEDTLS_SSL_EARLY_DATA */
|
||||||
return 0;
|
return 0;
|
||||||
@ -3067,19 +3072,19 @@ int mbedtls_ssl_tls13_handshake_client_step(mbedtls_ssl_context *ssl)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
||||||
case MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO:
|
case MBEDTLS_SSL_CLIENT_CCS_AFTER_CLIENT_HELLO:
|
||||||
ret = mbedtls_ssl_tls13_write_change_cipher_spec(ssl);
|
ret = mbedtls_ssl_tls13_write_change_cipher_spec(ssl);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
mbedtls_ssl_handshake_set_state(ssl, MBEDTLS_SSL_SERVER_HELLO);
|
mbedtls_ssl_handshake_set_state(ssl, MBEDTLS_SSL_SERVER_HELLO);
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(
|
MBEDTLS_SSL_DEBUG_MSG(
|
||||||
1, ("Switch to early data keys for outbound traffic"));
|
1, ("Switch to early data keys for outbound traffic"));
|
||||||
mbedtls_ssl_set_outbound_transform(
|
mbedtls_ssl_set_outbound_transform(
|
||||||
ssl, ssl->handshake->transform_earlydata);
|
ssl, ssl->handshake->transform_earlydata);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
#endif /* MBEDTLS_SSL_EARLY_DATA */
|
||||||
#endif /* MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE */
|
#endif /* MBEDTLS_SSL_TLS1_3_COMPATIBILITY_MODE */
|
||||||
|
|
||||||
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
#if defined(MBEDTLS_SSL_SESSION_TICKETS)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user