Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport 2.7: Add limits.h inclusion to ssl_tls.c and udp_proxy.c #2446

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ Security
DTLS client when parsing the Hello Verify Request message.

Bugfix
* Add missing limits.h standard C library header to ssl_tls.c and udp_proxy.c
which was only including it via check_config.h previously, which may not be
included in custom configuration files. Fixes #1803
* Fix compilation failure when both MBEDTLS_SSL_PROTO_DTLS and
MBEDTLS_SSL_HW_RECORD_ACCEL are enabled.
* Fix a function name in a debug message. Contributed by Ercan Ozturk in
Expand Down
2 changes: 0 additions & 2 deletions configs/config-ccm-psk-tls1_2.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,4 @@
*/
#define MBEDTLS_SSL_MAX_CONTENT_LEN 512

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */
2 changes: 0 additions & 2 deletions configs/config-mini-tls1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,4 @@
/* For testing with compat.sh */
#define MBEDTLS_FS_IO

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */
2 changes: 0 additions & 2 deletions configs/config-no-entropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,4 @@
/* Miscellaneous options */
#define MBEDTLS_AES_ROM_TABLES

#include "check_config.h"

#endif /* MBEDTLS_CONFIG_H */
2 changes: 0 additions & 2 deletions configs/config-suite-b.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,4 @@
*/
#define MBEDTLS_SSL_MAX_CONTENT_LEN 1024

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */
2 changes: 0 additions & 2 deletions configs/config-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,4 @@
/* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8

#include "mbedtls/check_config.h"

#endif /* MBEDTLS_CONFIG_H */
2 changes: 0 additions & 2 deletions include/mbedtls/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2871,6 +2871,4 @@
#include MBEDTLS_USER_CONFIG_FILE
#endif

#include "check_config.h"

#endif /* MBEDTLS_CONFIG_H */
1 change: 1 addition & 0 deletions library/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_AES_C)

Expand Down
1 change: 1 addition & 0 deletions library/aesni.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_AESNI_C)

Expand Down
1 change: 1 addition & 0 deletions library/arc4.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ARC4_C)

Expand Down
1 change: 1 addition & 0 deletions library/asn1parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ASN1_PARSE_C)

Expand Down
1 change: 1 addition & 0 deletions library/asn1write.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ASN1_WRITE_C)

Expand Down
1 change: 1 addition & 0 deletions library/base64.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_BASE64_C)

Expand Down
1 change: 1 addition & 0 deletions library/bignum.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_BIGNUM_C)

Expand Down
1 change: 1 addition & 0 deletions library/blowfish.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_BLOWFISH_C)

Expand Down
1 change: 1 addition & 0 deletions library/camellia.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CAMELLIA_C)

Expand Down
1 change: 1 addition & 0 deletions library/ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CCM_C)

Expand Down
1 change: 1 addition & 0 deletions library/certs.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#include "mbedtls/certs.h"

Expand Down
1 change: 1 addition & 0 deletions library/cipher.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CIPHER_C)

Expand Down
1 change: 1 addition & 0 deletions library/cipher_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CIPHER_C)

Expand Down
1 change: 1 addition & 0 deletions library/cmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CMAC_C)

Expand Down
1 change: 1 addition & 0 deletions library/ctr_drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_CTR_DRBG_C)

Expand Down
1 change: 1 addition & 0 deletions library/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_DEBUG_C)

Expand Down
1 change: 1 addition & 0 deletions library/des.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_DES_C)

Expand Down
1 change: 1 addition & 0 deletions library/dhm.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_DHM_C)

Expand Down
1 change: 1 addition & 0 deletions library/ecdh.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ECDH_C)

Expand Down
1 change: 1 addition & 0 deletions library/ecdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ECDSA_C)

Expand Down
1 change: 1 addition & 0 deletions library/ecjpake.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ECJPAKE_C)

Expand Down
1 change: 1 addition & 0 deletions library/ecp.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ECP_C)

Expand Down
1 change: 1 addition & 0 deletions library/ecp_curves.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ECP_C)

Expand Down
1 change: 1 addition & 0 deletions library/entropy.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ENTROPY_C)

Expand Down
1 change: 1 addition & 0 deletions library/entropy_poll.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ENTROPY_C)

Expand Down
1 change: 1 addition & 0 deletions library/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_ERROR_C) || defined(MBEDTLS_ERROR_STRERROR_DUMMY)
#include "mbedtls/error.h"
Expand Down
1 change: 1 addition & 0 deletions library/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_GCM_C)

Expand Down
1 change: 1 addition & 0 deletions library/havege.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_HAVEGE_C)

Expand Down
1 change: 1 addition & 0 deletions library/hmac_drbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_HMAC_DRBG_C)

Expand Down
1 change: 1 addition & 0 deletions library/md.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MD_C)

Expand Down
1 change: 1 addition & 0 deletions library/md2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MD2_C)

Expand Down
1 change: 1 addition & 0 deletions library/md4.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MD4_C)

Expand Down
1 change: 1 addition & 0 deletions library/md5.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MD5_C)

Expand Down
1 change: 1 addition & 0 deletions library/md_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MD_C)

Expand Down
1 change: 1 addition & 0 deletions library/memory_buffer_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_MEMORY_BUFFER_ALLOC_C)
#include "mbedtls/memory_buffer_alloc.h"
Expand Down
1 change: 1 addition & 0 deletions library/net_sockets.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_NET_C)

Expand Down
1 change: 1 addition & 0 deletions library/oid.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_OID_C)

Expand Down
1 change: 1 addition & 0 deletions library/padlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_PADLOCK_C)

Expand Down
1 change: 1 addition & 0 deletions library/pem.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_PEM_PARSE_C) || defined(MBEDTLS_PEM_WRITE_C)

Expand Down
1 change: 1 addition & 0 deletions library/pk.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_PK_C)
#include "mbedtls/pk.h"
Expand Down
1 change: 1 addition & 0 deletions library/pk_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_PK_C)
#include "mbedtls/pk_internal.h"
Expand Down
8 changes: 7 additions & 1 deletion library/pkcs11.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@
* This file is part of mbed TLS (https://tls.mbed.org)
*/

#include "mbedtls/pkcs11.h"
#if !defined(MBEDTLS_CONFIG_FILE)
#include "mbedtls/config.h"
#else
#include MBEDTLS_CONFIG_FILE
#endif
#include "mbedtls/check_config.h"

#if defined(MBEDTLS_PKCS11_C)
#include "mbedtls/pkcs11.h"

#include "mbedtls/md.h"
#include "mbedtls/oid.h"
Expand Down
Loading