Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/tls.c
Original file line number Diff line number Diff line change
Expand Up @@ -17387,6 +17387,20 @@ int TLSX_Parse(WOLFSSL* ssl, const byte* input, word16 length, byte msgType,
break;
}

#ifdef WOLFSSL_TLS13
/* RFC 8446 4.4.2: extensions in a Certificate message MUST
* correspond to ones offered in our prior ClientHello (client) or
* CertificateRequest (server). Reject anything we did not offer. */
if (msgType == certificate &&
IsAtLeastTLSv1_3(ssl->version) &&
TLSX_Find(ssl->extensions, (TLSX_Type)type) == NULL) {
WOLFSSL_MSG("Cert-msg extension not offered in CH/CR");
SendAlert(ssl, alert_fatal, unsupported_extension);
WOLFSSL_ERROR_VERBOSE(UNSUPPORTED_EXTENSION);
return UNSUPPORTED_EXTENSION;
}
#endif

switch (type) {
#ifdef HAVE_SNI
case TLSX_SERVER_NAME:
Expand Down
Loading