mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-02-22 00:40:41 +00:00
Read early data file
Signed-off-by: Xiaokang Qian <xiaokang.qian@arm.com>
This commit is contained in:
parent
dd8a7f8acf
commit
35c026c09e
@ -3007,21 +3007,24 @@ reconnect:
|
|||||||
(unsigned int) -ret);
|
(unsigned int) -ret);
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
#if defined(MBEDTLS_SSL_EARLY_DATA)
|
#if defined(MBEDTLS_SSL_PROTO_TLS1_3) && defined(MBEDTLS_SSL_EARLY_DATA)
|
||||||
if (opt.early_data == MBEDTLS_SSL_EARLY_DATA_ENABLED
|
if (opt.early_data == MBEDTLS_SSL_EARLY_DATA_ENABLED
|
||||||
&& strlen(opt.early_data) > 0) {
|
&& strlen(opt.early_data_file) > 0) {
|
||||||
if ((early_data_fp = fopen(opt.early_data_file, "rb")) == NULL) {
|
if ((early_data_fp = fopen(opt.early_data_file, "rb")) == NULL) {
|
||||||
mbedtls_printf("failed\n ! Cannot open '%s' for reading.\n",
|
mbedtls_printf("failed\n ! Cannot open '%s' for reading.\n",
|
||||||
opt.early_data);
|
opt.early_data_file);
|
||||||
|
ret = MBEDTLS_ERR_SSL_INTERNAL_ERROR;
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mbedtls_printf("Read early data successfully...");
|
||||||
|
|
||||||
/* TODO: read the early data from early_data_fp in chunks, and call
|
/* TODO: read the early data from early_data_fp in chunks, and call
|
||||||
* mbedtls_ssl_write_early_data() to initial the handshake and send
|
* mbedtls_ssl_write_early_data() to initial the handshake and send
|
||||||
* out the early data. Then finish the handshake.
|
* out the early data. Then finish the handshake.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
} else
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) {
|
while ((ret = mbedtls_ssl_handshake(&ssl)) != 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user