Send unexpected message alert for UNKNOWN_RECORD_TYPE - #11289
Open
rlm2002 wants to merge 2 commits into
Open
Conversation
|
Can one of the admins verify this patch? |
|
Contributor
Author
|
Retest this please Jenkins: history lost |
Contributor
|
Jenkins retest this please |
Contributor
Author
|
Retest this please Jenkins |
Send fatal unexpected_message alert ssl->when curRL.type is UNKNOWN_RECORD_TYPE when not using DTLS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
DoProcessReplyEx()rejected records with an undefinedContentTypebut returnedUNKNOWN_RECORD_TYPEwithout putting an alert on the wire. RFC 8446 section 5 and RFC 9846 section 5 both require that a TLS implementation receiving an unexpected record type MUST terminate the connection with an unexpected_message alert. RFC 5246 section 6 states the same for TLS 1.2.Two rejection sites were affected:
getRecordLayerHeader, which handledVERSION_ERRORandLENGTH_ERROR, but letUNKNOWN_RECORD_TYPEfall through todefault: break.default: arm, reached by types the whitelist admits but nothing on a TLS connection handles.dtls12_cid(25) andack(26) pass the header check wheneverWOLFSSL_DTLS_CIDorWOLFSSL_DTLS13are built, with nossl->options.dtlsguard. It is also reached with the innerContentTyperecovered byremoveMsgInnerPadding().Both now send a fatal
unexpected_messagebefore returning.Fixes F-10722
Testing
Added new unit test:
test_tls_unknown_record_type_alert./configure --enable-all && make checkChecklist