From ac50dfe99a86937b06ad5937af8e63e86dc314bc Mon Sep 17 00:00:00 2001 From: Phoenix Kahlo Date: Fri, 20 Dec 2024 14:06:09 -0600 Subject: [PATCH] Rename initiate_key_update -> force_key_update --- quinn-proto/src/connection/mod.rs | 2 +- quinn-proto/src/connection/packet_builder.rs | 2 +- quinn-proto/src/tests/mod.rs | 4 ++-- quinn/src/connection.rs | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/quinn-proto/src/connection/mod.rs b/quinn-proto/src/connection/mod.rs index 07decd4fd..b9c87c527 100644 --- a/quinn-proto/src/connection/mod.rs +++ b/quinn-proto/src/connection/mod.rs @@ -1233,7 +1233,7 @@ impl Connection { /// Update traffic keys spontaneously /// /// This can be useful for testing key updates, as they otherwise only happen infrequently. - pub fn initiate_key_update(&mut self) { + pub fn force_key_update(&mut self) { self.update_keys(None, false); } diff --git a/quinn-proto/src/connection/packet_builder.rs b/quinn-proto/src/connection/packet_builder.rs index 011420b9d..bf56be822 100644 --- a/quinn-proto/src/connection/packet_builder.rs +++ b/quinn-proto/src/connection/packet_builder.rs @@ -47,7 +47,7 @@ impl PacketBuilder { let sent_with_keys = conn.spaces[space_id].sent_with_keys; if space_id == SpaceId::Data { if sent_with_keys >= conn.key_phase_size { - conn.initiate_key_update(); + conn.force_key_update(); } } else { let confidentiality_limit = conn.spaces[space_id] diff --git a/quinn-proto/src/tests/mod.rs b/quinn-proto/src/tests/mod.rs index cb39b351f..2cf66f4cf 100644 --- a/quinn-proto/src/tests/mod.rs +++ b/quinn-proto/src/tests/mod.rs @@ -1012,7 +1012,7 @@ fn key_update_simple() { let _ = chunks.finalize(); info!("initiating key update"); - pair.client_conn_mut(client_ch).initiate_key_update(); + pair.client_conn_mut(client_ch).force_key_update(); const MSG2: &[u8] = b"hello2"; pair.client_send(client_ch, s).write(MSG2).unwrap(); @@ -1052,7 +1052,7 @@ fn key_update_reordered() { assert!(!pair.client.outbound.is_empty()); pair.client.delay_outbound(); - pair.client_conn_mut(client_ch).initiate_key_update(); + pair.client_conn_mut(client_ch).force_key_update(); info!("updated keys"); const MSG2: &[u8] = b"two"; diff --git a/quinn/src/connection.rs b/quinn/src/connection.rs index 2b0710529..8fdef83e5 100644 --- a/quinn/src/connection.rs +++ b/quinn/src/connection.rs @@ -584,7 +584,7 @@ impl Connection { .state .lock("force_key_update") .inner - .initiate_key_update() + .force_key_update() } /// Derive keying material from this connection's TLS session secrets.