Initialise iv buffer before use

Commit initialises the iv buffer before
it is passed to mbedtls_cipher_set_iv().

Signed-off-by: Thomas Daubney <thomas.daubney@arm.com>
This commit is contained in:
Thomas Daubney 2022-02-17 12:01:28 +00:00
parent 4fa604cc3b
commit 3a066ec999

View file

@ -1154,6 +1154,9 @@ void check_iv( int cipher_id, char * cipher_string,
size_t iv_len = iv_len_val;
unsigned char iv[16];
/* Initialise iv buffer */
memset( iv, 0, sizeof( iv ) );
const mbedtls_cipher_info_t *cipher_info;
mbedtls_cipher_context_t ctx_dec;
mbedtls_cipher_context_t ctx_enc;