pull/146/head
Chip Senkbeil 2 years ago
parent 7f0461703d
commit a2ec96e556
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

@ -277,8 +277,25 @@ impl<const CAPACITY: usize> FramedTransport<super::InmemoryTransport, CAPACITY>
FramedTransport<super::InmemoryTransport, CAPACITY>,
) {
let (a, b) = super::InmemoryTransport::pair(buffer);
let a = FramedTransport::new(a, PlainCodec::new());
let b = FramedTransport::new(b, PlainCodec::new());
let a = FramedTransport::new(
a,
Box::new(PlainCodec::new()),
Handshake::Client {
key: HeapSecretKey::from(Vec::new()),
preferred_compression_type: None,
preferred_compression_level: None,
preferred_encryption_type: None,
},
);
let b = FramedTransport::new(
b,
Box::new(PlainCodec::new()),
Handshake::Server {
key: HeapSecretKey::from(Vec::new()),
compression_types: Vec::new(),
encryption_types: Vec::new(),
},
);
(a, b)
}
}

@ -53,14 +53,14 @@ pub enum Handshake {
/// Indicates that the handshake is being performed from the server-side
Server {
/// Secret key to use with encryption
key: HeapSecretKey,
/// List of available compression algorithms for use between client and server
compression_types: Vec<CompressionType>,
/// List of available encryption algorithms for use between client and server
encryption_types: Vec<EncryptionType>,
/// Secret key to use with encryption
key: HeapSecretKey,
},
}
@ -158,6 +158,7 @@ where
write_frame!(choice);
// Transform the transport's codec to abide by the choice
debug!("[Handshake] Client updating codec based on {choice:#?}");
transform_transport(transport, choice, &key)
}
Handshake::Server {
@ -179,6 +180,7 @@ where
let choice = next_frame_as!(HandshakeClientChoice);
// Transform the transport's codec to abide by the choice
debug!("[Handshake] Server updating codec based on {choice:#?}");
transform_transport(transport, choice, &key)
}
}

Loading…
Cancel
Save