Add handlers for parameter validation in the sample programs

The sample programs require an additional handler function of
mbedtls_param_failed() to handle any failed parameter validation checks enabled
by the MBEDTLS_CHECK_PARAMS config.h option.
This commit is contained in:
Simon Butcher 2018-12-06 17:43:31 +00:00 committed by Manuel Pégourié-Gonnard
parent a646345e3f
commit 63cb97e562
37 changed files with 312 additions and 0 deletions
programs/x509

View file

@ -60,6 +60,14 @@ int main( void )
" filename=%%s default: cert.req\n" \
"\n"
#if defined( MBEDTLS_CHECK_PARAMS ) && defined(MBEDTLS_PLATFORM_C)
void mbedtls_param_failed( char* failure_condition, char* file, int line )
{
mbedtls_printf("%s:%i: Input param failed - %sn", file, line, failure_condition );
mbedtls_exit( MBEDTLS_EXIT_FAILURE );
}
#endif
/*
* global options
*/