mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-07 06:15:37 +00:00
Merge remote-tracking branch 'public/pr/2081' into mbedtls-2.1-proposed
This commit is contained in:
commit
5eeded67a5
|
@ -36,6 +36,10 @@ Bugfix
|
||||||
* Zeroize memory used for reassembling handshake messages after use.
|
* Zeroize memory used for reassembling handshake messages after use.
|
||||||
* Use `mbedtls_zeroize()` instead of `memset()` for zeroization of
|
* Use `mbedtls_zeroize()` instead of `memset()` for zeroization of
|
||||||
sensitive data in the example programs aescrypt2 and crypt_and_hash.
|
sensitive data in the example programs aescrypt2 and crypt_and_hash.
|
||||||
|
* Fix compilation failure for configurations which use compile time
|
||||||
|
replacements of standard calloc/free functions through the macros
|
||||||
|
MBEDTLS_PLATFORM_CALLOC_MACRO and MBEDTLS_PLATFORM_FREE_MACRO.
|
||||||
|
Reported by ole-de and ddhome2006. Fixes #882, #1642 and #1706.
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* "make apidoc" now generates the documentation for the current
|
* "make apidoc" now generates the documentation for the current
|
||||||
|
|
|
@ -29,7 +29,14 @@
|
||||||
|
|
||||||
#include "mbedtls/platform.h"
|
#include "mbedtls/platform.h"
|
||||||
|
|
||||||
#if defined(MBEDTLS_PLATFORM_MEMORY)
|
/* The compile time configuration of memory allocation via the macros
|
||||||
|
* MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO takes precedence over the runtime
|
||||||
|
* configuration via mbedtls_platform_set_calloc_free(). So, omit everything
|
||||||
|
* related to the latter if MBEDTLS_PLATFORM_{FREE/CALLOC}_MACRO are defined. */
|
||||||
|
#if defined(MBEDTLS_PLATFORM_MEMORY) && \
|
||||||
|
!( defined(MBEDTLS_PLATFORM_CALLOC_MACRO) && \
|
||||||
|
defined(MBEDTLS_PLATFORM_FREE_MACRO) )
|
||||||
|
|
||||||
#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
|
#if !defined(MBEDTLS_PLATFORM_STD_CALLOC)
|
||||||
static void *platform_calloc_uninit( size_t n, size_t size )
|
static void *platform_calloc_uninit( size_t n, size_t size )
|
||||||
{
|
{
|
||||||
|
@ -60,7 +67,9 @@ int mbedtls_platform_set_calloc_free( void * (*calloc_func)( size_t, size_t ),
|
||||||
mbedtls_free = free_func;
|
mbedtls_free = free_func;
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_PLATFORM_MEMORY */
|
#endif /* MBEDTLS_PLATFORM_MEMORY &&
|
||||||
|
!( defined(MBEDTLS_PLATFORM_CALLOC_MACRO) &&
|
||||||
|
defined(MBEDTLS_PLATFORM_FREE_MACRO) ) */
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
|
@ -597,6 +597,18 @@ scripts/config.pl unset MBEDTLS_NET_C # getaddrinfo() undeclared, etc.
|
||||||
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
|
scripts/config.pl set MBEDTLS_NO_PLATFORM_ENTROPY # uses syscall() on GNU/Linux
|
||||||
make CC=gcc CFLAGS='-Werror -O0 -std=c99 -pedantic' lib
|
make CC=gcc CFLAGS='-Werror -O0 -std=c99 -pedantic' lib
|
||||||
|
|
||||||
|
msg "build: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
|
||||||
|
cleanup
|
||||||
|
cp "$CONFIG_H" "$CONFIG_BAK"
|
||||||
|
scripts/config.pl set MBEDTLS_PLATFORM_MEMORY
|
||||||
|
scripts/config.pl set MBEDTLS_PLATFORM_CALLOC_MACRO calloc
|
||||||
|
scripts/config.pl set MBEDTLS_PLATFORM_FREE_MACRO free
|
||||||
|
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
|
||||||
|
make
|
||||||
|
|
||||||
|
msg "test: MBEDTLS_PLATFORM_{CALLOC/FREE}_MACRO enabled (ASan build)"
|
||||||
|
make test
|
||||||
|
|
||||||
if uname -a | grep -F Linux >/dev/null; then
|
if uname -a | grep -F Linux >/dev/null; then
|
||||||
msg "build/test: make shared" # ~ 40s
|
msg "build/test: make shared" # ~ 40s
|
||||||
cleanup
|
cleanup
|
||||||
|
|
Loading…
Reference in a new issue