aiortc / aioquic

QUIC and HTTP/3 implementation in Python
BSD 3-Clause "New" or "Revised" License
1.66k stars 236 forks source link

Ignore non-ASCII ALPN [#374]. #467

Closed rthalley closed 7 months ago

rthalley commented 7 months ago

Much like PR #375, this ignores non-ASCII APLNs, but unlike #375 there is an explicit protocol for skipping things when pulling a list. The ALPN decoder catches decoding exceptions and uses the protocol to say "ignore this list element". There is also a test.

We could probably accept anything that decoded as UTF-8 instead of just ASCII as I think the mapping from UTF-8 to Unicode code points is an isomorphism, but I kept the ASCII behavior as I'm really only trying to fix the greasing issue.

Note that there are a few changes not related to this fix caused by black formatting tls.py.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (74e8479) 100.00% compared to head (4738aee) 100.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #467 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 25 25 Lines 4884 4891 +7 ========================================= + Hits 4884 4891 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.