mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Fixes for TLS v1.3 early data with async.
This commit is contained in:
@ -583,11 +583,7 @@ then
|
|||||||
test "$enable_truncatedhmac" = "" && enable_truncatedhmac=yes
|
test "$enable_truncatedhmac" = "" && enable_truncatedhmac=yes
|
||||||
test "$enable_trusted_ca" = "" && enable_trusted_ca=yes
|
test "$enable_trusted_ca" = "" && enable_trusted_ca=yes
|
||||||
test "$enable_session_ticket" = "" && enable_session_ticket=yes
|
test "$enable_session_ticket" = "" && enable_session_ticket=yes
|
||||||
|
test "$enable_earlydata" = "" && enable_earlydata=yes
|
||||||
# don't add earlydata when assynccrypt, pending fix:
|
|
||||||
if test "$enable_asynccrypt" != "yes"; then
|
|
||||||
test "$enable_earlydata" = "" && enable_earlydata=yes
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test "$ENABLED_32BIT" != "yes"
|
if test "$ENABLED_32BIT" != "yes"
|
||||||
then
|
then
|
||||||
|
@ -639,6 +639,7 @@ static int ClientBenchmarkConnections(WOLFSSL_CTX* ctx, char* host, word16 port,
|
|||||||
err = wolfSSL_get_error(ssl, 0);
|
err = wolfSSL_get_error(ssl, 0);
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
if (err == WC_PENDING_E) {
|
if (err == WC_PENDING_E) {
|
||||||
|
/* returns the number of polled items or <0 for error */
|
||||||
ret = wolfSSL_AsyncPoll(ssl, WOLF_POLL_FLAG_CHECK_HW);
|
ret = wolfSSL_AsyncPoll(ssl, WOLF_POLL_FLAG_CHECK_HW);
|
||||||
if (ret < 0) break;
|
if (ret < 0) break;
|
||||||
}
|
}
|
||||||
|
@ -3017,13 +3017,15 @@ THREAD_RETURN WOLFSSL_THREAD server_test(void* args)
|
|||||||
err = SSL_get_error(ssl, 0);
|
err = SSL_get_error(ssl, 0);
|
||||||
#ifdef WOLFSSL_ASYNC_CRYPT
|
#ifdef WOLFSSL_ASYNC_CRYPT
|
||||||
if (err == WC_PENDING_E) {
|
if (err == WC_PENDING_E) {
|
||||||
|
/* returns the number of polled items or <0 for
|
||||||
|
* error */
|
||||||
ret = wolfSSL_AsyncPoll(ssl,
|
ret = wolfSSL_AsyncPoll(ssl,
|
||||||
WOLF_POLL_FLAG_CHECK_HW);
|
WOLF_POLL_FLAG_CHECK_HW);
|
||||||
if (ret < 0) break;
|
if (ret < 0) break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
if (ret > 0) {
|
else if (ret > 0) {
|
||||||
input[ret] = 0; /* null terminate message */
|
input[ret] = 0; /* null terminate message */
|
||||||
printf("Early Data Client message: %s\n", input);
|
printf("Early Data Client message: %s\n", input);
|
||||||
}
|
}
|
||||||
|
@ -9933,7 +9933,8 @@ int wolfSSL_write_early_data(WOLFSSL* ssl, const void* data, int sz, int* outSz)
|
|||||||
return SIDE_ERROR;
|
return SIDE_ERROR;
|
||||||
|
|
||||||
if (ssl->options.handShakeState == NULL_STATE) {
|
if (ssl->options.handShakeState == NULL_STATE) {
|
||||||
ssl->earlyData = expecting_early_data;
|
if (ssl->error != WC_PENDING_E)
|
||||||
|
ssl->earlyData = expecting_early_data;
|
||||||
ret = wolfSSL_connect_TLSv13(ssl);
|
ret = wolfSSL_connect_TLSv13(ssl);
|
||||||
if (ret != WOLFSSL_SUCCESS)
|
if (ret != WOLFSSL_SUCCESS)
|
||||||
return WOLFSSL_FATAL_ERROR;
|
return WOLFSSL_FATAL_ERROR;
|
||||||
@ -9995,7 +9996,8 @@ int wolfSSL_read_early_data(WOLFSSL* ssl, void* data, int sz, int* outSz)
|
|||||||
return SIDE_ERROR;
|
return SIDE_ERROR;
|
||||||
|
|
||||||
if (ssl->options.handShakeState == NULL_STATE) {
|
if (ssl->options.handShakeState == NULL_STATE) {
|
||||||
ssl->earlyData = expecting_early_data;
|
if (ssl->error != WC_PENDING_E)
|
||||||
|
ssl->earlyData = expecting_early_data;
|
||||||
ret = wolfSSL_accept_TLSv13(ssl);
|
ret = wolfSSL_accept_TLSv13(ssl);
|
||||||
if (ret <= 0)
|
if (ret <= 0)
|
||||||
return WOLFSSL_FATAL_ERROR;
|
return WOLFSSL_FATAL_ERROR;
|
||||||
|
Reference in New Issue
Block a user