mirror of
https://git.ethanthesleepy.one/ethanaobrien/ew.git
synced 2025-05-13 11:37:33 -05:00
Ensure supplied packet is longer than the IV_LENGTH
This commit is contained in:
parent
b5138bfaaa
commit
5f026da992
1 changed files with 3 additions and 0 deletions
|
@ -7,6 +7,9 @@ const IV_LENGTH: usize = 16;
|
|||
const KEY: &str = "3559b435f24b297a79c68b9709ef2125";
|
||||
|
||||
pub fn decrypt_packet(base64_input: &str) -> Result<String, ErrorStack> {
|
||||
if base64_input.len() < IV_LENGTH + 1 {
|
||||
return Ok(String::new());
|
||||
}
|
||||
let base64_buffer = general_purpose::STANDARD.decode(base64_input).unwrap();
|
||||
|
||||
let decryption_iv = &base64_buffer[..IV_LENGTH];
|
||||
|
|
Loading…
Add table
Reference in a new issue