Skip to content

Commit 158c036

Browse files
authored
Merge pull request #6372 from rizlik/send_alert_fix
tls13: correctly propagatae SendAlert err message
2 parents cdeba4e + 7539093 commit 158c036

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10946,7 +10946,7 @@ static int SanityCheckTls13MsgReceived(WOLFSSL* ssl, byte type)
1094610946
int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1094710947
byte type, word32 size, word32 totalSz)
1094810948
{
10949-
int ret = 0;
10949+
int ret = 0, tmp;
1095010950
word32 inIdx = *inOutIdx;
1095110951
int alertType = invalid_alert;
1095210952
#if defined(HAVE_ECH)
@@ -11186,7 +11186,11 @@ int DoTls13HandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx,
1118611186
if (type == client_hello && ssl->options.dtls)
1118711187
DtlsSetSeqNumForReply(ssl);
1118811188
#endif
11189-
SendAlert(ssl, alert_fatal, alertType);
11189+
tmp = SendAlert(ssl, alert_fatal, alertType);
11190+
/* propagate socket error instead of tls error to be sure the error is
11191+
* not ignored by DTLS code */
11192+
if (tmp == SOCKET_ERROR_E)
11193+
ret = SOCKET_ERROR_E;
1119011194
}
1119111195

1119211196
if (ret == 0 && ssl->options.tls1_3) {

0 commit comments

Comments
 (0)