Merge remote-tracking branch 'origin/pr/2053' into mbedtls-2.16

* origin/pr/2053:
  Clarify ChangeLog entry for fix to #1628
  Add Changelog entry for clang test-ref-configs.pl fix
  Enable more compiler warnings in tests/Makefile
  Change file scoping of test helpers.function
This commit is contained in:
Jaeden Amero 2019-06-21 12:56:05 +01:00
commit f580d43bad
4 changed files with 19 additions and 13 deletions

View file

@ -1,5 +1,11 @@
mbed TLS ChangeLog (Sorted per branch, date) mbed TLS ChangeLog (Sorted per branch, date)
= mbed TLS x.x.x branch released xxxx-xx-xx
Bugfix
* Fix to allow building test suites with any warning that detects unused
functions. Fixes #1628.
= mbed TLS 2.16.2 branch released 2019-06-11 = mbed TLS 2.16.2 branch released 2019-06-11
Security Security

View file

@ -3,7 +3,7 @@
# To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS
CFLAGS ?= -O2 CFLAGS ?= -O2
WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wno-unused-function -Wno-unused-value WARNING_CFLAGS ?= -Wall -W -Wdeclaration-after-statement -Wunused
LDFLAGS ?= LDFLAGS ?=
LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64 LOCAL_CFLAGS = $(WARNING_CFLAGS) -I../include -D_FILE_OFFSET_BITS=64

View file

@ -278,7 +278,7 @@ jmp_buf jmp_tmp;
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/* Helper Functions */ /* 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.failed = 1;
test_info.test = test; test_info.test = test;
@ -369,7 +369,7 @@ static void close_output( FILE* out_stream )
} }
#endif /* __unix__ || __APPLE__ __MACH__ */ #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; unsigned char c, c2;
int len = strlen( ibuf ) / 2; int len = strlen( ibuf ) / 2;
@ -403,7 +403,7 @@ static int unhexify( unsigned char *obuf, const char *ibuf )
return len; 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; unsigned char l, h;
@ -457,7 +457,7 @@ static unsigned char *zero_alloc( size_t len )
* *
* For convenience, dies if allocation fails. * 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; unsigned char *obuf;
@ -508,7 +508,7 @@ static int rnd_std_rand( void *rng_state, unsigned char *output, size_t len )
* *
* rng_state shall be NULL. * 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 ) if( rng_state != NULL )
rng_state = NULL; rng_state = NULL;
@ -535,7 +535,7 @@ typedef struct
* *
* After the buffer is empty it will return rand(); * 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; rnd_buf_info *info = (rnd_buf_info *) rng_state;
size_t use_len; size_t use_len;
@ -581,7 +581,7 @@ typedef struct
* *
* rng_state shall be a pointer to a rnd_pseudo_info structure. * 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; rnd_pseudo_info *info = (rnd_pseudo_info *) rng_state;
uint32_t i, *k, sum, delta=0x9E3779B9; uint32_t i, *k, sum, delta=0x9E3779B9;

View file

@ -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 * This might break memory checks in the future if sources need 'free-ing' then
* as well. * as well.
*/ */
static void entropy_clear_sources( mbedtls_entropy_context *ctx ) void entropy_clear_sources( mbedtls_entropy_context *ctx )
{ {
ctx->source_count = 0; 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 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 ) if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
return( -1 ); return( -1 );
@ -67,7 +67,7 @@ static int buffer_nv_seed_read( unsigned char *buf, size_t buf_len )
return( 0 ); 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 ) if( buf_len != MBEDTLS_ENTROPY_BLOCK_SIZE )
return( -1 ); 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 * 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; FILE *f;
@ -98,7 +98,7 @@ static int write_nv_seed( unsigned char *buf, size_t buf_len )
return( 0 ); 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; FILE *f;