Subject: [quicwg/base-drafts] Clear up confusion about label encoding (#4201)

From: Martin Thomson <[email-masked]>
Date: Tue, 13 Oct 2020 17:00:28 -0700

This was, I think clear, but the use of HKDF-Expand-Label and the
encoding of labels into octets could be even more explicit.

Closes #4197.
You can view, comment on, or merge this pull request online at:

  https://github.com/quicwg/base-drafts/pull/4201

-- Commit Summary --

  * Clear up confusion about label encoding

-- File Changes --

    M draft-ietf-quic-tls.md (15)

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/4201.patch
https://github.com/quicwg/base-drafts/pull/4201.diff

-- 
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/pull/4201

---

From: Sean Turner <[email-masked]>
Date: Wed, 14 Oct 2020 06:48:54 -0700

@seanturner approved this pull request.

-- 
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/pull/4201#pullrequestreview-508366328

---

From: Magnus Westerlund <[email-masked]>
Date: Thu, 15 Oct 2020 05:19:32 -0700

@gloinul approved this pull request.

-- 
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/pull/4201#pullrequestreview-509315828

---

From: Jana Iyengar <[email-masked]>
Date: Thu, 15 Oct 2020 13:41:06 -0700

@janaiyengar approved this pull request.

nits

> @@ -924,8 +924,10 @@ based on the client's initial Destination Connection ID, as described in
 The keys used for packet protection are computed from the TLS secrets using the
 KDF provided by TLS.  In TLS 1.3, the HKDF-Expand-Label function described in
 Section 7.1 of {{!TLS13}} is used, using the hash function from the negotiated
-cipher suite.  Other versions of TLS MUST provide a similar function in order to
-be used with QUIC.
+cipher suite.  Note that labels, which are described using strings, are encoded
+as bytes using ASCII {{?ASCII=RFC0020}} without quotes or any trailing NUL
+byte.  Other versions of TLS MUST provide a similar function in order to be

```suggestion
bytes.  Other versions of TLS MUST provide a similar function in order to be
```

> @@ -950,10 +952,11 @@ pseudorandom key (PRK) that is used to derive two separate secrets for sending
 and receiving.
 
 The secret used by clients to construct Initial packets uses the PRK and the
-label "client in" as input to the HKDF-Expand-Label function to produce a 32
-byte secret; packets constructed by the server use the same process with the
-label "server in".  The hash function for HKDF when deriving initial secrets
-and keys is SHA-256 {{!SHA=DOI.10.6028/NIST.FIPS.180-4}}.
+label "client in" as input to the HKDF-Expand-Label function from TLS
+{{!TLS13}} to produce a 32 byte secret.  Packets constructed by the server use

```suggestion
{{!TLS13}} to produce a 32-byte secret.  Packets constructed by the server use
```

-- 
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/pull/4201#pullrequestreview-509791112

---

From: Martin Thomson <[email-masked]>
Date: Thu, 15 Oct 2020 16:37:10 -0700

@martinthomson pushed 1 commit.

7d7a1caa00d61da3a76e2918bf401c96cf293b26  hyphenate your bites

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/4201/files/d64bfcdd4aff399219736541484bd0109b3e88c7..7d7a1caa00d61da3a76e2918bf401c96cf293b26

---

From: Martin Thomson <[email-masked]>
Date: Thu, 15 Oct 2020 16:37:18 -0700

@martinthomson commented on this pull request.

This is singular intentionally, to avoid problems like might arise from:

```c
const char* label = "quic key";
hkdf_expand_label(...., label, strlen(label), ...);
```

-- 
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/pull/4201#discussion_r505922782

---

From: Martin Thomson <[email-masked]>
Date: Thu, 15 Oct 2020 16:37:27 -0700

Merged #4201 into master.

-- 
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/pull/4201#event-3883971588