check for socket errors on SendAlert

This commit is contained in:
JacobBarthelmeh
2023-05-12 09:52:01 -07:00
parent 56cd8c3dc1
commit ea40176bee

View File

@ -33327,7 +33327,14 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx,
if (ret != 0 || !ssl->options.dtlsStateful) { if (ret != 0 || !ssl->options.dtlsStateful) {
int alertType = TranslateErrorToAlert(ret); int alertType = TranslateErrorToAlert(ret);
if (alertType != invalid_alert) if (alertType != invalid_alert)
SendAlert(ssl, alert_fatal, alertType); if (alertType != invalid_alert) {
int err;
/* propogate socket errors to avoid re-calling send alert */
err = SendAlert(ssl, alert_fatal, alertType);
if (err == SOCKET_ERROR_E)
ret = SOCKET_ERROR_E;
}
*inOutIdx += helloSz; *inOutIdx += helloSz;
DtlsResetState(ssl); DtlsResetState(ssl);
if (DtlsIgnoreError(ret)) if (DtlsIgnoreError(ret))