mirror of
https://github.com/openai/codex.git
synced 2026-09-04 15:08:45 +00:00
fix: inline Noise responder public key
Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -78,17 +78,6 @@ impl NoiseChannelPublicKey {
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn from_raw(
|
||||
dh: &<X25519 as Dh>::PubKey,
|
||||
kem: &<AwsLcMlKem768 as 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<(<X25519 as Dh>::PubKey, <AwsLcMlKem768 as Kem>::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(),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user