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

Next steps for Quinn support (cont'd) #1798

Merged
merged 7 commits into from
Feb 27, 2024
Merged

Next steps for Quinn support (cont'd) #1798

merged 7 commits into from
Feb 27, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Feb 20, 2024

This is a continuation of #1741, with some adjustments/new work:

  1. It's rebased on main instead of rel-0.22 - I'm happy to backport this work if it would help with Quinn testing but in order to merge this to unblock 0.23 release preparation #1777 we'll need a version targetting main.
  2. Ctz's feedback w.r.t ciphersuite integrity and confidentiality limits has been integrated.
  3. The change to start constructing quic keys from the crypto provider is separated from the change making the CryptoProvider accessible from a [Client|Server]Config.
  4. Instead of implementing AsRef<Arc<CryptoProvider>> to expose the provider, simpler accessor methods are used.
  5. The QUIC-specific deframer panic discovered downstream in Quinn's testing has been reproduced with a simple integration test, and fixed. This was a regression introduced in 0.22. The provided integration test passes when backported to 0.21, panics on 0.22, and panics on tip of main. With the fix proposed in this branch the test passes again.
  6. The quic::InitalSuite API improvements from the original branch are reworked based on Djc's later feedback, adding a quic::Suite type and a Tls13CipherSuite helper.

@cpu cpu self-assigned this Feb 20, 2024
Copy link

codecov bot commented Feb 20, 2024

Codecov Report

Attention: Patch coverage is 47.91667% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 95.90%. Comparing base (0eab92f) to head (9d547f7).

❗ Current head 9d547f7 differs from pull request most recent head 9852c1d. Consider uploading reports for the commit 9852c1d to get more accurate results

Files Patch % Lines
rustls/src/quic.rs 0.00% 9 Missing ⚠️
rustls/src/crypto/ring/quic.rs 75.00% 6 Missing ⚠️
rustls/src/tls13/mod.rs 0.00% 4 Missing ⚠️
rustls/src/client/client_conn.rs 50.00% 3 Missing ⚠️
rustls/src/server/server_conn.rs 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1798      +/-   ##
==========================================
- Coverage   95.95%   95.90%   -0.05%     
==========================================
  Files          84       81       -3     
  Lines       18822    18717     -105     
==========================================
- Hits        18060    17950     -110     
- Misses        762      767       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up, @cpu!

I think we should definitely get the Quinn upgrade PR passing CI before we merge this, to avoid getting similar issues again.

rustls/src/msgs/deframer.rs Outdated Show resolved Hide resolved
rustls/src/client/client_conn.rs Outdated Show resolved Hide resolved
rustls/src/quic.rs Outdated Show resolved Hide resolved
@cpu
Copy link
Member Author

cpu commented Feb 21, 2024

I think we should definitely get the quinn-rs/quinn#1715 passing CI before we merge this

@djc I'm thinking the best route for that is to update quinn#1715 to target this branch/Rustls main. From my perspective it seems like it might make the most sense to have Quinn jump over 0.22 straight to the soon-to-be-cut 0.23 that would roll in the changes from this branch.

@djc
Copy link
Member

djc commented Feb 21, 2024

I think we should definitely get the quinn-rs/quinn#1715 passing CI before we merge this

@djc I'm thinking the best route for that is to update quinn#1715 to target this branch/Rustls main. From my perspective it seems like it might make the most sense to have Quinn jump over 0.22 straight to the soon-to-be-cut 0.23 that would roll in the changes from this branch.

Yup, I agree that that makes sense.

@cpu
Copy link
Member Author

cpu commented Feb 21, 2024

I guess one downside is that it wouldn't help the folks still working through upgrading to the 0.22 release (e.g. h3 for the reqwest/hyper ecosystem). They'll still be blocked, but now on a 0.23 update instead of a Quinn update w/ 0.22.

There isn't really a fix for that other than backporting breaking changes to 0.22 and pretending they aren't :-/

Copy link

rustls-benchmarking bot commented Feb 22, 2024

Benchmark results

Instruction counts

Significant differences

There are no significant instruction count differences

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 4505902 4544618 38716 (0.86%) 3.33%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4521787 4499836 -21951 (-0.49%) 1.08%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 8640049 8678733 38684 (0.45%) 0.96%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 8673633 8707631 33998 (0.39%) 0.78%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_server 4058005 4048007 -9998 (-0.25%) 3.74%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 30311073 30253387 -57686 (-0.19%) 0.51%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 32515402 32457488 -57914 (-0.18%) 0.54%
handshake_tickets_ring_1.2_rsa_aes_client 4710215 4716902 6687 (0.14%) 0.84%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 12295468 12278681 -16787 (-0.14%) 1.27%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 30281637 30241324 -40313 (-0.13%) 0.48%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 12683050 12697058 14008 (0.11%) 0.89%
handshake_tickets_ring_1.2_rsa_aes_server 4758865 4763952 5087 (0.11%) 0.61%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 30448752 30419111 -29641 (-0.10%) 0.40%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 32501551 32471485 -30066 (-0.09%) 0.51%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 32701096 32674771 -26325 (-0.08%) 0.83%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80446607 80506701 60094 (0.07%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 30264009 30241886 -22123 (-0.07%) 0.26%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 32655525 32679345 23820 (0.07%) 0.63%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 57998229 57957270 -40959 (-0.07%) 0.23%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 12671188 12662336 -8852 (-0.07%) 0.93%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 32488000 32466841 -21159 (-0.07%) 0.26%
handshake_session_id_ring_1.2_rsa_aes_server 4323100 4325646 2546 (0.06%) 0.56%
handshake_tickets_ring_1.3_rsa_aes_server 43775279 43798540 23261 (0.05%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 43532013 43552290 20277 (0.05%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3895658 3897394 1736 (0.04%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 43450496 43431347 -19149 (-0.04%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46254412 46273379 18967 (0.04%) 0.33%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 32661921 32648741 -13180 (-0.04%) 0.42%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92414576 92378549 -36027 (-0.04%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_server 43731035 43714076 -16959 (-0.04%) 0.20%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 30682178 30671098 -11080 (-0.04%) 0.28%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1879644 1878972 -672 (-0.04%) 0.21%
handshake_session_id_ring_1.3_rsa_aes_client 42210713 42197117 -13596 (-0.03%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 30447205 30455985 8780 (0.03%) 0.22%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 30454031 30445467 -8564 (-0.03%) 0.54%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 32652925 32661802 8877 (0.03%) 0.33%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 32644140 32635778 -8362 (-0.03%) 0.29%
handshake_session_id_ring_1.2_rsa_aes_client 4441650 4442723 1073 (0.02%) 0.85%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 30442888 30450126 7238 (0.02%) 0.36%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46301652 46290770 -10882 (-0.02%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 46265040 46255301 -9739 (-0.02%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 42315976 42324730 8754 (0.02%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 41926856 41935413 8557 (0.02%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46303081 46294140 -8941 (-0.02%) 0.25%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 30300058 30305504 5446 (0.02%) 0.34%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 2128553 2128909 356 (0.02%) 0.39%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 4263016 4262340 -676 (-0.02%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_client 42009544 42002955 -6589 (-0.02%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 43739755 43746224 6469 (0.01%) 0.23%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 32428540 32433189 4649 (0.01%) 0.31%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 30483318 30478999 -4319 (-0.01%) 0.28%
handshake_tickets_ring_1.3_rsa_aes_client 42385879 42379978 -5901 (-0.01%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_aes_server 43534352 43540408 6056 (0.01%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 30428681 30424533 -4148 (-0.01%) 0.37%
handshake_tickets_ring_1.3_ecdsap256_aes_client 42177154 42171421 -5733 (-0.01%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 32474626 32470306 -4320 (-0.01%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 2126501 2126772 271 (0.01%) 0.32%
handshake_session_id_ring_1.3_rsa_chacha_client 42127397 42122418 -4979 (-0.01%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 43678973 43673952 -5021 (-0.01%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 43670300 43665318 -4982 (-0.01%) 0.23%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 42112533 42107845 -4688 (-0.01%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80346745 80355427 8682 (0.01%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 32456140 32452653 -3487 (-0.01%) 0.30%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 3341235 3341578 343 (0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1883210 1883399 189 (0.01%) 0.20%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 4181013 4181427 414 (0.01%) 1.00%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 30680117 30677403 -2714 (-0.01%) 0.31%
handshake_session_id_ring_1.3_ecdsap384_aes_client 42017725 42014014 -3711 (-0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 3355492 3355764 272 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46231295 46234999 3704 (0.01%) 0.33%
handshake_session_id_ring_1.3_rsa_aes_server 43542961 43539734 -3227 (-0.01%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 42168735 42165808 -2927 (-0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 4258072 4257779 -293 (-0.01%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80356078 80350857 -5221 (-0.01%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_client 4440468 4440188 -280 (-0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 3366588 3366386 -202 (-0.01%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 43445706 43448260 2554 (0.01%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 43753416 43750855 -2561 (-0.01%) 0.33%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 13734917 13734133 -784 (-0.01%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 13736907 13737576 669 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 4547510 4547306 -204 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92429802 92433882 4080 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92396763 92392837 -3926 (-0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 41915098 41913349 -1749 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 3345344 3345232 -112 (-0.00%) 0.23%
handshake_no_resume_ring_1.3_rsa_chacha_server 12246680 12247086 406 (0.00%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 32652793 32653602 809 (0.00%) 0.35%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58066420 58065049 -1371 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 4538178 4538082 -96 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 3151779 3151836 57 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_client 57920478 57921329 851 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3899109 3899163 54 (0.00%) 0.35%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 57966080 57965335 -745 (-0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 42096907 42096406 -501 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46265601 46266011 410 (0.00%) 0.25%
handshake_no_resume_ring_1.3_rsa_aes_server 12237242 12237136 -106 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58064239 58064712 473 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80343556 80343004 -552 (-0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 43439690 43439967 277 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 12042466 12042391 -75 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80445228 80445687 459 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46301032 46300780 -252 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_client 92398268 92398613 345 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 46176572 46176410 -162 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 35455271 35455148 -123 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58064526 58064360 -166 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 57986294 57986199 -95 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92455981 92456114 133 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 68386112 68386020 -92 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92395108 92395005 -103 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 35452358 35452391 33 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80455403 80455355 -48 (-0.00%) 0.20%

Wall-time

Significant differences

There are no significant wall-time differences

Other differences

Click to expand
Scenario Baseline Candidate Diff Threshold
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes 4.83 ms 4.73 ms -0.10 ms (-2.05%) 4.78%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.55 ms 5.45 ms -0.10 ms (-1.80%) 4.16%
transfer_no_resume_ring_1.3_ecdsap256_aes 6.67 ms 6.57 ms -0.10 ms (-1.56%) 3.61%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.76 ms 5.67 ms -0.08 ms (-1.48%) 3.47%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.78 ms 5.70 ms -0.08 ms (-1.33%) 3.79%
transfer_no_resume_ring_1.2_rsa_aes 7.15 ms 7.06 ms -0.09 ms (-1.21%) 2.97%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 478.12 µs 472.49 µs -5.63 µs (-1.18%) 2.28%
handshake_no_resume_ring_1.3_ecdsap256_chacha 509.03 µs 503.24 µs -5.79 µs (-1.14%) 2.47%
transfer_no_resume_ring_1.3_rsa_aes 7.25 ms 7.18 ms -0.07 ms (-0.99%) 2.60%
handshake_no_resume_ring_1.3_ecdsap256_aes 510.24 µs 505.19 µs -5.05 µs (-0.99%) 2.41%
transfer_no_resume_ring_1.3_ecdsap384_aes 9.77 ms 9.68 ms -0.09 ms (-0.96%) 2.64%
handshake_tickets_ring_1.2_rsa_aes 1.84 ms 1.83 ms -0.02 ms (-0.92%) 1.65%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 476.83 µs 472.58 µs -4.25 µs (-0.89%) 2.90%
handshake_session_id_ring_1.2_rsa_aes 1.75 ms 1.74 ms -0.01 ms (-0.83%) 2.59%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 13.32 ms 13.22 ms -0.10 ms (-0.75%) 1.70%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 14.03 ms 13.92 ms -0.10 ms (-0.72%) 1.68%
transfer_no_resume_ring_1.3_ecdsap256_chacha 13.33 ms 13.24 ms -0.09 ms (-0.71%) 1.86%
transfer_no_resume_ring_1.3_rsa_chacha 13.91 ms 13.82 ms -0.09 ms (-0.67%) 1.60%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 14.26 ms 14.16 ms -0.10 ms (-0.67%) 1.44%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 5.34 ms 5.37 ms 0.03 ms (0.61%) 2.91%
handshake_tickets_aws_lc_rs_1.2_rsa_aes 2.34 ms 2.32 ms -0.01 ms (-0.60%) 1.76%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 6.34 ms 6.37 ms 0.04 ms (0.59%) 2.64%
transfer_no_resume_ring_1.3_ecdsap384_chacha 16.43 ms 16.34 ms -0.09 ms (-0.56%) 1.67%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 6.04 ms 6.07 ms 0.03 ms (0.55%) 2.46%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 5.37 ms 5.40 ms 0.03 ms (0.52%) 2.65%
handshake_no_resume_ring_1.3_rsa_aes 1.09 ms 1.08 ms -0.01 ms (-0.51%) 1.00%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 6.08 ms 6.11 ms 0.03 ms (0.48%) 2.32%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 6.35 ms 6.38 ms 0.03 ms (0.46%) 1.79%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 6.37 ms 6.39 ms 0.03 ms (0.44%) 2.33%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 6.06 ms 6.09 ms 0.03 ms (0.44%) 1.98%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 5.35 ms 5.37 ms 0.02 ms (0.43%) 1.99%
handshake_no_resume_ring_1.3_rsa_chacha 1.09 ms 1.08 ms -0.00 ms (-0.42%) 1.00%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.18 ms 1.18 ms -0.00 ms (-0.42%) 1.10%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 5.37 ms 5.39 ms 0.02 ms (0.41%) 2.37%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.19 ms 1.18 ms -0.00 ms (-0.36%) 1.00%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 6.09 ms 6.11 ms 0.02 ms (0.35%) 1.91%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.41 ms 1.40 ms -0.00 ms (-0.34%) 1.00%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.36 ms 1.36 ms -0.00 ms (-0.27%) 1.04%
handshake_no_resume_ring_1.2_rsa_aes 1.07 ms 1.07 ms -0.00 ms (-0.27%) 1.05%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.42 ms 1.41 ms -0.00 ms (-0.26%) 1.00%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 6.37 ms 6.39 ms 0.01 ms (0.22%) 2.01%
handshake_session_id_aws_lc_rs_1.2_rsa_aes 2.17 ms 2.17 ms -0.00 ms (-0.18%) 1.54%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.62 ms 3.61 ms -0.00 ms (-0.14%) 1.13%
handshake_session_id_ring_1.3_ecdsap256_aes 6.88 ms 6.87 ms -0.01 ms (-0.14%) 1.84%
handshake_tickets_ring_1.3_rsa_chacha 7.49 ms 7.48 ms -0.01 ms (-0.12%) 2.03%
handshake_session_id_ring_1.3_rsa_aes 7.52 ms 7.52 ms -0.01 ms (-0.10%) 1.78%
handshake_tickets_ring_1.3_rsa_aes 7.53 ms 7.52 ms -0.01 ms (-0.08%) 1.75%
handshake_tickets_ring_1.3_ecdsap384_aes 9.99 ms 10.00 ms 0.01 ms (0.06%) 2.21%
handshake_tickets_ring_1.3_ecdsap384_chacha 9.96 ms 9.96 ms 0.01 ms (0.05%) 2.28%
handshake_session_id_ring_1.3_ecdsap384_aes 9.98 ms 9.98 ms -0.00 ms (-0.03%) 1.76%
handshake_tickets_ring_1.3_ecdsap256_chacha 6.85 ms 6.85 ms 0.00 ms (0.02%) 2.10%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.62 ms 3.62 ms 0.00 ms (0.02%) 1.39%
handshake_session_id_ring_1.3_rsa_chacha 7.47 ms 7.47 ms 0.00 ms (0.01%) 2.26%
handshake_session_id_ring_1.3_ecdsap256_chacha 6.84 ms 6.84 ms -0.00 ms (-0.01%) 2.28%
handshake_session_id_ring_1.3_ecdsap384_chacha 9.94 ms 9.95 ms 0.00 ms (0.01%) 1.95%
handshake_tickets_ring_1.3_ecdsap256_aes 6.89 ms 6.89 ms -0.00 ms (-0.00%) 1.94%

Additional information

Historical results

Checkout details:

@djc
Copy link
Member

djc commented Feb 23, 2024

I guess one downside is that it wouldn't help the folks still working through upgrading to the 0.22 release (e.g. h3 for the reqwest/hyper ecosystem). They'll still be blocked, but now on a 0.23 update instead of a Quinn update w/ 0.22.

There isn't really a fix for that other than backporting breaking changes to 0.22 and pretending they aren't :-/

Yeah, I think it's okay to expect that everyone downstream of Quinn will just skip 0.22 and move straight to 0.23.

cpu and others added 7 commits February 27, 2024 12:40
The `append_hs` function of the `MessageDeframer` (used only by QUIC
connections) mishandles the case where we were in the process of
deframing a QUIC HS message that required joining.

When copying a payload of the fragmented HS message into the deframer
buffer the `DeframerBuffer<'a, ExternalPayload<'a>>` trait
implementation for `DeframerVecBuffer` _already_ positioned the write
into the unfilled section of the buffer, `self.unfilled()` (e.g.
`self.buf[self.used..]`).

However, the branch of `append_hs` that continues processing of joining
a fragmented HS message was incorrectly further offsetting the copy
position by `meta.payload.end`, which is equal to `self.used` at this
point. In effect trying to write to `self.buf[self.used+self.used..]`.

As a result, if we have buffered more than half the capacity of
`self.buf` and then attempt to join in more payload bytes, the unfilled
offset is outside the bounds of `buf` and an out-of-bounds indexing
panic occurs.

This commit adds a simple integration test, as well as a fix.
Previously the `CipherSuiteCommon` type had a `confidentiality_limit`
and a `integrity_limit`. Recent refactoring for better downstream
QUIC ergonomics has pulled these limits into the `quic::PacketKey`
trait. To reduce duplication this commit adjusts our handling of these
two limits.

For the `integrity_limit`, it was already documented in
`CipherSuiteCommon` as being specific to QUIC and irrelevant for TLS
over TCP. For this reason we delete the field from `CipherSuiteCommon`,
leaving it only in `quic::PacketKey` where it is actually useful.

For the `confidentiality_limit` it was described imprecisely and erred
on the side of caution, proposing a limit calculated based on QUIC
overhead even for the TCP usecase. Now that we've split this field the
`CipherSuiteCommon` version's documentation is updated to use a tighter
bound for the TCP use-case, and the associated `PacketKey` field can be
documented to use the QUIC bound.
The `pub(crate)` members should be below the `pub` members and above the
`pub(super)` members.
When holding a `ClientConfig` or a `ServerConfig` it may be helpful to
be able to access the `&Arc<CryptoProviver>` that will be used for the
configuration. This commit adds accessor functions for this purpose.
This commit adds a `quic::Suite` struct for representing the combination
of a `Tls13CipherSuite` and a `quic::Algorithm`. This can optionally be
constructed from a `Tls13CipherSuite` that supports QUIC. Having this
type helps downstream users that otherwise need to juggle the
`Option<quic::Algorithm>` and `Option<Tls13CipherSuite>` from
a `SupportedCipherSuite` separately.
@cpu
Copy link
Member Author

cpu commented Feb 27, 2024

cpu force-pushed the cpu-quic-support branch from 9d547f7 to 9852c1d

Just rebasing on main after all the merge activity this morning.

@djc
Copy link
Member

djc commented Feb 27, 2024

Sorry for taking so long -- I think it looks good!

@cpu cpu added this pull request to the merge queue Feb 27, 2024
Merged via the queue into rustls:main with commit d5842f4 Feb 27, 2024
22 checks passed
@cpu cpu deleted the cpu-quic-support branch February 27, 2024 20:22
Comment on lines -507 to 511
fn copy(&mut self, payload: &ExternalPayload<'a>, at: usize) {
fn copy(&mut self, payload: &ExternalPayload<'a>, _at: usize) {
let len = payload.len();
self.unfilled()[at..at + len].copy_from_slice(payload.0);
self.unfilled()[..len].copy_from_slice(payload.0);
self.advance(len);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone explain this to me?

It looks like adding a debug_assert! would make sense here, instead of not using at completely. We'd compare the at with the self.used to see if they always match - and if they don't - oopsie we panic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can someone explain this to me?

Can you be more specific about what part you're not understanding? The commit message has some additional context in the event you haven't seen it yet.

It looks like adding a debug_assert! would make sense here, instead of not using at completely.

Sounds reasonable. Do you want to open a PR?

Copy link
Contributor

@MOZGIII MOZGIII Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you be more specific about what part you're not understanding? The commit message has some additional context in the event you haven't seen it yet.

The motivation behind this change, the commit message explains it. It would be better capture as a code comment though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable. Do you want to open a PR?

Maybe in a bit, once I collect all the feedback.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an very odd implementation of a trait, should it be just remodelled in a different way - in other words, should we fix the trait itself maybe?

Copy link
Member Author

@cpu cpu Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in other words, should we fix the trait itself maybe?

I think we would be open to a refactoring if you see a path forward. Reviewing CONTRIBUTING.md might be helpful if so.

I understand there to be a general agreement on the team that the deframer and associated APIs have room for improvement. From my perspective it was challenging updating this area of the codebase to support the new unbuffered connection API. I've tried my hand at trying to clean up a bit and didn't arrive at anything that was a workable improvement in the time I had boxed for the task but that's likely more a product of my own relative inexperience.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, yeah, tell me about it, this is the first PR I'm reviewing here. I do not think I'll be taking on refactoring this - but at least capturing this context for a comment would be helpful, thanks!

Comment on lines +726 to +728
/// This is not relevant for TLS over TCP (which is implemented in this crate)
/// because a single failed decryption is fatal to the connection. However,
/// this quantity is used by QUIC.
Copy link
Contributor

@MOZGIII MOZGIII Apr 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit confusing - looks like a copy-paste from the older comment.
In particular - the which is implemented in this crate part. Would probably be better as which is also implemented in this crate (added also).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would probably be better as which is also implemented in this crate (added also).

👍 Want to open a PR with the change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants