From d3eaa821b14926de2c92869b9d97009ff1c28702 Mon Sep 17 00:00:00 2001 From: Rob N Date: Fri, 13 Sep 2024 16:54:19 -1000 Subject: [PATCH] fix(lib): allow access to `session_id` --- protocol/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/protocol/src/lib.rs b/protocol/src/lib.rs index 9c07e1f..539fef2 100644 --- a/protocol/src/lib.rs +++ b/protocol/src/lib.rs @@ -339,6 +339,8 @@ impl PacketWriter { /// Encrypt and decrypt messages with a peer. #[derive(Clone, Debug)] pub struct PacketHandler { + /// A unique identifier for the communication session. + pub session_id: [u8; 32], packet_reader: PacketReader, packet_writer: PacketWriter, } @@ -354,6 +356,7 @@ impl PacketHandler { let packet_decoding_cipher = FSChaCha20Poly1305::new(materials.responder_packet_key); PacketHandler { + session_id: materials.session_id, packet_reader: PacketReader { length_decoding_cipher, packet_decoding_cipher, @@ -372,6 +375,7 @@ impl PacketHandler { let packet_decoding_cipher = FSChaCha20Poly1305::new(materials.initiator_packet_key); PacketHandler { + session_id: materials.session_id, packet_reader: PacketReader { length_decoding_cipher, packet_decoding_cipher,