Skip to content

Commit c42d29b

Browse files
FalessRepiteo
authored andcommitted
mbedTLS: Update to 3.6.7
(cherry picked from commit 1de7e25)
1 parent 683e381 commit c42d29b

82 files changed

Lines changed: 3592 additions & 1224 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

modules/mbedtls/SCsub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ if env["builtin_mbedtls"]:
7676
"psa_crypto_hash.c",
7777
"psa_crypto_mac.c",
7878
"psa_crypto_pake.c",
79+
"psa_crypto_random.c",
7980
"psa_crypto_rsa.c",
8081
"psa_crypto_se.c",
8182
"psa_crypto_slot_management.c",

thirdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,7 @@ File extracted from upstream source:
606606
## mbedtls
607607

608608
- Upstream: https://github.com/Mbed-TLS/mbedtls
609-
- Version: 3.6.5 (e185d7fd85499c8ce5ca2a54f5cf8fe7dbe3f8df, 2025)
609+
- Version: 3.6.7 (068ff080b369adfac81509f9b57b2afabaf82dc5, 2026)
610610
- License: Apache 2.0
611611

612612
File extracted from upstream release tarball:

thirdparty/mbedtls/include/mbedtls/asn1write.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -381,10 +381,10 @@ mbedtls_asn1_named_data *mbedtls_asn1_store_named_data(mbedtls_asn1_named_data *
381381
const unsigned char *val,
382382
size_t val_len);
383383

384+
#endif /* MBEDTLS_ASN1_WRITE_C */
385+
384386
#ifdef __cplusplus
385387
}
386388
#endif
387389

388-
#endif /* MBEDTLS_ASN1_WRITE_C */
389-
390390
#endif /* MBEDTLS_ASN1_WRITE_H */

thirdparty/mbedtls/include/mbedtls/build_info.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,16 @@
2626
*/
2727
#define MBEDTLS_VERSION_MAJOR 3
2828
#define MBEDTLS_VERSION_MINOR 6
29-
#define MBEDTLS_VERSION_PATCH 5
29+
#define MBEDTLS_VERSION_PATCH 7
3030

3131
/**
3232
* The single version number has the following structure:
3333
* MMNNPP00
3434
* Major version | Minor version | Patch version
3535
*/
36-
#define MBEDTLS_VERSION_NUMBER 0x03060500
37-
#define MBEDTLS_VERSION_STRING "3.6.5"
38-
#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 3.6.5"
36+
#define MBEDTLS_VERSION_NUMBER 0x03060700
37+
#define MBEDTLS_VERSION_STRING "3.6.7"
38+
#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 3.6.7"
3939

4040
/* Macros for build-time platform detection */
4141

thirdparty/mbedtls/include/mbedtls/chacha20.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ extern "C" {
3838
typedef struct mbedtls_chacha20_context {
3939
uint32_t MBEDTLS_PRIVATE(state)[16]; /*! The state (before round operations). */
4040
uint8_t MBEDTLS_PRIVATE(keystream8)[64]; /*! Leftover keystream bytes. */
41-
size_t MBEDTLS_PRIVATE(keystream_bytes_used); /*! Number of keystream bytes already used. */
41+
size_t MBEDTLS_PRIVATE(keystream_bytes_used); /*! Number of keystream bytes already used,
42+
* or an internal sentinel value. */
4243
}
4344
mbedtls_chacha20_context;
4445

@@ -143,6 +144,9 @@ int mbedtls_chacha20_starts(mbedtls_chacha20_context *ctx,
143144
* This pointer can be \c NULL if `size == 0`.
144145
*
145146
* \return \c 0 on success.
147+
* \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA
148+
* if processing \p size bytes would make the 32-bit block
149+
* counter wrap.
146150
* \return A negative error code on failure.
147151
*/
148152
int mbedtls_chacha20_update(mbedtls_chacha20_context *ctx,
@@ -176,6 +180,9 @@ int mbedtls_chacha20_update(mbedtls_chacha20_context *ctx,
176180
* This pointer can be \c NULL if `size == 0`.
177181
*
178182
* \return \c 0 on success.
183+
* \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA
184+
* if processing \p size bytes would make the 32-bit block
185+
* counter wrap.
179186
* \return A negative error code on failure.
180187
*/
181188
int mbedtls_chacha20_crypt(const unsigned char key[32],

thirdparty/mbedtls/include/mbedtls/chachapoly.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ int mbedtls_chachapoly_update_aad(mbedtls_chachapoly_context *ctx,
227227
* \return #MBEDTLS_ERR_CHACHAPOLY_BAD_STATE
228228
* if the operation has not been started or has been
229229
* finished.
230+
* \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA
231+
* if processing \p len bytes would make the 32-bit block
232+
* counter wrap.
230233
* \return Another negative error code on other kinds of failure.
231234
*/
232235
int mbedtls_chachapoly_update(mbedtls_chachapoly_context *ctx,
@@ -280,6 +283,9 @@ int mbedtls_chachapoly_finish(mbedtls_chachapoly_context *ctx,
280283
* is written. This must not be \c NULL.
281284
*
282285
* \return \c 0 on success.
286+
* \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA
287+
* if processing \p length bytes would make the 32-bit block
288+
* counter wrap.
283289
* \return A negative error code on failure.
284290
*/
285291
int mbedtls_chachapoly_encrypt_and_tag(mbedtls_chachapoly_context *ctx,
@@ -314,6 +320,9 @@ int mbedtls_chachapoly_encrypt_and_tag(mbedtls_chachapoly_context *ctx,
314320
* \return \c 0 on success.
315321
* \return #MBEDTLS_ERR_CHACHAPOLY_AUTH_FAILED
316322
* if the data was not authentic.
323+
* \return #MBEDTLS_ERR_CHACHA20_BAD_INPUT_DATA
324+
* if processing \p length bytes would make the 32-bit block
325+
* counter wrap.
317326
* \return Another negative error code on other kinds of failure.
318327
*/
319328
int mbedtls_chachapoly_auth_decrypt(mbedtls_chachapoly_context *ctx,

thirdparty/mbedtls/include/mbedtls/config_adjust_legacy_crypto.h

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,49 @@
4848
#endif
4949
#endif /* _MINGW32__ || (_MSC_VER && (_MSC_VER <= 1900)) */
5050

51+
/* The number of "true" entropy sources (excluding NV seed).
52+
* This must be consistent with mbedtls_entropy_init() in entropy.c.
53+
*/
54+
/* Define auxiliary macros, because in standard C, defined(xxx) is only
55+
* allowed directly on an #if or #elif line, not in recursive expansion. */
56+
#if defined(MBEDTLS_NO_PLATFORM_ENTROPY)
57+
#define MBEDTLS_PLATFORM_ENTROPY_ENABLED 0
58+
#else
59+
#define MBEDTLS_PLATFORM_ENTROPY_ENABLED 1
60+
#endif
61+
#if defined(MBEDTLS_ENTROPY_HARDWARE_ALT)
62+
#define MBEDTLS_ENTROPY_HARDWARE_ALT_DEFINED 1
63+
#else
64+
#define MBEDTLS_ENTROPY_HARDWARE_ALT_DEFINED 0
65+
#endif
66+
67+
#define MBEDTLS_ENTROPY_TRUE_SOURCES ( \
68+
MBEDTLS_ENTROPY_HARDWARE_ALT_DEFINED + \
69+
MBEDTLS_PLATFORM_ENTROPY_ENABLED + \
70+
0)
71+
72+
/* Whether there is at least one entropy source for the entropy module.
73+
*
74+
* Note that when MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG is enabled, the entropy
75+
* module is unused and the configuration will typically not include any
76+
* entropy source, so this macro will typically remain undefined.
77+
*/
78+
#if defined(MBEDTLS_ENTROPY_NV_SEED)
79+
#define MBEDTLS_ENTROPY_HAVE_SOURCES (MBEDTLS_ENTROPY_TRUE_SOURCES + 1)
80+
#elif MBEDTLS_ENTROPY_TRUE_SOURCES != 0
81+
#define MBEDTLS_ENTROPY_HAVE_SOURCES MBEDTLS_ENTROPY_TRUE_SOURCES
82+
#else
83+
#undef MBEDTLS_ENTROPY_HAVE_SOURCES
84+
#endif
85+
86+
/* Test function dependencies can only check with defined(),
87+
* not other preprocessor expressions. */
88+
#if MBEDTLS_ENTROPY_TRUE_SOURCES > 0
89+
#define MBEDTLS_ENTROPY_HAVE_TRUE_SOURCES
90+
#else
91+
#undef MBEDTLS_ENTROPY_HAVE_TRUE_SOURCES
92+
#endif
93+
5194
/* If MBEDTLS_PSA_CRYPTO_C is defined, make sure MBEDTLS_PSA_CRYPTO_CLIENT
5295
* is defined as well to include all PSA code.
5396
*/

thirdparty/mbedtls/include/mbedtls/ctr_drbg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,7 @@ typedef struct mbedtls_ctr_drbg_context {
186186
unsigned char MBEDTLS_PRIVATE(counter)[16]; /*!< The counter (V). */
187187
int MBEDTLS_PRIVATE(reseed_counter); /*!< The reseed counter.
188188
* This is the number of requests that have
189-
* been made since the last (re)seeding,
190-
* minus one.
189+
* been made since the last (re)seeding.
191190
* Before the initial seeding, this field
192191
* contains the amount of entropy in bytes
193192
* to use as a nonce for the initial seeding,

thirdparty/mbedtls/include/mbedtls/debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
#if defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900)
112112
#include <inttypes.h>
113113
#define MBEDTLS_PRINTF_SIZET PRIuPTR
114-
#define MBEDTLS_PRINTF_LONGLONG "I64d"
114+
#define MBEDTLS_PRINTF_LONGLONG PRId64
115115
#else \
116116
/* defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER < 1900) */
117117
#define MBEDTLS_PRINTF_SIZET "zu"

thirdparty/mbedtls/include/mbedtls/ecdh.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* The Elliptic Curve Diffie-Hellman (ECDH) protocol is an anonymous
77
* key agreement protocol allowing two parties to establish a shared
88
* secret over an insecure channel. Each party must have an
9-
* elliptic-curve publicprivate key pair.
9+
* elliptic-curve public private key pair.
1010
*
1111
* For more information, see <em>NIST SP 800-56A Rev. 2: Recommendation for
1212
* Pair-Wise Key Establishment Schemes Using Discrete Logarithm
@@ -416,6 +416,7 @@ int mbedtls_ecdh_read_public(mbedtls_ecdh_context *ctx,
416416
* Bytes written on success. This must not be \c NULL.
417417
* \param buf The buffer to write the generated shared key to. This
418418
* must be a writable buffer of size \p blen Bytes.
419+
* A sufficient size is given by #MBEDTLS_ECP_MAX_BYTES.
419420
* \param blen The length of the destination buffer \p buf in Bytes.
420421
* \param f_rng The RNG function to use. This must not be \c NULL.
421422
* \param p_rng The RNG context. This may be \c NULL if \p f_rng

0 commit comments

Comments
 (0)