From 1e1d6421493e8f861e34787762c7ec9acfc92b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=A0=91=E4=BA=BA?= Date: Sun, 15 Sep 2024 16:34:10 +0100 Subject: [PATCH] [kwm] fix: Bodian build issue --- um_crypto/kuwo/src/des/mod.rs | 4 ++-- um_crypto/kuwo/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/um_crypto/kuwo/src/des/mod.rs b/um_crypto/kuwo/src/des/mod.rs index 998fb0d..ad49e84 100644 --- a/um_crypto/kuwo/src/des/mod.rs +++ b/um_crypto/kuwo/src/des/mod.rs @@ -7,7 +7,7 @@ use core::{KuwoDes, Mode}; use umc_utils::base64; /// Decrypt string content -pub fn decrypt_ksing(data: &str, key: &[u8; 8]) -> Result { +pub fn decrypt_ksing>(data: T, key: &[u8; 8]) -> Result { let mut decoded = base64::decode(data)?; let des = KuwoDes::new(key, Mode::Decrypt); @@ -30,7 +30,7 @@ pub fn encrypt_ksing>(data: T, key: &[u8; 8]) -> Result { Ok(base64::encode(data)) } -pub fn decode_ekey(data: &str, key: &[u8; 8]) -> Result { +pub fn decode_ekey>(data: T, key: &[u8; 8]) -> Result { let decoded = decrypt_ksing(data, key)?; Ok(decoded[16..].to_string()) } diff --git a/um_crypto/kuwo/src/lib.rs b/um_crypto/kuwo/src/lib.rs index 1df2933..ef5affd 100644 --- a/um_crypto/kuwo/src/lib.rs +++ b/um_crypto/kuwo/src/lib.rs @@ -135,7 +135,7 @@ pub struct CipherBoDian(QMCv2Cipher); impl CipherBoDian { pub fn new>(ekey: T) -> Result { - let ekey = des::decode_ekey(&ekey, &SECRET_KEY)?; + let ekey = des::decode_ekey(ekey, &SECRET_KEY)?; let cipher = CipherV2::new_from_ekey(ekey.as_str())?; Ok(Self(cipher)) }