Subject: [quicwg/base-drafts] Clearer pseudocode/TLS syntax specification (#1449)

From: Robin Marx <[email-masked]>
Date: Fri, 15 Jun 2018 08:07:46 -0700

I am quite new to the whole RFC stuff, so I am sorry for using hopelessly wrong names for things. 

I had some trouble today understanding some of the pseudocode in the transport draft, more specifically at https://tools.ietf.org/html/draft-ietf-quic-transport-12#section-6.4 :

```
struct {
 TransportParameterId parameter;
 opaque value<0..2^16-1>;
} TransportParameter;

struct {
 select (Handshake.msg_type) {
	case client_hello:
	   QuicVersion initial_version;

	case encrypted_extensions:
	   QuicVersion negotiated_version;
	   QuicVersion supported_versions<4..2^8-4>;
 };
 TransportParameter parameters<22..2^16-1>;
} TransportParameters;
```

For example the 'supported_versions' field: is that supposed to be an array prefixed with a length? Current implementations seem to think so. The 'value' field above is a single value prefixed with a length. But then the 'parameters' field below is very similar in syntax, but is not prefixed by length in the implementations (or I'm reading some things wrong, always possible).

I asked @larseggert about this, and he secretly admitted "Nobody but ekr understands the TLS syntax. It’s a huge pain.". Even if I'm misinterpreting some things, an alternative syntax or at least a clear explanation would be welcome (if that is already in there somewhere, possibly link it in https://tools.ietf.org/html/draft-ietf-quic-transport-12#section-2.1?)

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449

---

From: Dmitri Tikhonov <[email-masked]>
Date: Fri, 15 Jun 2018 08:14:14 -0700

Gee, way to keep a secret! 😃

>From the second paragraph of the draft:

```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#issuecomment-397653456

---

From: Robin Marx <[email-masked]>
Date: Fri, 15 Jun 2018 08:24:42 -0700

Ok, Friday afternoon is not the best time for me to read specs, clearly... that's a lot clearer now, thanks.

I do think the overall question of keeping this syntax still stands though, as it's not very intuitive, and @larseggert mentioned meaning to open an issue about this himself. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#issuecomment-397656593

---

From: ekr <[email-masked]>
Date: Fri, 15 Jun 2018 16:04:45 +0000 (UTC)

It comes as a surprise to me that @larseggert  thinks that nobody but me understands the syntax, given that we have a pile of independent interoperable TLS 1.3 stacks.

Regardless, this is the appropriate syntax because these are PDUs that go into the TLS stack, which already uses that syntax. We don't need to explicitly state the size of the parameters because the protocol definition language tells youl

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#issuecomment-397667623

---

From: Martin Thomson <[email-masked]>
Date: Fri, 15 Jun 2018 09:28:30 -0700

What @ekr said.  Also, this is the most complicated part of the protocol grammar and using pictures and words would be much more verbose and likely less precise.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#issuecomment-397674409

---

From: Martin Thomson <[email-masked]>
Date: Fri, 15 Jun 2018 09:28:30 -0700

Closed #1449.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#event-1683806465

---

From: Mike Bishop <[email-masked]>
Date: Fri, 15 Jun 2018 09:57:41 -0700

QuicVersion is explicitly defined as a uint32, so references to that type are already a known size. The other things with explicit sizes given are arrays (albeit sometimes arrays of bytes that represent a single value), and arrays are length-prefixed. 

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/quicwg/base-drafts/issues/1449#issuecomment-397682236