fix: Use correct error codes for frame errors#900
Open
ArniDagur wants to merge 1 commit intohyperium:masterfrom
Open
fix: Use correct error codes for frame errors#900ArniDagur wants to merge 1 commit intohyperium:masterfrom
ArniDagur wants to merge 1 commit intohyperium:masterfrom
Conversation
Previously all frame parsing errors in framed_read.rs produced GOAWAY(PROTOCOL_ERROR). RFC 9113 requires specific error codes: Error Old New Comment ───────────────────────── ─────────────── ────────────────── ─────────────────────────────────── BadFrameSize PROTOCOL_ERROR FRAME_SIZE_ERROR InvalidPayloadLength PROTOCOL_ERROR FRAME_SIZE_ERROR InvalidPayloadAckSettings PROTOCOL_ERROR FRAME_SIZE_ERROR InvalidInitialWindowSize PROTOCOL_ERROR FLOW_CONTROL_ERROR New variant, split from InvalidSettingValue (§6.5.2) Hpack(_) PROTOCOL_ERROR COMPRESSION_ERROR TooMuchPadding PROTOCOL_ERROR PROTOCOL_ERROR InvalidSettingValue PROTOCOL_ERROR PROTOCOL_ERROR InvalidWindowUpdateValue PROTOCOL_ERROR PROTOCOL_ERROR InvalidStreamId PROTOCOL_ERROR PROTOCOL_ERROR MalformedMessage PROTOCOL_ERROR PROTOCOL_ERROR InvalidDependencyId PROTOCOL_ERROR PROTOCOL_ERROR
Member
|
This is probably fine. I just wanted to note some things from RFC 9113 Section 5.4 (and we use for security reasons in h2 sometimes):
|
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.
Previously all frame errors produced
GOAWAY(PROTOCOL_ERROR). RFC 9113 requires specific error codes:BadFrameSizePROTOCOL_ERRORFRAME_SIZE_ERRORInvalidPayloadLengthPROTOCOL_ERRORFRAME_SIZE_ERRORInvalidPayloadAckSettingsPROTOCOL_ERRORFRAME_SIZE_ERRORInvalidInitialWindowSizePROTOCOL_ERRORFLOW_CONTROL_ERRORHpack(_)PROTOCOL_ERRORCOMPRESSION_ERRORTooMuchPaddingPROTOCOL_ERRORPROTOCOL_ERRORInvalidSettingValuePROTOCOL_ERRORPROTOCOL_ERRORInvalidWindowUpdateValuePROTOCOL_ERRORPROTOCOL_ERRORInvalidStreamIdPROTOCOL_ERRORPROTOCOL_ERRORMalformedMessagePROTOCOL_ERRORPROTOCOL_ERRORInvalidDependencyIdPROTOCOL_ERRORPROTOCOL_ERROROne motivation to fix this beyond RFC compliance is that it's a source of "uninteresting" discrepancies when doing comparative fuzzing between different HTTP2 implementations.