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:
parent
b5cf959206
commit
6f3123bf02
@ -149,7 +149,7 @@ pub fn decrypt_vec_or_original(v: &[u8], current_version: &str) -> (Vec<u8>, boo
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn encrypt(v: &[u8]) -> Result<String, ()> {
|
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))
|
symmetric_crypt(v, true).map(|v| base64::encode(v, base64::Variant::Original))
|
||||||
} else {
|
} else {
|
||||||
Err(())
|
Err(())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user