Merge branch 'mbedtls-2.16' into baremetal-2.16-01_07_19
This commit is contained in:
commit
abd929c89c
136 changed files with 207 additions and 716 deletions
|
@ -3,7 +3,7 @@
|
|||
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
|
||||
|
||||
CFLAGS ?= -O2
|
||||
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value
|
||||
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wunused
|
||||
LDFLAGS ?=
|
||||
|
||||
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64
|
||||
|
|
|
@ -21,7 +21,7 @@ FAILED=0
|
|||
SKIPPED=0
|
||||
SRVMEM=0
|
||||
|
||||
# default commands, can be overriden by the environment
|
||||
# default commands, can be overridden by the environment
|
||||
: ${M_SRV:=../programs/ssl/ssl_server2}
|
||||
: ${M_CLI:=../programs/ssl/ssl_client2}
|
||||
: ${OPENSSL_CMD:=openssl} # OPENSSL would conflict with the build system
|
||||
|
|
|
@ -120,7 +120,7 @@ pre_initialize_variables () {
|
|||
FORCE=0
|
||||
KEEP_GOING=0
|
||||
|
||||
# Default commands, can be overriden by the environment
|
||||
# Default commands, can be overridden by the environment
|
||||
: ${OPENSSL:="openssl"}
|
||||
: ${OPENSSL_LEGACY:="$OPENSSL"}
|
||||
: ${OPENSSL_NEXT:="$OPENSSL"}
|
||||
|
@ -794,9 +794,21 @@ component_build_default_make_gcc_and_cxx () {
|
|||
make TEST_CPP=1
|
||||
}
|
||||
|
||||
component_test_check_params_functionality () {
|
||||
msg "build+test: MBEDTLS_CHECK_PARAMS functionality"
|
||||
scripts/config.pl full # includes CHECK_PARAMS
|
||||
# Make MBEDTLS_PARAM_FAILED call mbedtls_param_failed().
|
||||
scripts/config.pl unset MBEDTLS_CHECK_PARAMS_ASSERT
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
||||
# Only build and run tests. Do not build sample programs, because
|
||||
# they don't have a mbedtls_param_failed() function.
|
||||
make CC=gcc CFLAGS='-Werror -O1' lib test
|
||||
}
|
||||
|
||||
component_test_check_params_without_platform () {
|
||||
msg "build+test: MBEDTLS_CHECK_PARAMS without MBEDTLS_PLATFORM_C"
|
||||
scripts/config.pl full # includes CHECK_PARAMS
|
||||
# Keep MBEDTLS_PARAM_FAILED as assert.
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
||||
scripts/config.pl unset MBEDTLS_PLATFORM_EXIT_ALT
|
||||
|
@ -814,6 +826,7 @@ component_test_check_params_silent () {
|
|||
msg "build+test: MBEDTLS_CHECK_PARAMS with alternative MBEDTLS_PARAM_FAILED()"
|
||||
scripts/config.pl full # includes CHECK_PARAMS
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # too slow for tests
|
||||
# Set MBEDTLS_PARAM_FAILED to nothing.
|
||||
sed -i 's/.*\(#define MBEDTLS_PARAM_FAILED( cond )\).*/\1/' "$CONFIG_H"
|
||||
make CC=gcc CFLAGS='-Werror -O1' all test
|
||||
}
|
||||
|
@ -1008,7 +1021,7 @@ component_test_m32_o0 () {
|
|||
# Build once with -O0, to compile out the i386 specific inline assembly
|
||||
msg "build: i386, make, gcc -O0 (ASan build)" # ~ 30s
|
||||
scripts/config.pl full
|
||||
make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address'
|
||||
make CC=gcc CFLAGS='-O0 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32'
|
||||
|
||||
msg "test: i386, make, gcc -O0 (ASan build)"
|
||||
make test
|
||||
|
@ -1027,7 +1040,7 @@ component_test_m32_o1 () {
|
|||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_DEBUG
|
||||
make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address'
|
||||
make CC=gcc CFLAGS='-O1 -Werror -Wall -Wextra -m32 -fsanitize=address' LDFLAGS='-m32'
|
||||
|
||||
msg "test: i386, make, gcc -O1 (ASan build)"
|
||||
make test
|
||||
|
@ -1042,7 +1055,7 @@ support_test_m32_o1 () {
|
|||
component_test_mx32 () {
|
||||
msg "build: 64-bit ILP32, make, gcc" # ~ 30s
|
||||
scripts/config.pl full
|
||||
make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32'
|
||||
make CC=gcc CFLAGS='-Werror -Wall -Wextra -mx32' LDFLAGS='-mx32'
|
||||
|
||||
msg "test: 64-bit ILP32, make, gcc"
|
||||
make test
|
||||
|
@ -1137,35 +1150,13 @@ component_test_no_x509_info () {
|
|||
|
||||
component_build_arm_none_eabi_gcc () {
|
||||
msg "build: arm-none-eabi-gcc, make" # ~ 10s
|
||||
scripts/config.pl full
|
||||
scripts/config.pl unset MBEDTLS_NET_C
|
||||
scripts/config.pl unset MBEDTLS_TIMING_C
|
||||
scripts/config.pl unset MBEDTLS_FS_IO
|
||||
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
|
||||
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
# following things are not in the default config
|
||||
scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
|
||||
scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
|
||||
scripts/config.pl unset MBEDTLS_THREADING_C
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
|
||||
scripts/config.pl baremetal
|
||||
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
|
||||
}
|
||||
|
||||
component_build_arm_none_eabi_gcc_no_udbl_division () {
|
||||
msg "build: arm-none-eabi-gcc -DMBEDTLS_NO_UDBL_DIVISION, make" # ~ 10s
|
||||
scripts/config.pl full
|
||||
scripts/config.pl unset MBEDTLS_NET_C
|
||||
scripts/config.pl unset MBEDTLS_TIMING_C
|
||||
scripts/config.pl unset MBEDTLS_FS_IO
|
||||
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
|
||||
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
# following things are not in the default config
|
||||
scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
|
||||
scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
|
||||
scripts/config.pl unset MBEDTLS_THREADING_C
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
|
||||
scripts/config.pl baremetal
|
||||
scripts/config.pl set MBEDTLS_NO_UDBL_DIVISION
|
||||
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -Wall -Wextra' lib
|
||||
echo "Checking that software 64-bit division is not required"
|
||||
|
@ -1174,18 +1165,7 @@ component_build_arm_none_eabi_gcc_no_udbl_division () {
|
|||
|
||||
component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
|
||||
msg "build: arm-none-eabi-gcc MBEDTLS_NO_64BIT_MULTIPLICATION, make" # ~ 10s
|
||||
scripts/config.pl full
|
||||
scripts/config.pl unset MBEDTLS_NET_C
|
||||
scripts/config.pl unset MBEDTLS_TIMING_C
|
||||
scripts/config.pl unset MBEDTLS_FS_IO
|
||||
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
|
||||
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
# following things are not in the default config
|
||||
scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
|
||||
scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
|
||||
scripts/config.pl unset MBEDTLS_THREADING_C
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
|
||||
scripts/config.pl baremetal
|
||||
scripts/config.pl set MBEDTLS_NO_64BIT_MULTIPLICATION
|
||||
make CC=arm-none-eabi-gcc AR=arm-none-eabi-ar LD=arm-none-eabi-ld CFLAGS='-Werror -O1 -march=armv6-m -mthumb' lib
|
||||
echo "Checking that software 64-bit multiplication is not required"
|
||||
|
@ -1194,22 +1174,7 @@ component_build_arm_none_eabi_gcc_no_64bit_multiplication () {
|
|||
|
||||
component_build_armcc () {
|
||||
msg "build: ARM Compiler 5, make"
|
||||
scripts/config.pl full
|
||||
scripts/config.pl unset MBEDTLS_NET_C
|
||||
scripts/config.pl unset MBEDTLS_TIMING_C
|
||||
scripts/config.pl unset MBEDTLS_FS_IO
|
||||
scripts/config.pl unset MBEDTLS_ENTROPY_NV_SEED
|
||||
scripts/config.pl unset MBEDTLS_HAVE_TIME
|
||||
scripts/config.pl unset MBEDTLS_HAVE_TIME_DATE
|
||||
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY
|
||||
# following things are not in the default config
|
||||
scripts/config.pl unset MBEDTLS_DEPRECATED_WARNING
|
||||
scripts/config.pl unset MBEDTLS_HAVEGE_C # depends on timing.c
|
||||
scripts/config.pl unset MBEDTLS_THREADING_PTHREAD
|
||||
scripts/config.pl unset MBEDTLS_THREADING_C
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BACKTRACE # execinfo.h
|
||||
scripts/config.pl unset MBEDTLS_MEMORY_BUFFER_ALLOC_C # calls exit
|
||||
scripts/config.pl unset MBEDTLS_PLATFORM_TIME_ALT # depends on MBEDTLS_HAVE_TIME
|
||||
scripts/config.pl baremetal
|
||||
|
||||
make CC="$ARMC5_CC" AR="$ARMC5_AR" WARNING_CFLAGS='--strict --c99' lib
|
||||
make clean
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
# seem to be a mechanism to reliably check whether the zeroize calls are being
|
||||
# eliminated by compiler optimizations from within the compiled program. The
|
||||
# problem is that a compiler would typically remove what it considers to be
|
||||
# "unecessary" assignments as part of redundant code elimination. To identify
|
||||
# "unnecessary" assignments as part of redundant code elimination. To identify
|
||||
# such code, the compilar will create some form dependency graph between
|
||||
# reads and writes to variables (among other situations). It will then use this
|
||||
# data structure to remove redundant code that does not have an impact on the
|
||||
|
|
|
@ -26,7 +26,7 @@ if cd $( dirname $0 ); then :; else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# default values, can be overriden by the environment
|
||||
# default values, can be overridden by the environment
|
||||
: ${P_SRV:=../programs/ssl/ssl_server2}
|
||||
: ${P_CLI:=../programs/ssl/ssl_client2}
|
||||
: ${P_PXY:=../programs/test/udp_proxy}
|
||||
|
@ -738,7 +738,7 @@ run_test() {
|
|||
|
||||
# The filtering in the following two options (-u and -U) do the following
|
||||
# - ignore valgrind output
|
||||
# - filter out everything but lines right after the pattern occurances
|
||||
# - filter out everything but lines right after the pattern occurrences
|
||||
# - keep one of each non-unique line
|
||||
# - count how many lines remain
|
||||
# A line with '--' will remain in the result from previous outputs, so the number of lines in the result will be 1
|
||||
|
@ -3546,7 +3546,7 @@ run_test "Authentication: server max_int chain, client default" \
|
|||
key_file=data_files/dir-maxpath/09.key" \
|
||||
"$P_CLI server_name=CA09 ca_file=data_files/dir-maxpath/00.crt" \
|
||||
0 \
|
||||
-C "X509 - A fatal error occured"
|
||||
-C "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: server max_int+1 chain, client default" \
|
||||
|
@ -3554,7 +3554,7 @@ run_test "Authentication: server max_int+1 chain, client default" \
|
|||
key_file=data_files/dir-maxpath/10.key" \
|
||||
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt" \
|
||||
1 \
|
||||
-c "X509 - A fatal error occured"
|
||||
-c "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: server max_int+1 chain, client optional" \
|
||||
|
@ -3563,7 +3563,7 @@ run_test "Authentication: server max_int+1 chain, client optional" \
|
|||
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
|
||||
auth_mode=optional" \
|
||||
1 \
|
||||
-c "X509 - A fatal error occured"
|
||||
-c "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: server max_int+1 chain, client none" \
|
||||
|
@ -3572,7 +3572,7 @@ run_test "Authentication: server max_int+1 chain, client none" \
|
|||
"$P_CLI server_name=CA10 ca_file=data_files/dir-maxpath/00.crt \
|
||||
auth_mode=none" \
|
||||
0 \
|
||||
-C "X509 - A fatal error occured"
|
||||
-C "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: client max_int+1 chain, server default" \
|
||||
|
@ -3580,7 +3580,7 @@ run_test "Authentication: client max_int+1 chain, server default" \
|
|||
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
||||
key_file=data_files/dir-maxpath/10.key" \
|
||||
0 \
|
||||
-S "X509 - A fatal error occured"
|
||||
-S "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: client max_int+1 chain, server optional" \
|
||||
|
@ -3588,7 +3588,7 @@ run_test "Authentication: client max_int+1 chain, server optional" \
|
|||
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
||||
key_file=data_files/dir-maxpath/10.key" \
|
||||
1 \
|
||||
-s "X509 - A fatal error occured"
|
||||
-s "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: client max_int+1 chain, server required" \
|
||||
|
@ -3596,7 +3596,7 @@ run_test "Authentication: client max_int+1 chain, server required" \
|
|||
"$P_CLI crt_file=data_files/dir-maxpath/c10.pem \
|
||||
key_file=data_files/dir-maxpath/10.key" \
|
||||
1 \
|
||||
-s "X509 - A fatal error occured"
|
||||
-s "X509 - A fatal error occurred"
|
||||
|
||||
requires_full_size_output_buffer
|
||||
run_test "Authentication: client max_int chain, server required" \
|
||||
|
@ -3604,7 +3604,7 @@ run_test "Authentication: client max_int chain, server required" \
|
|||
"$P_CLI crt_file=data_files/dir-maxpath/c09.pem \
|
||||
key_file=data_files/dir-maxpath/09.key" \
|
||||
0 \
|
||||
-S "X509 - A fatal error occured"
|
||||
-S "X509 - A fatal error occurred"
|
||||
|
||||
# Tests for CA list in CertificateRequest messages
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ typedef enum
|
|||
#define TEST_VALID_PARAM( TEST ) \
|
||||
TEST_ASSERT( ( TEST, 1 ) );
|
||||
|
||||
#define assert(a) if( !( a ) ) \
|
||||
#define TEST_HELPER_ASSERT(a) if( !( a ) ) \
|
||||
{ \
|
||||
mbedtls_fprintf( stderr, "Assertion Failed at %s:%d - %s\n", \
|
||||
__FILE__, __LINE__, #a ); \
|
||||
|
@ -278,7 +278,7 @@ jmp_buf jmp_tmp;
|
|||
/*----------------------------------------------------------------------------*/
|
||||
/* Helper Functions */
|
||||
|
||||
static void test_fail( const char *test, int line_no, const char* filename )
|
||||
void test_fail( const char *test, int line_no, const char* filename )
|
||||
{
|
||||
test_info.failed = 1;
|
||||
test_info.test = test;
|
||||
|
@ -369,11 +369,11 @@ static void close_output( FILE* out_stream )
|
|||
}
|
||||
#endif /* __unix__ || __APPLE__ __MACH__ */
|
||||
|
||||
static int unhexify( unsigned char *obuf, const char *ibuf )
|
||||
int unhexify( unsigned char *obuf, const char *ibuf )
|
||||
{
|
||||
unsigned char c, c2;
|
||||
int len = strlen( ibuf ) / 2;
|
||||
assert( strlen( ibuf ) % 2 == 0 ); /* must be even number of bytes */
|
||||
TEST_HELPER_ASSERT( strlen( ibuf ) % 2 == 0 ); /* must be even number of bytes */
|
||||
|
||||
while( *ibuf != 0 )
|
||||
{
|
||||
|
@ -385,7 +385,7 @@ static int unhexify( unsigned char *obuf, const char *ibuf )
|
|||
else if( c >= 'A' && c <= 'F' )
|
||||
c -= 'A' - 10;
|
||||
else
|
||||
assert( 0 );
|
||||
TEST_HELPER_ASSERT( 0 );
|
||||
|
||||
c2 = *ibuf++;
|
||||
if( c2 >= '0' && c2 <= '9' )
|
||||
|
@ -395,7 +395,7 @@ static int unhexify( unsigned char *obuf, const char *ibuf )
|
|||
else if( c2 >= 'A' && c2 <= 'F' )
|
||||
c2 -= 'A' - 10;
|
||||
else
|
||||
assert( 0 );
|
||||
TEST_HELPER_ASSERT( 0 );
|
||||
|
||||
*obuf++ = ( c << 4 ) | c2;
|
||||
}
|
||||
|
@ -403,7 +403,7 @@ static int unhexify( unsigned char *obuf, const char *ibuf )
|
|||
return len;
|
||||
}
|
||||
|
||||
static void hexify( unsigned char *obuf, const unsigned char *ibuf, int len )
|
||||
void hexify( unsigned char *obuf, const unsigned char *ibuf, int len )
|
||||
{
|
||||
unsigned char l, h;
|
||||
|
||||
|
@ -440,7 +440,7 @@ static unsigned char *zero_alloc( size_t len )
|
|||
size_t actual_len = ( len != 0 ) ? len : 1;
|
||||
|
||||
p = mbedtls_calloc( 1, actual_len );
|
||||
assert( p != NULL );
|
||||
TEST_HELPER_ASSERT( p != NULL );
|
||||
|
||||
memset( p, 0x00, actual_len );
|
||||
|
||||
|
@ -457,7 +457,7 @@ static unsigned char *zero_alloc( size_t len )
|
|||
*
|
||||
* For convenience, dies if allocation fails.
|
||||
*/
|
||||
static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
|
||||
unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
|
||||
{
|
||||
unsigned char *obuf;
|
||||
|
||||
|
@ -467,7 +467,7 @@ static unsigned char *unhexify_alloc( const char *ibuf, size_t *olen )
|
|||
return( zero_alloc( *olen ) );
|
||||
|
||||
obuf = mbedtls_calloc( 1, *olen );
|
||||
assert( obuf != NULL );
|
||||
TEST_HELPER_ASSERT( obuf != NULL );
|
||||
|
||||
(void) unhexify( obuf, ibuf );
|
||||
|
||||
|
@ -508,7 +508,7 @@ static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
|
|||
*
|
||||
* rng_state shall be NULL.
|
||||
*/
|
||||
static int rnd_zero_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
int rnd_zero_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
{
|
||||
if( rng_state != NULL )
|
||||
rng_state = NULL;
|
||||
|
@ -535,7 +535,7 @@ typedef struct
|
|||
*
|
||||
* After the buffer is empty it will return rand();
|
||||
*/
|
||||
static int rnd_buffer_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
int rnd_buffer_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
{
|
||||
rnd_buf_info *info = (rnd_buf_info *) rng_state;
|
||||
size_t use_len;
|
||||
|
@ -581,7 +581,7 @@ typedef struct
|
|||
*
|
||||
* rng_state shall be a pointer to a rnd_pseudo_info structure.
|
||||
*/
|
||||
static int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
int rnd_pseudo_rand( void *rng_state, unsigned char *output, size_t len )
|
||||
{
|
||||
rnd_pseudo_info *info = (rnd_pseudo_info *) rng_state;
|
||||
uint32_t i, *k, sum, delta=0x9E3779B9;
|
||||
|
|
|
@ -179,7 +179,7 @@ static int parse_arguments( char *buf, size_t len, char **params,
|
|||
if( p + 1 < buf + len )
|
||||
{
|
||||
cur = p + 1;
|
||||
assert( cnt < params_len );
|
||||
TEST_HELPER_ASSERT( cnt < params_len );
|
||||
params[cnt++] = cur;
|
||||
}
|
||||
*p = '\0';
|
||||
|
|
|
@ -13,11 +13,11 @@
|
|||
*/
|
||||
#define INCR_ASSERT(p, start, len, step) do \
|
||||
{ \
|
||||
assert( ( p ) >= ( start ) ); \
|
||||
assert( sizeof( *( p ) ) == sizeof( *( start ) ) ); \
|
||||
TEST_HELPER_ASSERT( ( p ) >= ( start ) ); \
|
||||
TEST_HELPER_ASSERT( sizeof( *( p ) ) == sizeof( *( start ) ) ); \
|
||||
/* <= is checked to support use inside a loop where \
|
||||
pointer is incremented after reading data. */ \
|
||||
assert( (uint32_t)( ( ( p ) - ( start ) ) + ( step ) ) <= ( len ) );\
|
||||
TEST_HELPER_ASSERT( (uint32_t)( ( ( p ) - ( start ) ) + ( step ) ) <= ( len ) );\
|
||||
( p ) += ( step ); \
|
||||
} \
|
||||
while( 0 )
|
||||
|
@ -127,7 +127,7 @@ uint8_t * receive_data( uint32_t * data_len )
|
|||
/* Read data length */
|
||||
*data_len = receive_uint32();
|
||||
data = (uint8_t *)malloc( *data_len );
|
||||
assert( data != NULL );
|
||||
TEST_HELPER_ASSERT( data != NULL );
|
||||
|
||||
greentea_getc(); // read ';' received after key i.e. *data_len
|
||||
|
||||
|
@ -221,7 +221,7 @@ void ** parse_parameters( uint8_t count, uint8_t * data, uint32_t data_len,
|
|||
hex_count = find_hex_count(count, data, data_len);
|
||||
|
||||
params = (void **)malloc( sizeof( void *) * ( count + hex_count ) );
|
||||
assert( params != NULL );
|
||||
TEST_HELPER_ASSERT( params != NULL );
|
||||
cur = params;
|
||||
|
||||
p = data;
|
||||
|
@ -360,7 +360,7 @@ int execute_tests( int args, const char ** argv )
|
|||
{
|
||||
/* Read dependency count */
|
||||
count = *p;
|
||||
assert( count < data_len );
|
||||
TEST_HELPER_ASSERT( count < data_len );
|
||||
INCR_ASSERT( p, data, data_len, sizeof( uint8_t ) );
|
||||
ret = verify_dependencies( count, p );
|
||||
if ( ret != DEPENDENCY_SUPPORTED )
|
||||
|
|
|
@ -41,7 +41,7 @@ ccm_lengths:5:10:5:18:MBEDTLS_ERR_CCM_BAD_INPUT
|
|||
CCM lengths #6 tag length not even
|
||||
ccm_lengths:5:10:5:7:MBEDTLS_ERR_CCM_BAD_INPUT
|
||||
|
||||
CCM lenghts #7 AD too long (2^16 - 2^8 + 1)
|
||||
CCM lengths #7 AD too long (2^16 - 2^8 + 1)
|
||||
depends_on:!MBEDTLS_CCM_ALT
|
||||
ccm_lengths:5:10:65281:8:MBEDTLS_ERR_CCM_BAD_INPUT
|
||||
|
||||
|
|
|
@ -387,7 +387,7 @@ void ecdh_restart( int id, char *dA_str, char *dB_str, char *z_str,
|
|||
mbedtls_ecdh_enable_restart( &cli );
|
||||
}
|
||||
|
||||
/* server writes its paramaters */
|
||||
/* server writes its parameters */
|
||||
memset( buf, 0x00, sizeof( buf ) );
|
||||
len = 0;
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ static int entropy_dummy_source( void *data, unsigned char *output,
|
|||
* This might break memory checks in the future if sources need 'free-ing' then
|
||||
* as well.
|
||||
*/
|
||||
static void entropy_clear_sources( mbedtls_entropy_context *ctx )
|
||||
void entropy_clear_sources( mbedtls_entropy_context *ctx )
|
||||
{
|
||||
ctx->source_count = 0;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ static void entropy_clear_sources( mbedtls_entropy_context *ctx )
|
|||
*/
|
||||
static unsigned char buffer_seed[MBEDTLS_ENTROPY_BLOCK_SIZE];
|
||||
|
||||
static int buffer_nv_seed_read( unsigned char *buf, size_t buf_len )
|
||||
int buffer_nv_seed_read( unsigned char *buf, size_t buf_len )
|
||||
{
|
||||
if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
|
||||
return( -1 );
|
||||
|
@ -67,7 +67,7 @@ static int buffer_nv_seed_read( unsigned char *buf, size_t buf_len )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
static int buffer_nv_seed_write( unsigned char *buf, size_t buf_len )
|
||||
int buffer_nv_seed_write( unsigned char *buf, size_t buf_len )
|
||||
{
|
||||
if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
|
||||
return( -1 );
|
||||
|
@ -79,7 +79,7 @@ static int buffer_nv_seed_write( unsigned char *buf, size_t buf_len )
|
|||
/*
|
||||
* NV seed read/write helpers that fill the base seedfile
|
||||
*/
|
||||
static int write_nv_seed( unsigned char *buf, size_t buf_len )
|
||||
int write_nv_seed( unsigned char *buf, size_t buf_len )
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
|
@ -98,7 +98,7 @@ static int write_nv_seed( unsigned char *buf, size_t buf_len )
|
|||
return( 0 );
|
||||
}
|
||||
|
||||
static int read_nv_seed( unsigned char *buf, size_t buf_len )
|
||||
int read_nv_seed( unsigned char *buf, size_t buf_len )
|
||||
{
|
||||
FILE *f;
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ void mbedtls_nist_kw_mix_contexts( )
|
|||
memset( key, 0, sizeof( key ) );
|
||||
|
||||
/*
|
||||
* 1. Check wrap and unwrap with two seperate contexts
|
||||
* 1. Check wrap and unwrap with two separate contexts
|
||||
*/
|
||||
mbedtls_nist_kw_init( &ctx1 );
|
||||
mbedtls_nist_kw_init( &ctx2 );
|
||||
|
|
|
@ -478,7 +478,7 @@ mbedtls_rsa_import:16:"":16:"e79a373182bfaa722eb035f772ad2a9464bd842de59432c18bb
|
|||
RSA Import (N,-,-,D,E)
|
||||
mbedtls_rsa_import:16:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":16:"":16:"":16:"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":16:"3":0:1:0:0
|
||||
|
||||
RSA Import (N,-,-,D,E), succesive
|
||||
RSA Import (N,-,-,D,E), successive
|
||||
mbedtls_rsa_import:16:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":16:"":16:"":16:"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":16:"3":1:1:0:0
|
||||
|
||||
RSA Import (N,P,Q,-,E)
|
||||
|
@ -565,7 +565,7 @@ mbedtls_rsa_export:16:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7
|
|||
RSA Export (N,-,-,D,E)
|
||||
mbedtls_rsa_export:16:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":16:"":16:"":16:"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":16:"3":1:0
|
||||
|
||||
RSA Export (N,-,-,D,E), succesive
|
||||
RSA Export (N,-,-,D,E), successive
|
||||
mbedtls_rsa_export:16:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":16:"":16:"":16:"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":16:"3":1:1
|
||||
|
||||
RSA Export (N,P,Q,-,E)
|
||||
|
@ -586,7 +586,7 @@ mbedtls_rsa_export_raw:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f
|
|||
RSA Export Raw (N,-,-,D,E)
|
||||
mbedtls_rsa_export_raw:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":"":"":"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":"03":1:0
|
||||
|
||||
RSA Export Raw (N,-,-,D,E), succesive
|
||||
RSA Export Raw (N,-,-,D,E), successive
|
||||
mbedtls_rsa_export_raw:"b38ac65c8141f7f5c96e14470e851936a67bf94cc6821a39ac12c05f7c0b06d9e6ddba2224703b02e25f31452f9c4a8417b62675fdc6df46b94813bc7b9769a892c482b830bfe0ad42e46668ace68903617faf6681f4babf1cc8e4b0420d3c7f61dc45434c6b54e2c3ee0fc07908509d79c9826e673bf8363255adb0add2401039a7bcd1b4ecf0fbe6ec8369d2da486eec59559dd1d54c9b24190965eafbdab203b35255765261cd0909acf93c3b8b8428cbb448de4715d1b813d0c94829c229543d391ce0adab5351f97a3810c1f73d7b1458b97daed4209c50e16d064d2d5bfda8c23893d755222793146d0a78c3d64f35549141486c3b0961a7b4c1a2034f":"":"":"77B1D99300D6A54E864962DA09AE10CF19A7FB888456BC2672B72AEA52B204914493D16C184AD201EC3F762E1FBD8702BA796EF953D9EA2F26300D285264F11B0C8301D0207FEB1E2C984445C899B0ACEBAA74EF014DD1D4BDDB43202C08D2FF9692D8D788478DEC829EB52AFB5AE068FBDBAC499A27FACECC391E75C936D55F07BB45EE184DAB45808E15722502F279F89B38C1CB292557E5063597F52C75D61001EDC33F4739353E33E56AD273B067C1A2760208529EA421774A5FFFCB3423B1E0051E7702A55D80CBF2141569F18F87BFF538A1DA8EDBB2693A539F68E0D62D77743F89EACF3B1723BDB25CE2F333FA63CACF0E67DF1A431893BB9B352FCB":"03":1:1
|
||||
|
||||
RSA Export Raw (N,P,Q,-,E)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
Check compiletime library version
|
||||
check_compiletime_version:"2.16.1"
|
||||
check_compiletime_version:"2.16.2"
|
||||
|
||||
Check runtime library version
|
||||
check_runtime_version:"2.16.1"
|
||||
check_runtime_version:"2.16.2"
|
||||
|
||||
Check for MBEDTLS_VERSION_C
|
||||
check_feature:"MBEDTLS_VERSION_C":0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue