From a805b6f2e4182ff42c9597ec6ee1aabc49384edf Mon Sep 17 00:00:00 2001 From: dawn Date: Sun, 18 Oct 2026 23:26:36 +0300 Subject: [PATCH] knot-sim: test that a full h3 handshake's first request isn't early data Signed-off-by: dawn --- knot2/crates/knot-sim/tests/h3_private.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/knot2/crates/knot-sim/tests/h3_private.rs b/knot2/crates/knot-sim/tests/h3_private.rs index 9b11ff379..2f5ef1026 100644 --- a/knot2/crates/knot-sim/tests/h3_private.rs +++ b/knot2/crates/knot-sim/tests/h3_private.rs @@ -728,3 +728,21 @@ async fn early_data_with_a_credential_is_refused_with_425_while_the_same_request after.close(); assert_eq!(early_answers, 12); } + +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_first_request_after_a_full_handshake_is_never_called_early_data() { + let cove = cove().await; + let uri = cove.advert(&cove.hidden.did, "git-receive-pack"); + + // 16 stays under the pre-auth burst so a 429 can't hide a 425 + for attempt in 0..16 { + let mut session = H3Session::full_handshake(&cove.edge).await; + let (status, _, _) = session.send(Method::GET, &uri, &[], None).await; + session.close(); + assert_eq!( + status, + StatusCode::UNAUTHORIZED, + "connection {attempt}: an anonymous receive advertisement answers 401" + ); + } +} -- 2.54.0