From 8317b5b28153794770a8c7b84a1b6dd50eaa3f80 Mon Sep 17 00:00:00 2001 From: mat Date: Fri, 29 Apr 2022 20:20:56 -0500 Subject: upgrade aes and cfb8 --- azalea-protocol/src/write.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'azalea-protocol/src/write.rs') diff --git a/azalea-protocol/src/write.rs b/azalea-protocol/src/write.rs index e72a74b1..e39ce18e 100755 --- a/azalea-protocol/src/write.rs +++ b/azalea-protocol/src/write.rs @@ -1,8 +1,9 @@ use crate::{mc_buf::Writable, packets::ProtocolPacket, read::MAXIMUM_UNCOMPRESSED_LENGTH}; use async_compression::tokio::bufread::ZlibEncoder; -use azalea_auth::encryption::Aes128Cfb; +use azalea_auth::encryption::Aes128CfbEnc; +use std::fmt::Debug; use tokio::{ - io::{AsyncReadExt, AsyncWriteExt}, + io::{AsyncReadExt, AsyncWrite, AsyncWriteExt}, net::TcpStream, }; @@ -51,13 +52,14 @@ async fn compression_encoder(data: &[u8], compression_threshold: u32) -> Result< } } -pub async fn write_packet

( +pub async fn write_packet( packet: P, - stream: &mut TcpStream, + stream: &mut W, compression_threshold: Option, - cipher: &mut Option, + cipher: &mut Option, ) where - P: ProtocolPacket + std::fmt::Debug, + P: ProtocolPacket + Debug, + W: AsyncWrite + Unpin + Send, { let mut buf = packet_encoder(&packet).unwrap(); if let Some(threshold) = compression_threshold { -- cgit v1.2.3