pub enum DecryptError {\r
KeyError(KeyError),\r
WrongMessageVersion,\r
+ MessageToShort,\r
UnableToDecodeBase64Message,\r
UnableToDecrypt,\r
UnableToDecodeMessageAsUTF8String,\r
base64::decode(&cipher_text.as_bytes()[consts::CURRENT_MESSAGE_VERSION.as_bytes().len()..])\r
.map_err(|_e| DecryptError::UnableToDecodeBase64Message)?;\r
\r
+ if cipher_text_bytes.len() <= 48 { return Err(DecryptError::MessageToShort) }\r
+\r
let iv = &cipher_text_bytes[0..16];\r
let hash = &cipher_text_bytes[16..48];\r
let encrypted_message = &cipher_text_bytes[48..];\r