diff --git a/Cargo.toml b/Cargo.toml index b78c709..3aeab13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "async-psec" -version = "0.3.1" +version = "0.3.2" authors = ["Hardcore Sushi "] edition = "2018" description = "Asynchronous PSEC implementation" diff --git a/tests/psec_test.rs b/tests/psec_test.rs index 77a1922..3cdcd25 100644 --- a/tests/psec_test.rs +++ b/tests/psec_test.rs @@ -23,9 +23,11 @@ async fn tokio_main() { session.encrypt_and_send(b"Hello I'm Bob", true).await.unwrap(); assert_eq!(session.receive_and_decrypt().await.unwrap(), b"Hello I'm Alice"); - session.encrypt_and_send("!".repeat(997).as_bytes(), true).await.unwrap(); + let (mut reader, mut writer) = session.into_split().unwrap(); - assert_eq!(session.receive_and_decrypt().await, Err(PsecError::TransmissionCorrupted)); + writer.encrypt_and_send("!".repeat(997).as_bytes(), true).await.unwrap(); + + assert_eq!(reader.receive_and_decrypt().await, Err(PsecError::TransmissionCorrupted)); }); let stream = TcpStream::connect(format!("127.0.0.1:{}", bind_addr.port())).await.unwrap();