Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document deviations from RFC 8446 PL #566

Merged
merged 1 commit into from
Jul 27, 2024

Conversation

tgeoghegan
Copy link
Collaborator

Explains in detail how the syntax from RFC 8446 section 3.7 is repurposed for concise descriptions of structure variants. Additionally, the section on message encoding is moved to "Protocol Definition" to make the document flow better.

Closes #472

@tgeoghegan tgeoghegan requested a review from cjpatton July 6, 2024 00:05
@cjpatton
Copy link
Collaborator

cjpatton commented Jul 8, 2024

Reviewer note: @suman-gantaobserved that TLS-syntax does not explicitly allow case blocks with multiple fields. We currently don't have any cases of this.

draft-ietf-ppm-dap.md Outdated Show resolved Hide resolved
/* Field exists regardless of variant */
uint32 always_present;
ExampleEnum type = number;
/* Only fields included in the type == number variant is described */

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we express multiple selects and their associated qualified members in this notation? (Such case does not exist in DAP so far I think)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this doesn't occur in DAP, I don't think we need to define it. Also, I would push back pretty hard on any struct definition that contained multiple selects. That would almost certainly allow construction of messages that aren't semantically valid, which would force extra validation checks on implementations. I think we would always prefer a struct contain a single enumeration where all its variants are valid over multiple enumerated types.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From, the semantics of variants, it is possible to have several selects in a structure. Since variants allow dynamic members of structure, it sounds like legitimate definition to me. Am I missing anything here? Since we are coming up with a notation that could probably be followed in future DAP specs too, I'm trying to make sure we define something that lasts.

I'm fine if you would like to defer this to later updates.

Overall, In this notation, I didn't see the distinction between representing alwaysExsting fields vs fields added as a result of a specific value of enum. Since the order of fields matter, and these dynamic fields can appear in the middle of two static fields, some visual cue (bold/italicized etc) could help to locate them.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you give an example of when multiple selects in the same struct is ambiguous?


{{Section 3.7 of !RFC8446}} defines a syntax for structure fields whose values
are constants. In this document, we do not use that notation, but use something
similar to describe specific variants of structures containing enumerated types,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgeoghegan does this mean the syntax from {{Section 3.7 of !RFC8446}} is forbidden in this doc?
If a structure has the following def:

struct {
   uint32 always_present;
   ExampleEnum type;
}

Then does the below have ambiguity?

struct variant {
   uint32 always_present = 0;
   ExampleEnum type = number;
}

Does it mean always_present can only be a constant 0 or it just happens to be 0 in this variant?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tgeoghegan does this mean the syntax from {{Section 3.7 of !RFC8446}} is forbidden in this doc?

I don't think so. By introducing struct variant, we avoid collision with the RFC 8446 s3.7 notation, meaning it can be used without further complications. However, I don't think DAP ever should: TLS 1.3 needs that notation because it wants some its messages to be backward compatible with TLS 1.2. We have no such problem.

If a structure has the following def:

struct {
   uint32 always_present;
   ExampleEnum type;
}

Then does the below have ambiguity?

struct variant {
   uint32 always_present = 0;
   ExampleEnum type = number;
}

Does it mean always_present can only be a constant 0 or it just happens to be 0 in this variant?

I don't think there's ambiguity because using struct variant makes it clear we're not using the notation from RFC 8446 section 3.7.

Copy link
Contributor

@wangshan wangshan Jul 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's ambiguity because using struct variant makes it clear we're not using the notation from RFC 8446 section 3.7.

I see, so it essentially overrides RFC 8446 s3.7. Do you think it's worth calling out this in the example? @tgeoghegan

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not override that section of RFC 8446. The notation in 8446 section 3.7 is struct { ... } whatever. The notation we introduce here is struct variant { ... } whatever which does not conflict.

@suman-ganta
Copy link

struct variant is kind of indicating it is deviation from struct, but most of the struct semantics apply. variant alone is not defined anywhere, so it would leave every one for wild interpretations.

@cjpatton
Copy link
Collaborator

@tgeoghegan please squash and merge at will!

Explains in detail how the syntax from RFC 8446 section 3.7 is
repurposed for concise descriptions of structure variants. Additionally,
the section on message encoding is moved to "Protocol Definition" to
make the document flow better.

Closes #472
@tgeoghegan tgeoghegan force-pushed the timg/tls-presentation-exceptions branch from 294c978 to 2eb189a Compare July 27, 2024 16:48
@tgeoghegan tgeoghegan merged commit 93fca57 into main Jul 27, 2024
2 checks passed
branlwyd added a commit that referenced this pull request Oct 10, 2024
branlwyd added a commit that referenced this pull request Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document extensions to and/or deviations from RFC 8446 presentation language
5 participants