Merge branch 'mbedtls-1.3' into development

* mbedtls-1.3:
  Update generated file
  Update Changelog for deprecation config flags
  Fix tests to work with DEPRECATED_REMOVED
  Add POLARSSL_DEPRECATED_{WARNING,REMOVED}
  Suppress clang warning we don't want
This commit is contained in:
Manuel Pégourié-Gonnard 2015-03-23 14:31:25 +01:00
commit 8a80318df2
5 changed files with 45 additions and 1 deletions

View file

@ -45,6 +45,10 @@ Features
speed and RAM (heap only for now) usage.
* New script memory.sh helps measuring the ROM and RAM requirements of two
reduced configurations (PSK-CCM and NSA suite B).
* Add config flags POLARSSL_DEPRECATED_WARNING (off by default) to produce
warnings on use of deprecated functions (with GCC and Clang only).
* Add config flags POLARSSL_DEPRECATED_REMOVED (off by default) to produce
errors on use of deprecated functions.
Bugfix
* Fix hardclock() (only used in the benchmarking program) with some

View file

@ -30,6 +30,11 @@
#ifndef POLARSSL_CHECK_CONFIG_H
#define POLARSSL_CHECK_CONFIG_H
#if defined(POLARSSL_DEPRECATED_WARNING) && \
!defined(__GCC__) && !defined(__clang__)
#error "POLARSSL_DEPRECATED_WARNING only works with GCC and Clang"
#endif
#if defined(POLARSSL_AESNI_C) && !defined(POLARSSL_HAVE_ASM)
#error "POLARSSL_AESNI_C defined, but not all prerequisites"
#endif

View file

@ -179,6 +179,34 @@
//#define POLARSSL_PLATFORM_FPRINTF_ALT
//#define POLARSSL_PLATFORM_PRINTF_ALT
//#define POLARSSL_PLATFORM_SNPRINTF_ALT
/**
* \def POLARSSL_DEPRECATED_WARNING
*
* Mark deprecated functions so that they generate a warning if used.
* Functions deprecated in one version will usually be removed in the next
* version. You can enable this to help you prepare the transition to a new
* major version by making sure your code is not using these functions.
*
* This only works with GCC and Clang. With other compilers, you may want to
* use POLARSSL_DEPRECATED_REMOVED
*
* Uncomment to get warnings on using deprecated functions.
*/
//#define POLARSSL_DEPRECATED_WARNING
/**
* \def POLARSSL_DEPRECATED_REMOVED
*
* Remove deprecated functions so that they generate an error if used.
* Functions deprecated in one version will usually be removed in the next
* version. You can enable this to help you prepare the transition to a new
* major version by making sure your code is not using these functions.
*
* Uncomment to get errors on using deprecated functions.
*/
//#define POLARSSL_DEPRECATED_REMOVED
/* \} name SECTION: System support */
/**

View file

@ -78,6 +78,12 @@ static const char *features[] = {
#if defined(POLARSSL_PLATFORM_SNPRINTF_ALT)
"POLARSSL_PLATFORM_SNPRINTF_ALT",
#endif /* POLARSSL_PLATFORM_SNPRINTF_ALT */
#if defined(POLARSSL_DEPRECATED_WARNING)
"POLARSSL_DEPRECATED_WARNING",
#endif /* POLARSSL_DEPRECATED_WARNING */
#if defined(POLARSSL_DEPRECATED_REMOVED)
"POLARSSL_DEPRECATED_REMOVED",
#endif /* POLARSSL_DEPRECATED_REMOVED */
#if defined(POLARSSL_TIMING_ALT)
"POLARSSL_TIMING_ALT",
#endif /* POLARSSL_TIMING_ALT */

View file

@ -50,8 +50,9 @@ my %mapping_values;
while (@var_req_arr)
{
my $req = shift @var_req_arr;
$req =~ s/(!?)(.*)/$1defined($2)/;
$suite_pre_code .= "#ifdef $req\n";
$suite_pre_code .= "#if $req\n";
$suite_post_code .= "#endif /* $req */\n";
}