Skip to content

Update to Mbed TLS 2.20.0d0 and Mbed Crypto 2.1.0d0 #11687

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

Merged
merged 2 commits into from
Oct 31, 2019
Merged
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
2 changes: 1 addition & 1 deletion features/mbedtls/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mbedtls-2.19.1
mbedtls-2.20.0d0
2 changes: 1 addition & 1 deletion features/mbedtls/importer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#

# Set the mbed TLS release to import (this can/should be edited before import)
MBED_TLS_RELEASE ?= mbedtls-2.19.1
MBED_TLS_RELEASE ?= mbedtls-2.20.0d0
MBED_TLS_REPO_URL ?= git@github.com:ARMmbed/mbedtls-restricted.git

# Translate between mbed TLS namespace and mbed namespace
Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/inc/mbedtls/check_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
#endif

/* Fix the config here. Not convenient to put an #ifdef _WIN32 in config.h as
* it would confuse config.pl. */
* it would confuse config.py. */
#if !defined(MBEDTLS_PLATFORM_SNPRINTF_ALT) && \
!defined(MBEDTLS_PLATFORM_SNPRINTF_MACRO)
#define MBEDTLS_PLATFORM_SNPRINTF_ALT
Expand Down
4 changes: 2 additions & 2 deletions features/mbedtls/inc/mbedtls/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -3275,7 +3275,7 @@

/* MPI / BIGNUM options */
//#define MBEDTLS_MPI_WINDOW_SIZE 6 /**< Maximum windows size used. */
#define MBEDTLS_MPI_MAX_SIZE 512
#define MBEDTLS_MPI_MAX_SIZE 512

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

/**
* Allow SHA-1 in the default TLS configuration for TLS 1.2 handshake
Expand Down
8 changes: 4 additions & 4 deletions features/mbedtls/inc/mbedtls/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@
*/
#define MBEDTLS_VERSION_MAJOR 2
#define MBEDTLS_VERSION_MINOR 19
#define MBEDTLS_VERSION_PATCH 0
#define MBEDTLS_VERSION_PATCH 1

/**
* The single version number has the following structure:
* MMNNPP00
* Major version | Minor version | Patch version
*/
#define MBEDTLS_VERSION_NUMBER 0x02130000
#define MBEDTLS_VERSION_STRING "2.19.0"
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.19.0"
#define MBEDTLS_VERSION_NUMBER 0x02130100
#define MBEDTLS_VERSION_STRING "2.19.1"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version doesn't match the one used in other files.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which other files?

Copy link
Contributor Author

@Patater Patater Oct 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you mean the Makefiles, then yes, it doesn't match. We update version.h for official releases and not for developer releases, so in developer releases like 2.20.0d0, we see the most recently released version in version.h.

#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.19.1"

#if defined(MBEDTLS_VERSION_C)

Expand Down
2 changes: 1 addition & 1 deletion features/mbedtls/mbed-crypto/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mbedcrypto-2.0.0
mbedcrypto-2.1.0d0
2 changes: 1 addition & 1 deletion features/mbedtls/mbed-crypto/importer/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

# Set the Mbed Crypto release to import (this can/should be edited before
# import)
CRYPTO_RELEASE ?= mbedcrypto-2.0.0
CRYPTO_RELEASE ?= mbedcrypto-2.1.0d0
CRYPTO_REPO_URL ?= git@github.com:ARMmbed/mbedtls-psa.git

# Translate between Mbed Crypto namespace and Mbed OS namespace
Expand Down
233 changes: 164 additions & 69 deletions features/mbedtls/mbed-crypto/inc/mbedtls/asn1.h

Large diffs are not rendered by default.

12 changes: 9 additions & 3 deletions features/mbedtls/mbed-crypto/inc/mbedtls/asn1write.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
* \param p The reference to the current position pointer.
* \param start The start of the buffer, for bounds-checking.
* \param X The MPI to write.
* It must be non-negative.
*
* \return The number of bytes written to \p p on success.
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Expand Down Expand Up @@ -184,6 +185,7 @@ int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
* \param p The reference to the current position pointer.
* \param start The start of the buffer, for bounds-checking.
* \param val The integer value to write.
* It must be non-negative.
*
* \return The number of bytes written to \p p on success.
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
Expand Down Expand Up @@ -232,7 +234,7 @@ int mbedtls_asn1_write_printable_string( unsigned char **p,

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