early-access version 1503
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* BEGIN_HEADER */
|
||||
#include "mbedtls/debug.h"
|
||||
#include "string.h"
|
||||
|
||||
struct buffer_data
|
||||
{
|
||||
@@ -47,8 +48,8 @@ void string_debug(void *data, int level, const char *file, int line, const char
|
||||
*/
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void debug_print_msg_threshold( int threshold, int level, char *file, int line,
|
||||
char *result_str )
|
||||
void debug_print_msg_threshold( int threshold, int level, char * file,
|
||||
int line, char * result_str )
|
||||
{
|
||||
mbedtls_ssl_context ssl;
|
||||
mbedtls_ssl_config conf;
|
||||
@@ -76,8 +77,8 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mbedtls_debug_print_ret( char *file, int line, char *text, int value,
|
||||
char *result_str )
|
||||
void mbedtls_debug_print_ret( char * file, int line, char * text, int value,
|
||||
char * result_str )
|
||||
{
|
||||
mbedtls_ssl_context ssl;
|
||||
mbedtls_ssl_config conf;
|
||||
@@ -103,28 +104,24 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE */
|
||||
void mbedtls_debug_print_buf( char *file, int line, char *text,
|
||||
char *data_string, char *result_str )
|
||||
void mbedtls_debug_print_buf( char * file, int line, char * text,
|
||||
data_t * data, char * result_str )
|
||||
{
|
||||
unsigned char data[10000];
|
||||
mbedtls_ssl_context ssl;
|
||||
mbedtls_ssl_config conf;
|
||||
struct buffer_data buffer;
|
||||
size_t data_len;
|
||||
|
||||
mbedtls_ssl_init( &ssl );
|
||||
mbedtls_ssl_config_init( &conf );
|
||||
memset( &data, 0, sizeof( data ) );
|
||||
memset( buffer.buf, 0, 2000 );
|
||||
buffer.ptr = buffer.buf;
|
||||
|
||||
data_len = unhexify( data, data_string );
|
||||
|
||||
TEST_ASSERT( mbedtls_ssl_setup( &ssl, &conf ) == 0 );
|
||||
|
||||
mbedtls_ssl_conf_dbg( &conf, string_debug, &buffer);
|
||||
|
||||
mbedtls_debug_print_buf( &ssl, 0, file, line, text, data, data_len );
|
||||
mbedtls_debug_print_buf( &ssl, 0, file, line, text, data->x, data->len );
|
||||
|
||||
TEST_ASSERT( strcmp( buffer.buf, result_str ) == 0 );
|
||||
|
||||
@@ -135,8 +132,8 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_FS_IO:MBEDTLS_X509_CRT_PARSE_C */
|
||||
void mbedtls_debug_print_crt( char *crt_file, char *file, int line,
|
||||
char *prefix, char *result_str )
|
||||
void mbedtls_debug_print_crt( char * crt_file, char * file, int line,
|
||||
char * prefix, char * result_str )
|
||||
{
|
||||
mbedtls_x509_crt crt;
|
||||
mbedtls_ssl_context ssl;
|
||||
@@ -166,8 +163,8 @@ exit:
|
||||
/* END_CASE */
|
||||
|
||||
/* BEGIN_CASE depends_on:MBEDTLS_BIGNUM_C */
|
||||
void mbedtls_debug_print_mpi( int radix, char *value, char *file, int line,
|
||||
char *prefix, char *result_str )
|
||||
void mbedtls_debug_print_mpi( int radix, char * value, char * file, int line,
|
||||
char * prefix, char * result_str )
|
||||
{
|
||||
mbedtls_ssl_context ssl;
|
||||
mbedtls_ssl_config conf;
|
||||
|
Reference in New Issue
Block a user