Add parameter validation for AES-OFB

This commit is contained in:
Manuel Pégourié-Gonnard 2018-12-13 11:00:56 +01:00
parent 1677cca54b
commit 8e41eb7187
3 changed files with 32 additions and 1 deletions

View file

@ -516,6 +516,24 @@ void aes_check_params( )
MBEDTLS_AES_ENCRYPT, 16,
out, in, NULL ) );
#endif /* MBEDTLS_CIPHER_MODE_CFB */
#if defined(MBEDTLS_CIPHER_MODE_OFB)
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ofb( NULL, 16,
&size, out, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
NULL, out, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
&size, NULL, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
&size, out, NULL, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
&size, out, in, NULL ) );
#endif /* MBEDTLS_CIPHER_MODE_OFB */
}
/* END_CASE */