Skip to content

Update Mbed TLS to version 2.7.1 #6210

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 3 commits into from
Mar 2, 2018
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.6.0
mbedtls-2.7.1
4 changes: 2 additions & 2 deletions 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.6.0
MBED_TLS_RELEASE ?= mbedtls-2.7.1

# Translate between mbed TLS namespace and mbed namespace
TARGET_PREFIX:=../
Expand All @@ -36,7 +36,7 @@ TARGET_INC:=$(TARGET_PREFIX)inc
TARGET_TESTS:=$(TARGET_PREFIX)TESTS

# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
MBED_TLS_URL:=https://github.com/ARMmbed/mbedtls-restricted.git
MBED_TLS_URL:=git@github.com:ARMmbed/mbedtls-restricted.git
MBED_TLS_DIR:=TARGET_IGNORE/mbedtls
MBED_TLS_API:=$(MBED_TLS_DIR)/include/mbedtls
MBED_TLS_GIT_CFG=$(MBED_TLS_DIR)/.git/config
Expand Down
366 changes: 220 additions & 146 deletions features/mbedtls/inc/mbedtls/aes.h

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion features/mbedtls/inc/mbedtls/aesni.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file aesni.h
*
* \brief AES-NI for hardware AES acceleration on some Intel processors
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
38 changes: 37 additions & 1 deletion features/mbedtls/inc/mbedtls/arc4.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
*
* \brief The ARCFOUR stream cipher
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers instead.
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand All @@ -19,6 +23,7 @@
* limitations under the License.
*
* This file is part of mbed TLS (https://tls.mbed.org)
*
*/
#ifndef MBEDTLS_ARC4_H
#define MBEDTLS_ARC4_H
Expand All @@ -31,6 +36,8 @@

#include <stddef.h>

#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */

#if !defined(MBEDTLS_ARC4_ALT)
// Regular implementation
//
Expand All @@ -40,7 +47,11 @@ extern "C" {
#endif

/**
* \brief ARC4 context structure
* \brief ARC4 context structure
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers instead.
*
*/
typedef struct
{
Expand All @@ -54,13 +65,23 @@ mbedtls_arc4_context;
* \brief Initialize ARC4 context
*
* \param ctx ARC4 context to be initialized
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers
* instead.
*
*/
void mbedtls_arc4_init( mbedtls_arc4_context *ctx );

/**
* \brief Clear ARC4 context
*
* \param ctx ARC4 context to be cleared
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers
* instead.
*
*/
void mbedtls_arc4_free( mbedtls_arc4_context *ctx );

Expand All @@ -70,6 +91,11 @@ void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
* \param ctx ARC4 context to be setup
* \param key the secret key
* \param keylen length of the key, in bytes
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers
* instead.
*
*/
void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
unsigned int keylen );
Expand All @@ -83,6 +109,11 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
* \param output buffer for the output data
*
* \return 0 if successful
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers
* instead.
*
*/
int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
unsigned char *output );
Expand All @@ -103,6 +134,11 @@ extern "C" {
* \brief Checkup routine
*
* \return 0 if successful, or 1 if the test failed
*
* \warning ARC4 is considered a weak cipher and its use constitutes a
* security risk. We recommend considering stronger ciphers
* instead.
*
*/
int mbedtls_arc4_self_test( int verbose );

Expand Down
5 changes: 3 additions & 2 deletions features/mbedtls/inc/mbedtls/asn1.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file asn1.h
*
* \brief Generic ASN.1 parsing
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -59,7 +60,7 @@

/**
* \name DER constants
* These constants comply with DER encoded the ANS1 type tags.
* These constants comply with the DER encoded ASN.1 type tags.
* DER encoding uses hexadecimal representation.
* An example DER sequence is:\n
* - 0x02 -- tag indicating INTEGER
Expand Down
3 changes: 2 additions & 1 deletion features/mbedtls/inc/mbedtls/asn1write.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file asn1write.h
*
* \brief ASN.1 buffer writing functionality
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
3 changes: 2 additions & 1 deletion features/mbedtls/inc/mbedtls/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file base64.h
*
* \brief RFC 1521 base64 encoding/decoding
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
11 changes: 8 additions & 3 deletions features/mbedtls/inc/mbedtls/bignum.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* \file bignum.h
*
* \brief Multi-precision integer library
*
* \brief Multi-precision integer library
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -70,7 +71,7 @@
* Maximum size of MPIs allowed in bits and bytes for user-MPIs.
* ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits )
*
* Note: Calculations can results temporarily in larger MPIs. So the number
* Note: Calculations can temporarily result in larger MPIs. So the number
* of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher.
*/
#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
Expand Down Expand Up @@ -683,6 +684,10 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi
*
* \return 0 if successful,
* MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed
*
* \note The bytes obtained from the PRNG are interpreted
* as a big-endian representation of an MPI; this can
* be relevant in applications like deterministic ECDSA.
*/
int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size,
int (*f_rng)(void *, unsigned char *, size_t),
Expand Down
4 changes: 3 additions & 1 deletion features/mbedtls/inc/mbedtls/blowfish.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file blowfish.h
*
* \brief Blowfish block cipher
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -40,6 +41,7 @@
#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */

#define MBEDTLS_ERR_BLOWFISH_INVALID_KEY_LENGTH -0x0016 /**< Invalid key length. */
#define MBEDTLS_ERR_BLOWFISH_HW_ACCEL_FAILED -0x0017 /**< Blowfish hardware accelerator failed. */
#define MBEDTLS_ERR_BLOWFISH_INVALID_INPUT_LENGTH -0x0018 /**< Invalid data input length. */

#if !defined(MBEDTLS_BLOWFISH_ALT)
Expand Down
5 changes: 3 additions & 2 deletions features/mbedtls/inc/mbedtls/bn_mul.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* \file bn_mul.h
*
* \brief Multi-precision integer library
*
* \brief Multi-precision integer library
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down
4 changes: 3 additions & 1 deletion features/mbedtls/inc/mbedtls/camellia.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
* \file camellia.h
*
* \brief Camellia block cipher
*
*/
/*
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
* SPDX-License-Identifier: Apache-2.0
*
Expand Down Expand Up @@ -37,6 +38,7 @@

#define MBEDTLS_ERR_CAMELLIA_INVALID_KEY_LENGTH -0x0024 /**< Invalid key length. */
#define MBEDTLS_ERR_CAMELLIA_INVALID_INPUT_LENGTH -0x0026 /**< Invalid data input length. */
#define MBEDTLS_ERR_CAMELLIA_HW_ACCEL_FAILED -0x0027 /**< Camellia hardware accelerator failed. */

#if !defined(MBEDTLS_CAMELLIA_ALT)
// Regular implementation
Expand Down
Loading