workaround: set the max encryption input length to 128 to avoid big

encryped data

Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
21pages 2023-07-02 17:09:59 +08:00
parent b5cf959206
commit 6f3123bf02

View File

@ -149,7 +149,7 @@ pub fn decrypt_vec_or_original(v: &[u8], current_version: &str) -> (Vec<u8>, boo
}
fn encrypt(v: &[u8]) -> Result<String, ()> {
if !v.is_empty() {
if !v.is_empty() && v.len() <= 128 {
symmetric_crypt(v, true).map(|v| base64::encode(v, base64::Variant::Original))
} else {
Err(())