mirror of
https://github.com/cuberite/polarssl.git
synced 2025-09-11 16:15:56 -04:00
Fix the build without check_config.h (inclusion of limits.h)
Including `mbedtls/check_config.h` from `mbedtls/config.h` is optional. If done, `limits.h` gets included. If not done, we were missing the inclusion of `limits.h` in several source files. Fix this and add a test build that doesn't include `mbedtls/check_config.h`. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
parent
2888f05e9a
commit
a8cd2e6421
3
ChangeLog.d/build_without_check_config.txt
Normal file
3
ChangeLog.d/build_without_check_config.txt
Normal file
@ -0,0 +1,3 @@
|
||||
Bugfix
|
||||
* Fix the build in some configurations when check_config.h is not included.
|
||||
Fix #9152.
|
@ -15,6 +15,7 @@
|
||||
#include "mbedtls/rsa.h"
|
||||
#include "mbedtls/error.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
|
@ -16,6 +16,7 @@
|
||||
#include "psa_crypto_rsa.h"
|
||||
#include "psa_crypto_hash.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "mbedtls/platform.h"
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "constant_time_internal.h"
|
||||
#include "mbedtls/constant_time.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(MBEDTLS_USE_PSA_CRYPTO)
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "mbedtls/oid.h"
|
||||
#include "mbedtls/platform_util.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(MBEDTLS_PEM_PARSE_C)
|
||||
|
@ -35,6 +35,8 @@
|
||||
#define MBEDTLS_EXIT_FAILURE EXIT_FAILURE
|
||||
#endif /* MBEDTLS_PLATFORM_C */
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if !defined(MBEDTLS_NET_C)
|
||||
int main(void)
|
||||
{
|
||||
|
@ -886,6 +886,13 @@ component_test_default_out_of_box () {
|
||||
tests/scripts/run_demos.py
|
||||
}
|
||||
|
||||
component_build_without_check_config () {
|
||||
msg "build: full without check_config.h"
|
||||
scripts/config.py full
|
||||
sed -i '/#include.*check_config\.h/ s!^!//!' "$CONFIG_H"
|
||||
make
|
||||
}
|
||||
|
||||
component_test_default_cmake_gcc_asan () {
|
||||
msg "build: cmake, gcc, ASan" # ~ 1 min 50s
|
||||
CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan .
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
#include <test/ssl_helpers.h>
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#if defined(MBEDTLS_SSL_TLS_C)
|
||||
|
||||
void mbedtls_test_ssl_log_analyzer(void *ctx, int level,
|
||||
|
Loading…
x
Reference in New Issue
Block a user