Skip to content

Commit c93c181

Browse files
authored
Merge pull request #11687 from Patater/update-to-mbedtls-2.20.0d0
Update to Mbed TLS 2.20.0d0 and Mbed Crypto 2.1.0d0
2 parents aba8f42 + 0573ba5 commit c93c181

31 files changed

+1881
-1353
lines changed

features/mbedtls/VERSION.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mbedtls-2.19.1
1+
mbedtls-2.20.0d0

features/mbedtls/importer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#
2828

2929
# Set the mbed TLS release to import (this can/should be edited before import)
30-
MBED_TLS_RELEASE ?= mbedtls-2.19.1
30+
MBED_TLS_RELEASE ?= mbedtls-2.20.0d0
3131
MBED_TLS_REPO_URL ?= [email protected]:ARMmbed/mbedtls-restricted.git
3232

3333
# Translate between mbed TLS namespace and mbed namespace

features/mbedtls/inc/mbedtls/check_config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#endif
4646

4747
/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
48-
* it would confuse config.pl. */
48+
* it would confuse config.py. */
4949
#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
5050
!defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
5151
#define MBEDTLS_PLATFORM_SNPRINTF_ALT

features/mbedtls/inc/mbedtls/config.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3275,7 +3275,7 @@
32753275

32763276
/* MPI / BIGNUM options */
32773277
//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
3278-
#define MBEDTLS_MPI_MAX_SIZE 512
3278+
#define MBEDTLS_MPI_MAX_SIZE 512
32793279

32803280
/* CTR_DRBG options */
32813281
//#define MBEDTLS_CTR_DRBG_ENTROPY_LEN 48 /**< Amount of entropy used per seed by default (48 with SHA-512, 32 with SHA-256) */
@@ -3534,7 +3534,7 @@
35343534
* on it, and considering stronger message digests instead.
35353535
*
35363536
*/
3537-
// #define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
3537+
//#define MBEDTLS_TLS_DEFAULT_ALLOW_SHA1_IN_CERTIFICATES
35383538

35393539
/**
35403540
* Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake

features/mbedtls/inc/mbedtls/version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@
4040
*/
4141
#define MBEDTLS_VERSION_MAJOR 2
4242
#define MBEDTLS_VERSION_MINOR 19
43-
#define MBEDTLS_VERSION_PATCH 0
43+
#define MBEDTLS_VERSION_PATCH 1
4444

4545
/**
4646
* The single version number has the following structure:
4747
* MMNNPP00
4848
* Major version | Minor version | Patch version
4949
*/
50-
#define MBEDTLS_VERSION_NUMBER 0x02130000
51-
#define MBEDTLS_VERSION_STRING "2.19.0"
52-
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.19.0"
50+
#define MBEDTLS_VERSION_NUMBER 0x02130100
51+
#define MBEDTLS_VERSION_STRING "2.19.1"
52+
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.19.1"
5353

5454
#if defined(MBEDTLS_VERSION_C)
5555

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mbedcrypto-2.0.0
1+
mbedcrypto-2.1.0d0

features/mbedtls/mbed-crypto/importer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Set the Mbed Crypto release to import (this can/should be edited before
3131
# import)
32-
CRYPTO_RELEASE ?= mbedcrypto-2.0.0
32+
CRYPTO_RELEASE ?= mbedcrypto-2.1.0d0
3333
CRYPTO_REPO_URL ?= [email protected]:ARMmbed/mbedtls-psa.git
3434

3535
# Translate between Mbed Crypto namespace and Mbed OS namespace

features/mbedtls/mbed-crypto/inc/mbedtls/asn1.h

Lines changed: 164 additions & 69 deletions
Large diffs are not rendered by default.

features/mbedtls/mbed-crypto/inc/mbedtls/asn1write.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
100100
* \param p The reference to the current position pointer.
101101
* \param start The start of the buffer, for bounds-checking.
102102
* \param X The MPI to write.
103+
* It must be non-negative.
103104
*
104105
* \return The number of bytes written to \p p on success.
105106
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -184,6 +185,7 @@ int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
184185
* \param p The reference to the current position pointer.
185186
* \param start The start of the buffer, for bounds-checking.
186187
* \param val The integer value to write.
188+
* It must be non-negative.
187189
*
188190
* \return The number of bytes written to \p p on success.
189191
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -232,7 +234,7 @@ int mbedtls_asn1_write_printable_string( unsigned char **p,
232234

233235
/**
234236
* \brief Write a UTF8 string in ASN.1 format using the UTF8String
235-
* string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING).
237+
* string encoding tag (#MBEDTLS_ASN1_UTF8_STRING).
236238
*
237239
* \note This function works backwards in data buffer.
238240
*
@@ -332,9 +334,13 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
332334
* through (will be updated in case of a new entry).
333335
* \param oid The OID to look for.
334336
* \param oid_len The size of the OID.
335-
* \param val The data to store (can be \c NULL if you want to fill
336-
* it by hand).
337+
* \param val The associated data to store. If this is \c NULL,
338+
* no data is copied to the new or existing buffer.
337339
* \param val_len The minimum length of the data buffer needed.
340+
* If this is 0, do not allocate a buffer for the associated
341+
* data.
342+
* If the OID was already present, enlarge, shrink or free
343+
* the existing buffer to fit \p val_len.
338344
*
339345
* \return A pointer to the new / existing entry on success.
340346
* \return \c NULL if if there was a memory allocation error.

0 commit comments

Comments
 (0)