forked from wolfSSL/wolfssl
dtls13: consider certificate_request processed on WC_PENDING_E
The error is due to the message triggered by the processing of the message (Connect()->SendTls13Certificate/SendTls13CertificateVerify/SendTls13Verify). Consider the message processed to avoid double processing.
This commit is contained in:
committed by
David Garske
parent
aca83b42d7
commit
163acb89af
20
src/dtls13.c
20
src/dtls13.c
@@ -372,15 +372,21 @@ int Dtls13ProcessBufferedMessages(WOLFSSL* ssl)
|
|||||||
|
|
||||||
ret = DoTls13HandShakeMsgType(ssl, msg->msg, &idx, msg->type, msg->sz,
|
ret = DoTls13HandShakeMsgType(ssl, msg->msg, &idx, msg->type, msg->sz,
|
||||||
msg->sz);
|
msg->sz);
|
||||||
|
|
||||||
|
/* processing certificate_request triggers a connect. The error came
|
||||||
|
* from there, the message can be considered processed successfully */
|
||||||
|
if (ret == 0 || (msg->type == certificate_request &&
|
||||||
|
ssl->options.handShakeDone && ret == WC_PENDING_E)) {
|
||||||
|
Dtls13MsgWasProcessed(ssl, (enum HandShakeType)msg->type);
|
||||||
|
|
||||||
|
ssl->dtls_rx_msg_list = msg->next;
|
||||||
|
DtlsMsgDelete(msg, ssl->heap);
|
||||||
|
msg = ssl->dtls_rx_msg_list;
|
||||||
|
ssl->dtls_rx_msg_list_sz--;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret != 0)
|
if (ret != 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Dtls13MsgWasProcessed(ssl, (enum HandShakeType)msg->type);
|
|
||||||
|
|
||||||
ssl->dtls_rx_msg_list = msg->next;
|
|
||||||
DtlsMsgDelete(msg, ssl->heap);
|
|
||||||
msg = ssl->dtls_rx_msg_list;
|
|
||||||
ssl->dtls_rx_msg_list_sz--;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WOLFSSL_LEAVE("dtls13_process_buffered_messages()", ret);
|
WOLFSSL_LEAVE("dtls13_process_buffered_messages()", ret);
|
||||||
|
Reference in New Issue
Block a user