Allow 12 for the size of the IV

This commit is contained in:
Tim Henkes 2018-11-18 16:52:57 +01:00 committed by Marvin W
parent e9535ab6b8
commit 7497f1f17b

View file

@ -222,7 +222,7 @@ int signal_vala_encrypt(signal_buffer **output,
int algo, mode; int algo, mode;
if (aes_cipher(cipher, key_len, &algo, &mode)) return SG_ERR_UNKNOWN; if (aes_cipher(cipher, key_len, &algo, &mode)) return SG_ERR_UNKNOWN;
if (iv_len != 16) return SG_ERR_UNKNOWN; if (iv_len != 16 && iv_len != 12) return SG_ERR_UNKNOWN;
gcry_cipher_hd_t ctx = {0}; gcry_cipher_hd_t ctx = {0};
@ -283,7 +283,7 @@ int signal_vala_decrypt(signal_buffer **output,
if (aes_cipher(cipher, key_len, &algo, &mode)) return SG_ERR_UNKNOWN; if (aes_cipher(cipher, key_len, &algo, &mode)) return SG_ERR_UNKNOWN;
if (ciphertext_len == 0) return SG_ERR_UNKNOWN; if (ciphertext_len == 0) return SG_ERR_UNKNOWN;
if (iv_len != 16) return SG_ERR_UNKNOWN; if (iv_len != 16 && iv_len != 12) return SG_ERR_UNKNOWN;
gcry_cipher_hd_t ctx = {0}; gcry_cipher_hd_t ctx = {0};