DTLS Nonblocking Updates

Do not allow the DTLS message flight be retransmit without being
finished. This can happen if a non-blocking transmit times out the
response and the application tries to retransmit.
This commit is contained in:
John Safranek
2018-12-17 15:40:35 -08:00
parent 8356c3d7e2
commit aa4de6e170

View File

@@ -6090,6 +6090,18 @@ int DtlsMsgPoolSend(WOLFSSL* ssl, int sendOnlyFirstPacket)
WOLFSSL_ENTER("DtlsMsgPoolSend()"); WOLFSSL_ENTER("DtlsMsgPoolSend()");
if (pool != NULL) { if (pool != NULL) {
if ((ssl->options.side == WOLFSSL_SERVER_END &&
!(ssl->options.acceptState == SERVER_HELLO_DONE ||
ssl->options.acceptState == ACCEPT_FINISHED_DONE)) ||
(ssl->options.side == WOLFSSL_CLIENT_END &&
!(ssl->options.connectState == CLIENT_HELLO_SENT ||
ssl->options.connectState == HELLO_AGAIN_REPLY ||
ssl->options.connectState == FINISHED_DONE))) {
WOLFSSL_ERROR(DTLS_RETX_OVER_TX);
ssl->error = DTLS_RETX_OVER_TX;
return WOLFSSL_FATAL_ERROR;
}
while (pool != NULL) { while (pool != NULL) {
if (pool->seq == 0) { if (pool->seq == 0) {