Reset timeout when reading a valid DTLS message

- Increment the DTLS 1.3 timeout on a long timeout
This commit is contained in:
Juliusz Sosinowicz
2022-08-01 14:30:35 +02:00
parent 67d518544b
commit fd1e8c49eb
2 changed files with 10 additions and 5 deletions

View File

@ -2296,6 +2296,10 @@ int Dtls13RtxTimeout(WOLFSSL* ssl)
return 0;
}
/* Increase timeout on long timeout */
if (DtlsMsgPoolTimeout(ssl) != 0)
return -1;
return Dtls13RtxSendBuffered(ssl);
}

View File

@ -7962,8 +7962,6 @@ void DtlsTxMsgListClean(WOLFSSL* ssl)
* verify */
break;
ssl->dtls_tx_msg_list_sz--;
/* Reset timer as deleting a node means that state has progressed */
ssl->dtls_timeout = ssl->dtls_timeout_init;
head = next;
}
ssl->dtls_tx_msg_list = head;
@ -8263,8 +8261,7 @@ int DtlsMsgPoolTimeout(WOLFSSL* ssl)
}
/* DtlsMsgPoolReset() deletes the stored transmit list and resets the timeout
* value. */
/* DtlsMsgPoolReset() deletes the stored transmit list. */
void DtlsMsgPoolReset(WOLFSSL* ssl)
{
WOLFSSL_ENTER("DtlsMsgPoolReset()");
@ -8274,7 +8271,6 @@ void DtlsMsgPoolReset(WOLFSSL* ssl)
ssl->dtls_tx_msg = NULL;
ssl->dtls_tx_msg_list_sz = 0;
}
ssl->dtls_timeout = ssl->dtls_timeout_init;
}
@ -18745,6 +18741,11 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
if (IsDtlsNotSctpMode(ssl) && !IsAtLeastTLSv1_3(ssl->version)) {
_DtlsUpdateWindow(ssl);
}
if (ssl->options.dtls) {
/* Reset timeout as we have received a valid DTLS message */
ssl->dtls_timeout = ssl->dtls_timeout_init;
}
#endif /* WOLFSSL_DTLS */
WOLFSSL_MSG("received record layer msg");