Skip to content

RFC 7252: validate known option lengths and unknown critical options #28

Closed

Description

@maikebing

The current raw codec must remain distinct from an endpoint's supported-option policy. Source review found Option.IsCritical uses (number & 1) > 1, always false, and a five-byte Content-Format integer can truncate to 50 rather than follow RFC7252 §5.4.3. Track this separately from syntactic decoder fixes (#20) and registry compatibility (#23).

Acceptance: define an explicit supported-option registry based on real handlers (Enum.IsDefined is insufficient); apply RFC7252 §5.4 and §5.5.2 to unknown/invalid critical options (4.02 for requests, reject/ignore responses as prescribed), preserve/ignore elective options correctly, validate known option lengths/repetition and integer bounds, and provide an extension hook for host-specific options without treating every IANA entry as implemented. Test illegal Accept/Uri-Port/Content-Format/Observe/Block lengths, duplicates, raw proxies and legacy option19. A raw decode/encode round trip alone does not complete endpoint semantic validation.

Activity

  1. maikebing commented on Nov 12, 2026

    @maikebing
    MemberAuthor

    Partial progress merged in PR #32 / 557b31a: Option.IsCritical now follows the RFC7252 odd/even bit rule, protected by 12 classification cases. The final combined suite passed 258/258 on Windows and Linux. This does not complete this issue: known-option lengths/repetition/integer bounds, supported-handler registration and unknown critical/elective endpoint policy remain unimplemented. Keep OPEN; the separate option19 compatibility decision stays in #23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions