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.
diff --git a/programs/ssl/ssl_client2.c b/programs/ssl/ssl_client2.c
index 15c778d..098c138 100644
--- a/programs/ssl/ssl_client2.c
+++ b/programs/ssl/ssl_client2.c
@@ -314,6 +314,14 @@
#define ALPN_LIST_SIZE 10
#define CURVE_LIST_SIZE 20
+#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
*/