feat: Add address validation token support #2216
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello!
It took a while but I implemented address validation token (AVT) support, wished for in #1112, for example.
With this PR, the following features are added:
Furthermore, I added several testcases covering these use cases and some edge-cases.
Open questions
I can see an issue in the way I save AVTs received from the server. In my implementation, for every path I fill a
VecDeque<Vec<u8>>with tokens received on the specific path. If the client does not take out the tokens regularly, they can add up, leading the application to run out of memory in the long term, especially if the server maliciously sends many large NEW_TOKEN frames. Should I change this to a ring-buffer based implementation, potentially with configurable size. imo, this does not pose any problem, as most of the time, only the newest token is interesting to us, but there are QUIC implementations out there, that send multiple NEW_TOKEN frames, which I wanted to reflect correctly.