diff --git a/clash_lib/src/common/crypto.rs b/clash_lib/src/common/crypto.rs index e5f4771aa..10b32c640 100644 --- a/clash_lib/src/common/crypto.rs +++ b/clash_lib/src/common/crypto.rs @@ -9,7 +9,7 @@ use aes_gcm::{AeadInPlace, KeyInit}; pub fn aes_cfb_encrypt(key: &[u8], iv: &[u8], data: &mut [u8]) -> anyhow::Result<()> { match key.len() { 16 => { - cfb_mode::Encryptor::::new(key.into(), iv.into()).encrypt(data); + cfb_mode::Encryptor::::new(key.into(), iv.into()).encrypt(data); Ok(()) } 24 => { @@ -17,7 +17,7 @@ pub fn aes_cfb_encrypt(key: &[u8], iv: &[u8], data: &mut [u8]) -> anyhow::Result Ok(()) } 32 => { - cfb_mode::Encryptor::::new(key.into(), iv.into()).encrypt(data); + cfb_mode::Encryptor::::new(key.into(), iv.into()).encrypt(data); Ok(()) } _ => anyhow::bail!("invalid key length"), @@ -27,7 +27,7 @@ pub fn aes_cfb_encrypt(key: &[u8], iv: &[u8], data: &mut [u8]) -> anyhow::Result pub fn aes_cfb_decrypt(key: &[u8], iv: &[u8], data: &mut [u8]) -> anyhow::Result<()> { match key.len() { 16 => { - cfb_mode::Decryptor::::new(key.into(), iv.into()).decrypt(data); + cfb_mode::Decryptor::::new(key.into(), iv.into()).decrypt(data); Ok(()) } 24 => { @@ -35,7 +35,7 @@ pub fn aes_cfb_decrypt(key: &[u8], iv: &[u8], data: &mut [u8]) -> anyhow::Result Ok(()) } 32 => { - cfb_mode::Decryptor::::new(key.into(), iv.into()).decrypt(data); + cfb_mode::Decryptor::::new(key.into(), iv.into()).decrypt(data); Ok(()) } _ => anyhow::bail!("invalid key length"), diff --git a/clash_lib/src/lib.rs b/clash_lib/src/lib.rs index 389d6f337..82f12cdd4 100644 --- a/clash_lib/src/lib.rs +++ b/clash_lib/src/lib.rs @@ -471,12 +471,11 @@ mod tests { use std::time::Duration; #[test] - #[ignore] fn start_and_stop() { let conf = r#" socks-port: 7891 bind-address: 127.0.0.1 - mmdb: "clash_lib/tests/data/Country.mmdb" + mmdb: "tests/data/Country.mmdb" "#; let handle = thread::spawn(|| {