Subject: [quicwg/base-drafts] Header protection mask for server Initial packet example from -tls A.3 seems incorrect (#4405)

From: Paul Mabileau <[email-masked]>
Date: Mon, 23 Nov 2020 13:14:13 -0800

Hey there!

We are currently implementing the Initial packet encryption process and it successfully works with the client Initial example from the appendix A.2 of the QUIC-TLS draft.

However, when running tests with values for the server Initial example from the appendix A.3, tests regarding the parsing, header sampling, mask generation, header protection and final encryption result all succeed, except for the header protection sample: the value we generate is: `56fb1381e7`, while the draft explicitly specifies it should be something completely different: `abaaf34fdc`. Note that the value we generate is indeed used later on for the header protection and final encryption result, which both reveal successful.

Therefore, three possibilities we thought of, in ascending order of probability:
 * Our implementation is completely broken.
 * The mask value provided by the current version of the specification (A.3) is correct, but all others are incorrect.
 * Only the mask value is incorrect, while the rest is correct.

We think the last option is the most probable one, as it could just mean it was forgotten to be updated in a recent draft version. If you think this is the case as well, then I would gladly open up a PR in order to close this, I just wanted to make sure beforehand. Otherwise, I would happily accept a tad of guidance towards a correct implementation.

Thanks in advance,
Paul.

-- 
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/4405

---

From: Paul Mabileau <[email-masked]>
Date: Tue, 24 Nov 2020 12:59:22 -0800

Investigated a bit more. Looking at the result of a `blame`, we can see that:

```blame
2ebdfd53a (Martin Thomson     2020-10-21 08:40:17 +1100 2214) sample = 823a5d24534d906ce4c76782a2167e34
6e9bfe065 (Martin Thomson     2020-06-04 14:39:25 +1000 2215) mask   = abaaf34fdc
2ebdfd53a (Martin Thomson     2020-10-21 08:40:17 +1100 2216) header = c7ff0000200008f067a5502a4262b5004075fb12
```

2ebdfd53a is indeed meant to update example vectors, while 2ebdfd53a is for other secrets, but the latter does is it completely.

```diff
 ~~~
-sample = 7002596f99ae67abf65a5852f54f58c3
-mask   = 38168a0c25
-header = c9ff00001d0008f067a5502a4262b5004074168b
+sample = 823a5d3a1207c86ee49132824f046524
+mask   = abaaf34fdc
+header = caff00001d0008f067a5502a4262b5004074aaf2
 ~~~
```

So it should confirm our hypothesis.

-- 
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/4405#issuecomment-733229750

---

From: Lucas Pardue <[email-masked]>
Date: Tue, 24 Nov 2020 15:35:52 -0800

hi @PaulDance. Our editors are taking some slight respite, we'll respond soon.

-- 
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/4405#issuecomment-733294331

---

From: Paul Mabileau <[email-masked]>
Date: Tue, 24 Nov 2020 15:43:38 -0800

No problem @LPardue! I was just adding some more information I forgot to mention yesterday. Thanks for the heads up :+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/4405#issuecomment-733298710

---

From: kjsisco <[email-masked]>
Date: Wed, 25 Nov 2020 09:23:59 -0800

It seems to me that the header is not correct.  Thoughts?

-- 
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/4405#issuecomment-733843516

---

From: Paul Mabileau <[email-masked]>
Date: Wed, 25 Nov 2020 09:43:25 -0800

For me the header looks fine: it is coherent with the final result. What looks wrong to you?

-- 
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/4405#issuecomment-733854001