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

Remove "baseline TLS" handshake reconstruction #60

Merged
merged 13 commits into from
Jul 8, 2022
Merged

Conversation

bemasc
Copy link
Collaborator

@bemasc bemasc commented Jun 28, 2022

This is a radical change that attempts to implement the (possible)
consensus to move from a "reconstruction-based" transcript to a
"non-reconstruction" transcript. Verifying the transcript without
reconstruction requires the transcript to include the template,
which requires a byte-identical representation of the template.
This change makes this possible by introducing a stable binary
representation of the template, with JSON as a human-readable
alternative.

This change also attempts to:

  • Formalize the notion of when vector lengths can be omitted
  • Rearrange the extension templating in a more convenient fashion

Fixes #57

Ben Schwartz added 5 commits June 8, 2022 14:58
This is a radical change that attempts to implement the (possible)
consensus to move from a "reconstruction-based" transcript to a
"non-reconstruction" transcript.  Verifying the transcript without
reconstruction requires the transcript to include the template,
which requires a byte-identical representation of the template.
This change makes this possible by introducing a stable binary
representation of the template, with JSON as a human-readable
alternative.

This change also attempts to:
* Clarify the use of cTLS in datagram contexts
 - Including how retransmission works without sequence numbers
* Formalize the notion of when vector lengths can be omitted
* Rearrange the extension templating in a more convenient fashion

Fixes #57
@bemasc
Copy link
Collaborator Author

bemasc commented Jun 28, 2022

Blocked by #55 and #59

Copy link
Collaborator

@ekr ekr left a comment

Choose a reason for hiding this comment

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

I like the way this is going, but I think we probably can't quite land it before IETF. Once you've had a chance to respond to these comments, let's take the remaining ones to discussion.

For ease of configuration, an equivalent JSON dictionary format is also defined.
It consists of a dictionary whose keys are the name of each element type (converted
from snake_case to camelCase), and whose values are a type-specific representation
of the element intended to maximize legibility.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change separable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure what you mean. I've put up #61 as an intermediate step that introduces the binary format without changing the transcript.

If you mean creating a version that doesn't define a JSON format at all: that is possible, but I didn't want to remove the JSON option without asking. I have no strong preference on whether we define a JSON format.

Value: a single `ProtocolVersion` ({{!RFC8446, Section 4.1.2}}) that both parties agree to use. For TLS 1.3, the `ProtocolVersion` is 0x0304.

When this element is included, the `supported_versions` extension
is omitted from ClientHello.extensions, and the
Copy link
Collaborator

Choose a reason for hiding this comment

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

Something missing here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed, thanks.

* `extension_type` is omitted because it is specified by `expected_extensions`
* The length of `extensions` is omitted because `allow_additional` is false, the number of items in `extensions` (i.e., 1) is known in advance.

The only exception to this rule is `ClientHello.profile_id`, which is processed before the profile is known.
Copy link
Collaborator

Choose a reason for hiding this comment

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

How clever will one have to be to get this right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My goal here was mostly to capture a behavior that was implied by some examples but not described anywhere in the text. I've attempted to make this rule more explicit, to avoid any tricky reasoning being required.

containing the `CTLSTemplate` used for this connection. This message is
included in the transcript even though it is not exchanged during connection
setup, in order to ensure that both parties are using the same template.
Subsequent messages are appended to the transcript as usual.
Copy link
Collaborator

Choose a reason for hiding this comment

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

We may have to consume a handshake type for this to ensure it's injective.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, that's in the IANA section. I've attempted to make that clearer here.

Comment on lines 165 to 167
struct {
CTLSTemplateElement elements<0..2^32-1>
} CTLSTemplate;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think that this needs some sort of unambiguous identifier, like a version number, that ensures that we can replace this. Maybe that's included in the process for integrating that into the transcript (ctls_template), which is OK, but a system for replacing this scheme with a better one is very important to have, even if this turns out to be perfect the first time.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

OK, I added CTLSTemplate.ctls_version field.

@bemasc bemasc force-pushed the bemasc-transcript branch from 67d1c46 to cd9eb37 Compare July 1, 2022 18:29
bemasc pushed a commit that referenced this pull request Jul 1, 2022
This is an intermediate step toward being able to include the
template in the transcript (#60).  It also enables more efficient
distribution of cTLS templates.

See also #57
@bemasc bemasc requested a review from ekr July 1, 2022 18:59
Copy link
Collaborator

@ekr ekr left a comment

Choose a reason for hiding this comment

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

I think this could use with some refinement, but it would be better in the draft than out.

@bemasc bemasc marked this pull request as ready for review July 8, 2022 11:54
@bemasc bemasc changed the title Proposal: cTLS without reconstruction Remove "baseline TLS" handshake reconstruction Jul 8, 2022
@bemasc bemasc merged commit 798929b into master Jul 8, 2022
@bemasc bemasc deleted the bemasc-transcript branch July 8, 2022 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Figure out which transcript is authenticated
3 participants