Skip to content

Commit

Permalink
Synchronize changes from 1.6 master branch [ci skip]
Browse files Browse the repository at this point in the history
6615436 Update mbedtls from 2.28.4 to 2.28.5
  • Loading branch information
github-actions[bot] committed Oct 8, 2023
2 parents 2cfe615 + 6615436 commit 072f5a6
Show file tree
Hide file tree
Showing 72 changed files with 827 additions and 297 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
* This file is part of Mbed TLS (https://tls.mbed.org)
*/

#ifndef _INTTYPES_H_VS2010
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
* This file is part of Mbed TLS (https://tls.mbed.org)
*/

#ifndef _STDBOOL_H_VS2010
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/3rdparty/everest/include/everest/x25519.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
* This file is part of Mbed TLS (https://tls.mbed.org)
*/

#ifndef MBEDTLS_X25519_H
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
* This file is part of Mbed TLS (https://tls.mbed.org)
*/

#include "common.h"
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/3rdparty/everest/library/x25519.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
* This file is part of Mbed TLS (https://tls.mbed.org)
*/

#include "common.h"
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Future releases of this library will include:
License
-------

Unless specifically indicated otherwise in a file, Mbed TLS files are provided under the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license. See the [LICENSE](LICENSE) file for the full text of this license. Contributors must accept that their contributions are made under both the Apache-2.0 AND [GPL-2.0-or-later](https://spdx.org/licenses/GPL-2.0-or-later.html) licenses. This enables LTS (Long Term Support) branches of the software to be provided under either the Apache-2.0 OR GPL-2.0-or-later licenses.
Unless specifically indicated otherwise in a file, Mbed TLS files are provided under the [Apache-2.0](https://spdx.org/licenses/Apache-2.0.html) license. See the [LICENSE](LICENSE) file for the full text of this license, and [the 'License and Copyright' section in the contributing guidelines](CONTRIBUTING.md#License-and-Copyright) for more information.

Contributing
------------
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/configs/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ them, you can pick one of the following methods:
make

Note that the second method also works if you want to keep your custom
configuration file outside the mbed TLS tree.
configuration file outside the Mbed TLS tree.
4 changes: 2 additions & 2 deletions vendor/mbedtls/configs/config-mini-tls1_1.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
#define MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_TIME

/* mbed TLS feature support */
/* Mbed TLS feature support */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_PKCS1_V15
#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
#define MBEDTLS_SSL_PROTO_TLS1_1

/* mbed TLS modules */
/* Mbed TLS modules */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
Expand Down
4 changes: 2 additions & 2 deletions vendor/mbedtls/configs/config-no-entropy.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_TIME

/* mbed TLS feature support */
/* Mbed TLS feature support */
#define MBEDTLS_CIPHER_MODE_CBC
#define MBEDTLS_CIPHER_PADDING_PKCS7
#define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
Expand All @@ -53,7 +53,7 @@
#define MBEDTLS_X509_CHECK_KEY_USAGE
#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE

/* mbed TLS modules */
/* Mbed TLS modules */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
Expand Down
4 changes: 2 additions & 2 deletions vendor/mbedtls/configs/config-suite-b.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
#define MBEDTLS_HAVE_ASM
#define MBEDTLS_HAVE_TIME

/* mbed TLS feature support */
/* Mbed TLS feature support */
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_DP_SECP384R1_ENABLED
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
#define MBEDTLS_SSL_PROTO_TLS1_2

/* mbed TLS modules */
/* Mbed TLS modules */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
Expand Down
4 changes: 2 additions & 2 deletions vendor/mbedtls/configs/config-thread.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
/* System support */
#define MBEDTLS_HAVE_ASM

/* mbed TLS feature support */
/* Mbed TLS feature support */
#define MBEDTLS_AES_ROM_TABLES
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
#define MBEDTLS_ECP_NIST_OPTIM
Expand All @@ -50,7 +50,7 @@
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
#define MBEDTLS_SSL_EXPORT_KEYS

/* mbed TLS modules */
/* Mbed TLS modules */
#define MBEDTLS_AES_C
#define MBEDTLS_ASN1_PARSE_C
#define MBEDTLS_ASN1_WRITE_C
Expand Down
21 changes: 21 additions & 0 deletions vendor/mbedtls/include/mbedtls/asn1write.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,27 @@ int mbedtls_asn1_write_algorithm_identifier(unsigned char **p,
const char *oid, size_t oid_len,
size_t par_len);

/**
* \brief Write an AlgorithmIdentifier sequence in ASN.1 format.
*
* \note This function works backwards in data buffer.
*
* \param p The reference to the current position pointer.
* \param start The start of the buffer, for bounds-checking.
* \param oid The OID of the algorithm to write.
* \param oid_len The length of the algorithm's OID.
* \param par_len The length of the parameters, which must be already written.
* \param has_par If there are any parameters. If 0, par_len must be 0. If 1
* and \p par_len is 0, NULL parameters are added.
*
* \return The number of bytes written to \p p on success.
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
*/
int mbedtls_asn1_write_algorithm_identifier_ext(unsigned char **p,
unsigned char *start,
const char *oid, size_t oid_len,
size_t par_len, int has_par);

/**
* \brief Write a boolean tag (#MBEDTLS_ASN1_BOOLEAN) and value
* in ASN.1 format.
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/include/mbedtls/check_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
*/
#include <limits.h>
#if CHAR_BIT != 8
#error "mbed TLS requires a platform with 8-bit chars"
#error "Mbed TLS requires a platform with 8-bit chars"
#endif

#if defined(_WIN32)
Expand Down
49 changes: 44 additions & 5 deletions vendor/mbedtls/include/mbedtls/cipher.h
Original file line number Diff line number Diff line change
Expand Up @@ -446,10 +446,29 @@ void mbedtls_cipher_free(mbedtls_cipher_context_t *ctx);


/**
* \brief This function initializes a cipher context for
* \brief This function prepares a cipher context for
* use with the given cipher primitive.
*
* \param ctx The context to initialize. This must be initialized.
* \warning In CBC mode, if mbedtls_cipher_set_padding_mode() is not called:
* - If MBEDTLS_CIPHER_PADDING_PKCS7 is enabled, the
* context will use PKCS7 padding.
* - Otherwise the context uses no padding and the input
* must be a whole number of blocks.
*
* \note After calling this function, you should call
* mbedtls_cipher_setkey() and, if the mode uses padding,
* mbedtls_cipher_set_padding_mode(), then for each
* message to encrypt or decrypt with this key, either:
* - mbedtls_cipher_crypt() for one-shot processing with
* non-AEAD modes;
* - mbedtls_cipher_auth_encrypt_ext() or
* mbedtls_cipher_auth_decrypt_ext() for one-shot
* processing with AEAD modes or NIST_KW;
* - for multi-part processing, see the documentation of
* mbedtls_cipher_reset().
*
* \param ctx The context to prepare. This must be initialized by
* a call to mbedtls_cipher_init() first.
* \param cipher_info The cipher to use.
*
* \return \c 0 on success.
Expand Down Expand Up @@ -663,8 +682,6 @@ int mbedtls_cipher_setkey(mbedtls_cipher_context_t *ctx,
* \brief This function sets the padding mode, for cipher modes
* that use padding.
*
* The default passing mode is PKCS7 padding.
*
* \param ctx The generic cipher context. This must be initialized and
* bound to a cipher information structure.
* \param mode The padding mode.
Expand Down Expand Up @@ -704,7 +721,29 @@ int mbedtls_cipher_set_iv(mbedtls_cipher_context_t *ctx,
/**
* \brief This function resets the cipher state.
*
* \param ctx The generic cipher context. This must be initialized.
* \note With non-AEAD ciphers, the order of calls for each message
* is as follows:
* 1. mbedtls_cipher_set_iv() if the mode uses an IV/nonce.
* 2. mbedtls_cipher_reset()
* 3. mbedtls_cipher_update() one or more times
* 4. mbedtls_cipher_finish()
* .
* This sequence can be repeated to encrypt or decrypt multiple
* messages with the same key.
*
* \note With AEAD ciphers, the order of calls for each message
* is as follows:
* 1. mbedtls_cipher_set_iv() if the mode uses an IV/nonce.
* 2. mbedtls_cipher_reset()
* 3. mbedtls_cipher_update_ad()
* 4. mbedtls_cipher_update() one or more times
* 5. mbedtls_cipher_check_tag() (for decryption) or
* mbedtls_cipher_write_tag() (for encryption).
* .
* This sequence can be repeated to encrypt or decrypt multiple
* messages with the same key.
*
* \param ctx The generic cipher context. This must be bound to a key.
*
* \return \c 0 on success.
* \return #MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA on
Expand Down
6 changes: 5 additions & 1 deletion vendor/mbedtls/include/mbedtls/cmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ extern "C" {
#define MBEDTLS_AES_BLOCK_SIZE 16
#define MBEDTLS_DES3_BLOCK_SIZE 8

#if defined(MBEDTLS_AES_C)

/* Although the CMAC module does not support ARIA or CAMELLIA, we adjust the value of
* MBEDTLS_CIPHER_BLKSIZE_MAX to reflect these ciphers.
* This is done to avoid confusion, given the general-purpose name of the macro. */
#if defined(MBEDTLS_AES_C) || defined(MBEDTLS_ARIA_C) || defined(MBEDTLS_CAMELLIA_C)
#define MBEDTLS_CIPHER_BLKSIZE_MAX 16 /**< The longest block used by CMAC is that of AES. */
#else
#define MBEDTLS_CIPHER_BLKSIZE_MAX 8 /**< The longest block used by CMAC is that of 3DES. */
Expand Down
2 changes: 1 addition & 1 deletion vendor/mbedtls/include/mbedtls/compat-1.3.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* \file compat-1.3.h
*
* \brief Compatibility definitions for using mbed TLS with client code written
* \brief Compatibility definitions for using Mbed TLS with client code written
* for the PolarSSL naming conventions.
*
* \deprecated Use the new names directly instead
Expand Down
Loading

0 comments on commit 072f5a6

Please sign in to comment.