mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-05-12 18:04:39 +08:00
tls13: cli: Fix error code not checked
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
de9b03dcba
commit
5dbfcceb81
@ -6064,7 +6064,6 @@ int mbedtls_ssl_write_early_data(mbedtls_ssl_context *ssl,
|
|||||||
{
|
{
|
||||||
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
|
||||||
const struct mbedtls_ssl_config *conf;
|
const struct mbedtls_ssl_config *conf;
|
||||||
int written_data_len = 0;
|
|
||||||
uint32_t remaining;
|
uint32_t remaining;
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(2, ("=> write early_data"));
|
MBEDTLS_SSL_DEBUG_MSG(2, ("=> write early_data"));
|
||||||
@ -6153,12 +6152,14 @@ int mbedtls_ssl_write_early_data(mbedtls_ssl_context *ssl,
|
|||||||
len = remaining;
|
len = remaining;
|
||||||
}
|
}
|
||||||
|
|
||||||
written_data_len = ssl_write_real(ssl, buf, len);
|
ret = ssl_write_real(ssl, buf, len);
|
||||||
ssl->total_early_data_size += written_data_len;
|
if (ret >= 0) {
|
||||||
|
ssl->total_early_data_size += ret;
|
||||||
|
}
|
||||||
|
|
||||||
MBEDTLS_SSL_DEBUG_MSG(2, ("<= write early_data, len=%d", written_data_len));
|
MBEDTLS_SSL_DEBUG_MSG(2, ("<= write early_data, ret=%d", ret));
|
||||||
|
|
||||||
return written_data_len;
|
return ret;
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_SSL_EARLY_DATA && MBEDTLS_SSL_CLI_C */
|
#endif /* MBEDTLS_SSL_EARLY_DATA && MBEDTLS_SSL_CLI_C */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user