Skip to content

Commit a5ee960

Browse files
committed
tls13: alert illegal_parameter for ctx
1 parent b023a71 commit a5ee960

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

src/tls13.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6089,8 +6089,13 @@ static int DoTls13CertificateRequest(WOLFSSL* ssl, const byte* input,
60896089
len = input[(*inOutIdx)++];
60906090
if ((*inOutIdx - begin) + len > size)
60916091
return BUFFER_ERROR;
6092-
if (ssl->options.connectState < FINISHED_DONE && len > 0)
6093-
return BUFFER_ERROR;
6092+
/* INVALID_PARAMETER does not map to illegal_parameter in the central
6093+
* alert path, so emit the alert explicitly before returning. */
6094+
if (ssl->options.connectState < FINISHED_DONE && len > 0) {
6095+
SendAlert(ssl, alert_fatal, illegal_parameter);
6096+
WOLFSSL_ERROR_VERBOSE(INVALID_PARAMETER);
6097+
return INVALID_PARAMETER;
6098+
}
60946099

60956100
#ifdef WOLFSSL_POST_HANDSHAKE_AUTH
60966101
/* Remember the request context bytes; the CertReqCtx allocation and

0 commit comments

Comments
 (0)