Subject: [quicwg/base-drafts] Make the packet number encryption sampling clearer (#1389)

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 17:26:22 -0700

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

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

-- Commit Summary --

  * Make the packet number encryption sampling clearer

-- File Changes --

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

-- Patch Links --

https://github.com/quicwg/base-drafts/pull/1389.patch
https://github.com/quicwg/base-drafts/pull/1389.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/1389

---

From: Nick Banks <[email-masked]>
Date: Thu, 24 May 2018 17:34:48 -0700

nibanks commented on this pull request.

>                      packet_length - aead_expansion)
 sample = packet[sample_offset..sample_offset+sample_length]
 ~~~
 
+A packet with a long header is sampled in the same way, noting that multiple
+QUIC packets might be included in the same UDP datagram and that each one is
+handled separately.
+
+~~~
+sample_offset = min(2 + len(destination_connection_id) +
+                      len(source_connection_id) +
+                      len(payload_length) + 4,
+                    packet_length - aead_expansion)

I assume `packet_length` refers to the QUIC packet length and not the UDP payload length, right? If so, how's this supposed to be determined from a long header packet, especially if it's the first of several compound packets?

-- 
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/1389#pullrequestreview-123215273

---

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 17:36:53 -0700

martinthomson commented on this pull request.

Ahh, I see the problem.  You don't know where the payload length starts.  It seems like we need to make the payload length cover the packet number length.  More changes inbound.

-- 
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/1389#discussion_r190766249

---

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 17:43:49 -0700

@martinthomson pushed 1 commit.

5b81241  Include packet number in the length field for long headers

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/1389/files/edff8245c8e4c37b81228ed749c5ec3ee32c90c8..5b81241afde217913da969b9818988f3015ffd11

---

From: Kazuho Oku <[email-masked]>
Date: Thu, 24 May 2018 17:52:11 -0700

kazuho commented on this pull request.

Shouldn't `2` be `6`? There are the type octet, version (4 octets), CILs (1 octets).

-- 
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/1389#pullrequestreview-123217242

---

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 17:55:29 -0700

c408ba4  Missed version

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/1389/files/5b81241afde217913da969b9818988f3015ffd11..c408ba49093c53bb2c2fcc2b8ec0d7a84175daa8

---

From: Tatsuhiro Tsujikawa <[email-masked]>
Date: Thu, 24 May 2018 18:07:11 -0700

tatsuhiro-t commented on this pull request.

> @@ -942,16 +942,28 @@ Packet number protection is applied after packet protection is applied (see
 encryption algorithm.
 
 In sampling the packet ciphertext, the packet number length is assumed to be the

Shouldn't "packet number length" be "sample_offset"?

-- 
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/1389#pullrequestreview-123219038

---

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 18:17:41 -0700

encryption algorithm.

No, but I see how this text is confusing, I'll rephrase and we can try again.

-- 
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/1389#discussion_r190770279

---

From: Martin Thomson <[email-masked]>
Date: Thu, 24 May 2018 18:18:18 -0700

10df2ab  Rephrase the description of sampled ciphertext

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/1389/files/c408ba49093c53bb2c2fcc2b8ec0d7a84175daa8..10df2aba8abf129badd3ebfdc0e74b73de3d0eb4

---

From: Tatsuhiro Tsujikawa <[email-masked]>
Date: Thu, 24 May 2018 18:50:13 -0700

tatsuhiro-t 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/1389#pullrequestreview-123224200

---

From: Mike Bishop <[email-masked]>
Date: Sat, 26 May 2018 15:51:48 -0700

MikeBishop commented on this pull request.

> @@ -941,17 +941,34 @@ Packet number protection is applied after packet protection is applied (see
 {{aead}}).  The ciphertext of the packet is sampled and used as input to an
 encryption algorithm.
 
-In sampling the packet ciphertext, the packet number length is assumed to be the
-smaller of the maximum possible packet number encoding (4 octets), or the size
-of the protected packet minus the minimum expansion for the AEAD.  For example,
-the sampled ciphertext for a packet with a short header can be determined by:
+In sampling the packet ciphertext, the packet number length is assumed to be
+either 4 octets (its maximum possible encoded length), unless there is

Either implies two options. I'd just drop it. 

-- 
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/1389#pullrequestreview-123568202

---

From: Martin Thomson <[email-masked]>
Date: Mon, 28 May 2018 19:36:55 -0700

0cdfe02  Remove either

-- 
You are receiving this because you are subscribed to this thread.
View it on GitHub:
https://github.com/quicwg/base-drafts/pull/1389/files/10df2aba8abf129badd3ebfdc0e74b73de3d0eb4..0cdfe026fef92139f6660897d9218a6a10d1ca19

---

From: Martin Thomson <[email-masked]>
Date: Mon, 28 May 2018 19:37:04 -0700

Merged #1389.

-- 
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/1389#event-1650101012