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

server: allow acceptor to send alerts after error #1811

Merged
merged 2 commits into from
Feb 27, 2024
Merged

server: allow acceptor to send alerts after error #1811

merged 2 commits into from
Feb 27, 2024

Conversation

djc
Copy link
Member

@djc djc commented Feb 27, 2024

Fixes #1792.

  • Acceptor's accept and into_connection fns now return both an Error and an AcceptedAlert in the error case. The AcceptedAlert can be used to write any TLS alerts produced during processing.
  • Test coverage is updated to include:
    • Tests for a junk handshake being rejected in accept with an alert produced
    • Tests for an incompatible handshake being rejected in into_connection with an alert produced
  • The existing server_acceptor.rs example program is updated to demonstrate using the AcceptedAlert return to write alerts.

Copy link

rustls-benchmarking bot commented Feb 27, 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_session_id_aws_lc_rs_1.2_rsa_aes_server 4054867 4004375 -50492 (-1.25%) 3.58%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_server 4510232 4471437 -38795 (-0.86%) 2.64%
handshake_session_id_aws_lc_rs_1.2_rsa_aes_client 4181784 4198571 16787 (0.40%) 0.95%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_server 12283118 12330378 47260 (0.38%) 1.27%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_server 12647197 12680789 33592 (0.27%) 0.88%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_server 12726369 12693090 -33279 (-0.26%) 0.93%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_client 30193496 30251925 58429 (0.19%) 0.45%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_server 32575291 32625728 50437 (0.15%) 0.83%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 8650004 8638394 -11610 (-0.13%) 0.96%
handshake_tickets_ring_1.2_rsa_aes_client 4711654 4717388 5734 (0.12%) 0.74%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_server 32411841 32373031 -38810 (-0.12%) 0.43%
handshake_no_resume_ring_1.3_ecdsap256_chacha_server 2129022 2126536 -2486 (-0.12%) 0.31%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 8684087 8674043 -10044 (-0.12%) 0.78%
handshake_no_resume_ring_1.3_ecdsap256_aes_client 3897614 3893437 -4177 (-0.11%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_server 32626382 32596279 -30103 (-0.09%) 0.29%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_server 32664318 32636029 -28289 (-0.09%) 0.61%
handshake_session_id_ring_1.3_ecdsap256_aes_server 43554727 43519001 -35726 (-0.08%) 0.20%
handshake_tickets_ring_1.2_rsa_aes_server 4762153 4765988 3835 (0.08%) 0.60%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_server 32461236 32436732 -24504 (-0.08%) 0.52%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_client 30235713 30258273 22560 (0.07%) 0.49%
handshake_session_id_ring_1.3_rsa_aes_server 43534510 43563371 28861 (0.07%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_server 46270556 46240997 -29559 (-0.06%) 0.32%
handshake_tickets_ring_1.3_rsa_aes_server 43790799 43763663 -27136 (-0.06%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_server 46218453 46190842 -27611 (-0.06%) 0.32%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 3344101 3342120 -1981 (-0.06%) 0.23%
handshake_no_resume_ring_1.3_ecdsap256_chacha_client 3899206 3896900 -2306 (-0.06%) 0.35%
handshake_session_id_ring_1.2_rsa_aes_server 4327720 4330038 2318 (0.05%) 0.52%
handshake_session_id_aws_lc_rs_1.3_rsa_aes_client 30444619 30430060 -14559 (-0.05%) 0.21%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_client 30438332 30424288 -14044 (-0.05%) 0.51%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_server 32596081 32610239 14158 (0.04%) 0.25%
handshake_tickets_ring_1.3_rsa_chacha_server 43734052 43715716 -18336 (-0.04%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha_client 30386318 30396879 10561 (0.03%) 0.30%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha_server 32399177 32410294 11117 (0.03%) 0.30%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_client 30399991 30410065 10074 (0.03%) 0.27%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes_client 30418114 30408453 -9661 (-0.03%) 0.31%
handshake_session_id_ring_1.3_ecdsap384_aes_client 41994151 42006811 12660 (0.03%) 0.20%
handshake_tickets_ring_1.3_rsa_aes_client 42396955 42384643 -12312 (-0.03%) 0.20%
handshake_session_id_ring_1.3_rsa_chacha_server 43442726 43430155 -12571 (-0.03%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes_server 32602692 32611972 9280 (0.03%) 0.27%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_server 80408261 80431071 22810 (0.03%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_client 57974950 57990997 16047 (0.03%) 0.22%
handshake_tickets_aws_lc_rs_1.3_rsa_aes_client 30642453 30634357 -8096 (-0.03%) 0.31%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha_client 30628683 30621258 -7425 (-0.02%) 0.22%
handshake_session_id_ring_1.3_rsa_chacha_client 42123699 42133596 9897 (0.02%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_chacha_server 43645722 43655819 10097 (0.02%) 0.21%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 1878150 1878579 429 (0.02%) 0.21%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 80455194 80436874 -18320 (-0.02%) 0.20%
handshake_tickets_ring_1.3_rsa_chacha_client 42327846 42318355 -9491 (-0.02%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_client 42165340 42174361 9021 (0.02%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_aes_server 43759668 43750881 -8787 (-0.02%) 0.33%
handshake_session_id_ring_1.3_rsa_aes_client 42208903 42200431 -8472 (-0.02%) 0.20%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha_client 30426637 30421272 -5365 (-0.02%) 0.22%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_client 30221356 30216186 -5170 (-0.02%) 0.22%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 4256873 4256192 -681 (-0.02%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_server 43741426 43747497 6071 (0.01%) 0.23%
handshake_session_id_ring_1.3_ecdsap256_aes_client 41994883 42000385 5502 (0.01%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_client 92411965 92423840 11875 (0.01%) 0.20%
transfer_no_resume_ring_1.3_rsa_chacha_server 80343614 80353635 10021 (0.01%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_aes_server 43546255 43551526 5271 (0.01%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_server 43432030 43437283 5253 (0.01%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_server 43680787 43686030 5243 (0.01%) 0.20%
handshake_session_id_ring_1.3_ecdsap384_chacha_client 41923089 41927998 4909 (0.01%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_server 12041884 12043229 1345 (0.01%) 0.20%
handshake_no_resume_ring_1.3_ecdsap256_aes_server 2126588 2126808 220 (0.01%) 0.31%
handshake_tickets_ring_1.3_ecdsap384_chacha_client 42099372 42103678 4306 (0.01%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_client 41906453 41910553 4100 (0.01%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_server 13738065 13737079 -986 (-0.01%) 0.20%
handshake_tickets_aws_lc_rs_1.2_rsa_aes_client 4503508 4503192 -316 (-0.01%) 1.02%
transfer_no_resume_ring_1.3_ecdsap384_chacha_server 80350177 80355747 5570 (0.01%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 1881902 1882030 128 (0.01%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_client 30262488 30264338 1850 (0.01%) 0.34%
transfer_no_resume_ring_1.3_ecdsap256_chacha_server 80343899 80348472 4573 (0.01%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_client 4547188 4547441 253 (0.01%) 0.20%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha_server 32589311 32587590 -1721 (-0.01%) 0.34%
transfer_no_resume_ring_1.3_ecdsap384_chacha_client 92392594 92397194 4600 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes_client 3151686 3151533 -153 (-0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha_client 3365555 3365398 -157 (-0.00%) 0.20%
handshake_session_id_ring_1.2_rsa_aes_client 4443383 4443182 -201 (-0.00%) 0.85%
transfer_no_resume_ring_1.3_ecdsap256_chacha_client 92395516 92399689 4173 (0.00%) 0.20%
handshake_session_id_ring_1.3_ecdsap256_chacha_server 43438220 43440106 1886 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_chacha_server 12246317 12246837 520 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes_server 32417956 32416600 -1356 (-0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap384_aes_client 42167266 42169004 1738 (0.00%) 0.20%
handshake_tickets_ring_1.3_ecdsap256_chacha_client 42105888 42104325 -1563 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_server 13734555 13734066 -489 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_client 58064479 58066513 2034 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 57964042 57965913 1871 (0.00%) 0.20%
handshake_no_resume_ring_1.2_rsa_aes_client 4440164 4440307 143 (0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha_server 32410375 32409394 -981 (-0.00%) 0.30%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_aes_server 46265826 46264524 -1302 (-0.00%) 0.25%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes_server 46254553 46255769 1216 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_client 92434105 92436401 2296 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_server 46297539 46298688 1149 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes_client 3354664 3354743 79 (0.00%) 0.20%
transfer_no_resume_ring_1.2_rsa_aes_server 46176877 46175865 -1012 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap384_aes_client 58058954 58060032 1078 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_aes_client 35453041 35452428 -613 (-0.00%) 0.20%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes_server 32433402 32433928 526 (0.00%) 0.25%
transfer_no_resume_ring_1.3_rsa_chacha_client 92397280 92398664 1384 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha_server 4260939 4260986 47 (0.00%) 0.20%
handshake_no_resume_ring_1.3_ecdsap384_chacha_client 35455078 35454712 -366 (-0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_server 12237054 12237151 97 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes_client 57986093 57986437 344 (0.00%) 0.20%
transfer_no_resume_ring_1.3_ecdsap256_aes_server 46293203 46293463 260 (0.00%) 0.25%
transfer_no_resume_ring_1.2_rsa_aes_client 57920793 57920526 -267 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes_client 68385903 68386194 291 (0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha_client 92454874 92454648 -226 (-0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_server 46290592 46290666 74 (0.00%) 0.20%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes_client 3340182 3340186 4 (0.00%) 0.20%
handshake_no_resume_ring_1.3_rsa_aes_client 4537916 4537920 4 (0.00%) 0.20%
transfer_no_resume_ring_1.3_rsa_aes_client 58064348 58064324 -24 (-0.00%) 0.20%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha_server 80454970 80454996 26 (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.75 ms 4.83 ms 0.09 ms (1.81%) 4.39%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_aes 5.46 ms 5.55 ms 0.09 ms (1.63%) 3.75%
transfer_no_resume_aws_lc_rs_1.3_rsa_aes 5.69 ms 5.78 ms 0.09 ms (1.57%) 2.81%
transfer_no_resume_ring_1.3_ecdsap256_aes 6.57 ms 6.67 ms 0.10 ms (1.53%) 3.46%
transfer_no_resume_ring_1.3_rsa_aes 7.15 ms 7.25 ms 0.10 ms (1.41%) 2.53%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_aes 474.67 µs 480.87 µs 6.20 µs (1.31%) 2.23%
transfer_no_resume_ring_1.2_rsa_aes 7.05 ms 7.14 ms 0.09 ms (1.27%) 2.97%
transfer_no_resume_aws_lc_rs_1.2_rsa_aes 5.69 ms 5.76 ms 0.07 ms (1.23%) 3.45%
handshake_no_resume_ring_1.3_ecdsap256_aes 504.18 µs 510.10 µs 5.92 µs (1.18%) 2.41%
handshake_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 474.33 µs 479.72 µs 5.39 µs (1.14%) 2.90%
handshake_no_resume_ring_1.3_ecdsap256_chacha 502.70 µs 508.03 µs 5.33 µs (1.06%) 2.28%
transfer_no_resume_ring_1.3_ecdsap384_aes 9.67 ms 9.77 ms 0.10 ms (1.01%) 2.50%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_chacha 5.42 ms 5.47 ms 0.05 ms (0.91%) 2.09%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_chacha 5.46 ms 5.50 ms 0.05 ms (0.90%) 2.54%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_chacha 6.16 ms 6.21 ms 0.05 ms (0.89%) 2.11%
handshake_no_resume_ring_1.3_rsa_chacha 1.08 ms 1.09 ms 0.01 ms (0.87%) 1.00%
handshake_session_id_aws_lc_rs_1.3_rsa_chacha 6.41 ms 6.46 ms 0.05 ms (0.79%) 2.09%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_chacha 6.11 ms 6.16 ms 0.05 ms (0.76%) 1.86%
transfer_no_resume_aws_lc_rs_1.3_ecdsap256_chacha 13.23 ms 13.33 ms 0.10 ms (0.73%) 1.48%
handshake_session_id_ring_1.3_rsa_chacha 7.47 ms 7.53 ms 0.05 ms (0.69%) 2.26%
handshake_session_id_ring_1.3_rsa_aes 7.52 ms 7.58 ms 0.05 ms (0.69%) 1.78%
transfer_no_resume_aws_lc_rs_1.3_rsa_chacha 14.18 ms 14.27 ms 0.10 ms (0.68%) 1.41%
transfer_no_resume_ring_1.3_rsa_chacha 13.81 ms 13.91 ms 0.09 ms (0.68%) 1.55%
transfer_no_resume_ring_1.3_ecdsap256_chacha 13.24 ms 13.33 ms 0.09 ms (0.68%) 1.63%
handshake_tickets_ring_1.2_rsa_aes 1.85 ms 1.86 ms 0.01 ms (0.67%) 1.63%
handshake_tickets_aws_lc_rs_1.3_rsa_chacha 6.45 ms 6.49 ms 0.04 ms (0.67%) 2.19%
handshake_session_id_aws_lc_rs_1.3_ecdsap256_aes 5.44 ms 5.47 ms 0.04 ms (0.67%) 1.92%
transfer_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 13.94 ms 14.03 ms 0.09 ms (0.65%) 1.64%
handshake_session_id_aws_lc_rs_1.3_rsa_aes 6.44 ms 6.47 ms 0.04 ms (0.61%) 1.72%
handshake_session_id_aws_lc_rs_1.3_ecdsap384_aes 6.15 ms 6.18 ms 0.04 ms (0.61%) 1.72%
handshake_no_resume_ring_1.3_rsa_aes 1.08 ms 1.09 ms 0.01 ms (0.60%) 1.00%
transfer_no_resume_ring_1.3_ecdsap384_chacha 16.34 ms 16.43 ms 0.09 ms (0.57%) 1.50%
handshake_session_id_ring_1.3_ecdsap256_aes 6.89 ms 6.93 ms 0.04 ms (0.57%) 1.81%
handshake_session_id_ring_1.3_ecdsap256_chacha 6.85 ms 6.89 ms 0.04 ms (0.57%) 2.28%
handshake_tickets_aws_lc_rs_1.3_ecdsap256_aes 5.47 ms 5.50 ms 0.03 ms (0.57%) 2.26%
handshake_tickets_ring_1.3_ecdsap256_aes 6.92 ms 6.96 ms 0.04 ms (0.55%) 1.90%
handshake_tickets_ring_1.3_ecdsap256_chacha 6.86 ms 6.90 ms 0.04 ms (0.55%) 2.05%
handshake_tickets_aws_lc_rs_1.3_ecdsap384_aes 6.18 ms 6.21 ms 0.03 ms (0.48%) 1.87%
handshake_session_id_ring_1.3_ecdsap384_chacha 9.95 ms 9.99 ms 0.05 ms (0.47%) 1.94%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_aes 1.19 ms 1.19 ms 0.01 ms (0.47%) 1.00%
handshake_tickets_ring_1.3_rsa_aes 7.56 ms 7.59 ms 0.03 ms (0.46%) 1.75%
handshake_tickets_ring_1.3_rsa_chacha 7.50 ms 7.53 ms 0.03 ms (0.44%) 2.03%
handshake_no_resume_aws_lc_rs_1.3_ecdsap384_chacha 1.18 ms 1.18 ms 0.00 ms (0.42%) 1.10%
handshake_no_resume_aws_lc_rs_1.3_rsa_chacha 1.41 ms 1.41 ms 0.01 ms (0.40%) 1.00%
handshake_tickets_aws_lc_rs_1.3_rsa_aes 6.46 ms 6.48 ms 0.02 ms (0.38%) 1.89%
handshake_session_id_ring_1.3_ecdsap384_aes 9.99 ms 10.03 ms 0.04 ms (0.37%) 1.69%
handshake_no_resume_ring_1.2_rsa_aes 1.07 ms 1.08 ms 0.00 ms (0.34%) 1.05%
handshake_tickets_ring_1.3_ecdsap384_chacha 9.97 ms 10.01 ms 0.03 ms (0.33%) 2.27%
handshake_tickets_ring_1.3_ecdsap384_aes 10.02 ms 10.05 ms 0.03 ms (0.31%) 2.20%
handshake_no_resume_aws_lc_rs_1.2_rsa_aes 1.36 ms 1.37 ms 0.00 ms (0.30%) 1.02%
handshake_tickets_aws_lc_rs_1.2_rsa_aes 2.34 ms 2.34 ms 0.01 ms (0.24%) 1.73%
handshake_no_resume_aws_lc_rs_1.3_rsa_aes 1.41 ms 1.42 ms 0.00 ms (0.22%) 1.00%
handshake_no_resume_ring_1.3_ecdsap384_chacha 3.61 ms 3.61 ms 0.01 ms (0.17%) 1.33%
handshake_session_id_ring_1.2_rsa_aes 1.76 ms 1.76 ms 0.00 ms (0.09%) 2.57%
handshake_no_resume_ring_1.3_ecdsap384_aes 3.61 ms 3.61 ms 0.00 ms (0.09%) 1.11%
handshake_session_id_aws_lc_rs_1.2_rsa_aes 2.18 ms 2.18 ms 0.00 ms (0.03%) 1.51%

Additional information

Historical results

Checkout details:

@djc djc force-pushed the acceptor-alerts branch 2 times, most recently from 96679d2 to 665ddbe Compare February 27, 2024 12:13
rustls/src/server/server_conn.rs Outdated Show resolved Hide resolved
Copy link

codecov bot commented Feb 27, 2024

Codecov Report

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

Project coverage is 95.95%. Comparing base (64f9742) to head (6d7569e).

Files Patch % Lines
rustls/src/server/server_conn.rs 82.92% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1811      +/-   ##
==========================================
- Coverage   95.98%   95.95%   -0.04%     
==========================================
  Files          84       84              
  Lines       18791    18819      +28     
==========================================
+ Hits        18036    18057      +21     
- Misses        755      762       +7     

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

@ctz
Copy link
Member

ctz commented Feb 27, 2024

Yes would be good to have at least two test cases for this: one where the clienthello is just junk (so accept() fails & and sends eg decode_error), another where the handshake is impossible (so into_connection() fails and sends eg handshake_failure)

They other thing we should do in this PR is make examples/src/bin/server_acceptor.rs send alerts; so it makes a good starting point for people to crib from.

@djc
Copy link
Member Author

djc commented Feb 27, 2024

I probably won't be able contribute the test/example work this week.

@djc djc mentioned this pull request Feb 27, 2024
8 tasks
@cpu
Copy link
Member

cpu commented Feb 27, 2024

I probably won't be able contribute the test/example work this week.

I'm looking at this now (but won't push to this branch myself since it seems like you're also rebasing ATM)

one where the clienthello is just junk (so accept() fails & and sends eg decode_error)

I think 2a60b63 would meet your requirement

another where the handshake is impossible (so into_connection() fails and sends eg handshake_failure)

Working on this one now.

They other thing we should do in this PR is make examples/src/bin/server_acceptor.rs send alerts; so it makes a good starting point for people to crib from.

Here's an example update commit: d01215a

I think we might want Debug on Accepted as well. I was surprised that writing let err_result = acceptor.accept().unwrap_err(); apparently requires it:

Here's that fix: 0c8c0c3

@djc djc force-pushed the acceptor-alerts branch 2 times, most recently from f560584 to d9ce3b0 Compare February 27, 2024 15:44
@djc
Copy link
Member Author

djc commented Feb 27, 2024

Rebased this. Feel free to take the baton for this branch!

@cpu cpu force-pushed the acceptor-alerts branch 2 times, most recently from d9ebef9 to bb2704b Compare February 27, 2024 16:13
@cpu
Copy link
Member

cpu commented Feb 27, 2024

Feel free to take the baton for this branch!

🤝

I completed the requested test coverage and rolled it and the one new Debug impl into the original commit. I tacked on a second commit that updates the acceptor example to write alerts.

I've updated the PR description and I think this is now ready for review.

Copy link
Member Author

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

LGTM, thanks for taking care of the tests/examples.

examples/src/bin/server_acceptor.rs Outdated Show resolved Hide resolved
@cpu cpu added this pull request to the merge queue Feb 27, 2024
Merged via the queue into main with commit 0106e7e Feb 27, 2024
43 of 44 checks passed
@cpu cpu deleted the acceptor-alerts branch February 27, 2024 17:28
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.

When accepting new TLS connection with Accepted::into_connection(config) no TLS alert is sent
3 participants