Add initial options and support for parameter validation
This function adds the additional config.h option of MBEDTLS_CHECK_PARAMS which allows additional validation of parameters passed to the library.
This commit is contained in:
parent
01b34fb316
commit
b4868034dd
3 changed files with 59 additions and 0 deletions
library
|
@ -35,6 +35,7 @@
|
|||
#endif
|
||||
|
||||
#include "mbedtls/platform_util.h"
|
||||
#include "mbedtls/platform.h"
|
||||
#include "mbedtls/threading.h"
|
||||
|
||||
#include <stddef.h>
|
||||
|
@ -133,3 +134,11 @@ struct tm *mbedtls_platform_gmtime_r( const mbedtls_time_t *tt,
|
|||
#endif /* _WIN32 && !EFIX64 && !EFI32 */
|
||||
}
|
||||
#endif /* MBEDTLS_HAVE_TIME_DATE && MBEDTLS_PLATFORM_GMTIME_R_ALT */
|
||||
|
||||
#if defined( MBEDTLS_CHECK_PARAMS ) && defined(MBEDTLS_PLATFORM_C) && \
|
||||
defined(MBEDTLS_DEBUG_INVALID_PARAMS)
|
||||
void mbedtls_param_failed( char* failure_condition )
|
||||
{
|
||||
mbedtls_printf("%s:%i: Input param failed - %s\n", __FILE__, __LINE__, failure_condition );
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue