From 7a153b809aef610641fb90cbb50bbe1aef42369f Mon Sep 17 00:00:00 2001 From: viyatb-oai Date: Tue, 9 Jun 2026 15:45:20 -0700 Subject: [PATCH] fix: inline Noise responder public key Co-authored-by: Codex --- codex-rs/exec-server/src/noise_channel.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/codex-rs/exec-server/src/noise_channel.rs b/codex-rs/exec-server/src/noise_channel.rs index 8d585fa3aa..14a3d5de87 100644 --- a/codex-rs/exec-server/src/noise_channel.rs +++ b/codex-rs/exec-server/src/noise_channel.rs @@ -78,17 +78,6 @@ impl NoiseChannelPublicKey { } } - pub(crate) fn from_raw( - dh: &::PubKey, - kem: &::PubKey, - ) -> Self { - Self { - suite: NOISE_CHANNEL_SUITE.to_string(), - x25519_public_key: STANDARD.encode(dh), - mlkem768_public_key: STANDARD.encode(kem.as_slice()), - } - } - fn decode( &self, ) -> Result<(::PubKey, ::PubKey), NoiseChannelError> { @@ -235,9 +224,14 @@ impl PendingResponderHandshake { .ok_or(NoiseChannelError::InvalidMessage( "handshake request is missing initiator static key", ))?; + let initiator_public_key = NoiseChannelPublicKey { + suite: NOISE_CHANNEL_SUITE.to_string(), + x25519_public_key: STANDARD.encode(remote.dh()), + mlkem768_public_key: STANDARD.encode(remote.kem().as_slice()), + }; Ok(Self { handshake, - initiator_public_key: NoiseChannelPublicKey::from_raw(remote.dh(), remote.kem()), + initiator_public_key, payload: payload[..payload_len].to_vec(), }) }