-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the packet number encryption sampling clearer #1389
Conversation
draft-ietf-quic-tls.md
Outdated
sample_offset = min(2 + len(destination_connection_id) + | ||
len(source_connection_id) + | ||
len(payload_length) + 4, | ||
packet_length - aead_expansion) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume packet_length
refers to the QUIC packet length and not the UDP payload length, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
This ensures that the packet number encryption can work because that relies on knowing where the end of the packet is. This means that packet coalescing in -12 was busted.
draft-ietf-quic-tls.md
Outdated
handled separately. | ||
|
||
~~~ | ||
sample_offset = min(2 + len(destination_connection_id) + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't 2
be 6
? There are the type octet, version (4 octets), CILs (1 octet).
draft-ietf-quic-tls.md
Outdated
@@ -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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't "packet number length" be "sample_offset"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but I see how this text is confusing, I'll rephrase and we can try again.
This was missing a few things, which made it confusing.
draft-ietf-quic-tls.md
Outdated
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either implies two options. I'd just drop it.
Fixes #1387.