1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-01 10:06:53 +03:00

Add parameter validation for AES-CTR

This commit is contained in:
Manuel Pégourié-Gonnard
2018-12-13 11:08:36 +01:00
parent 8e41eb7187
commit 2bc535be86
3 changed files with 37 additions and 1 deletions

View File

@ -534,6 +534,27 @@ void aes_check_params( )
mbedtls_aes_crypt_ofb( &aes_ctx, 16,
&size, out, in, NULL ) );
#endif /* MBEDTLS_CIPHER_MODE_OFB */
#if defined(MBEDTLS_CIPHER_MODE_CTR)
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( NULL, 16, &size, out,
out, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( &aes_ctx, 16, NULL, out,
out, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( &aes_ctx, 16, &size, NULL,
out, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( &aes_ctx, 16, &size, out,
NULL, in, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( &aes_ctx, 16, &size, out,
out, NULL, out ) );
TEST_INVALID_PARAM_RET( MBEDTLS_ERR_AES_BAD_INPUT_DATA,
mbedtls_aes_crypt_ctr( &aes_ctx, 16, &size, out,
out, in, NULL ) );
#endif /* MBEDTLS_CIPHER_MODE_CTR */
}
/* END_CASE */