From 6f3123bf0215c6db64b69698c2a551e98027f617 Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 2 Jul 2023 17:09:59 +0800 Subject: [PATCH] workaround: set the max encryption input length to 128 to avoid big encryped data Signed-off-by: 21pages --- libs/hbb_common/src/password_security.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hbb_common/src/password_security.rs b/libs/hbb_common/src/password_security.rs index ddfe28baa..5aca2c85a 100644 --- a/libs/hbb_common/src/password_security.rs +++ b/libs/hbb_common/src/password_security.rs @@ -149,7 +149,7 @@ pub fn decrypt_vec_or_original(v: &[u8], current_version: &str) -> (Vec, boo } fn encrypt(v: &[u8]) -> Result { - 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(())