Subject: Re: [quicwg/base-drafts] 5.6 Packet Number Protection is hard to follow (#1387)

From: elenagurevich <[email-masked]>
Date: Sun, 08 Jul 2018 02:00:47 -0700

Hello, i wondering to understand how this issue is cleared in case of short header format ?
Long Header just contzine explicit length field may be used for packet sample, what about short header ?

-- 
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/1387#issuecomment-403273431

---

From: Martin Thomson <[email-masked]>
Date: Sun, 08 Jul 2018 18:00:52 -0700

A UDP datagram has a length.  The short packet takes up the remainder of the UDP datagram.

-- 
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/1387#issuecomment-403332213

---

From: elenagurevich <[email-masked]>
Date: Sun, 08 Jul 2018 23:52:28 -0700

So, UDP datagram contains one and only one QUIC short packet ? 
In case the payload is not long enough we can sample ICV generated by AEAD ?

-- 
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/1387#issuecomment-403377645

---

From: MikkelFJ <[email-masked]>
Date: Mon, 09 Jul 2018 00:48:40 -0700

ICV (integrity check value?)
If a short header does not have a valid AEAD tag at the end, it would be protocol error that likely results in a dropped packet, not something to search for regardles of whether there are long packets before, or not. However QUIC states that packets should be processed individually, so a bad short packet should not stop you from processing what comes before (not sure I agree with that, but that is the spec).

-- 
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/1387#issuecomment-403390584

---

From: elenagurevich <[email-masked]>
Date: Mon, 09 Jul 2018 02:23:22 -0700

No i mean the following:
a single QUIC short packet may be contained within a single UDP datagram --> hence UDP header length may be used to determine protected packet length. 
packet_length = sizesof(ShortHeader) + sizeof(Protected_Payload)+sizeof(Authentication Tag)
but if  
_sample_offset + sample_length > packet_length 
then 
sample_offset = packet_length - sample_length_ 
So it may happen  that sample will take bytes from authentication tag (ICV) depending on actual payload size. 
Once the sample is known we can remove protection from the packet_number.
Once packet_number is decrypted,  its size is known, its value can be decoded, so we can form nonce, locate start of protected payload and decrypt& verify authentication tag of a packet.

-- 
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/1387#issuecomment-403416469

---

From: MikkelFJ <[email-masked]>
Date: Mon, 09 Jul 2018 02:26:23 -0700

Ah, ok - I don't recall the details, but there was a lot of discussion, the spec was clarified, and later pseudocode was added - so if you read carefully I suspect you will find the right answer.

-- 
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/1387#issuecomment-403417245

---

From: elenagurevich <[email-masked]>
Date: Mon, 09 Jul 2018 02:34:41 -0700

Can you send me a pseudocode reference please ? 
I am new in QUIC so probably just missed all interesting stuff :)

-- 
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/1387#issuecomment-403419628

---

From: Martin Thomson <[email-masked]>
Date: Mon, 09 Jul 2018 03:01:16 -0700

There is pseudocode about packet number encodings, nothing else (yet).

The important thing about short packet headers is that they can be in the same packet as another packet, but they are always the last packet in the datagram.

-- 
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/1387#issuecomment-403427058

---

From: MikkelFJ <[email-masked]>
Date: Mon, 09 Jul 2018 03:04:28 -0700

you mean "can be in the same datagram as another packet..."

pseudocode
https://quicwg.org/base-drafts/draft-ietf-quic-transport.html#rfc.appendix.A

-- 
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/1387#issuecomment-403427938