Skip to content
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

Merged
merged 5 commits into from
May 29, 2018
Merged

Conversation

martinthomson
Copy link
Member

Fixes #1387.

@martinthomson martinthomson added editorial An issue that does not affect the design of the protocol; does not require consensus. -tls labels May 25, 2018
@martinthomson martinthomson requested a review from tatsuhiro-t May 25, 2018 00:26
sample_offset = min(2 + len(destination_connection_id) +
len(source_connection_id) +
len(payload_length) + 4,
packet_length - aead_expansion)
Copy link
Member

@nibanks nibanks May 25, 2018

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?

Copy link
Member Author

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.

@martinthomson martinthomson removed the editorial An issue that does not affect the design of the protocol; does not require consensus. label May 25, 2018
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.
handled separately.

~~~
sample_offset = min(2 + len(destination_connection_id) +
Copy link
Member

@kazuho kazuho May 25, 2018

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).

@@ -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
Copy link
Contributor

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"?

Copy link
Member Author

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.
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
Copy link
Contributor

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.

@martinthomson martinthomson merged commit 8bb1b7b into master May 29, 2018
@martinthomson martinthomson deleted the issue1387 branch May 29, 2018 02:51
@martinthomson martinthomson added editorial An issue that does not affect the design of the protocol; does not require consensus. and removed editorial An issue that does not affect the design of the protocol; does not require consensus. labels Jun 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants