Skip to content

Commit 6e1cd9b

Browse files
authored
Merge pull request #6210 from k-stachowiak/mbed-tls-2.7.1-update
Update Mbed TLS to version 2.7.1
2 parents ed17033 + 6370a35 commit 6e1cd9b

Some content is hidden

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

138 files changed

+10569
-3574
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.6.0
1+
mbedtls-2.7.1

features/mbedtls/importer/Makefile

Lines changed: 2 additions & 2 deletions
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.6.0
30+
MBED_TLS_RELEASE ?= mbedtls-2.7.1
3131

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

3838
# mbed TLS source directory - hidden from mbed via TARGET_IGNORE
39-
MBED_TLS_URL:=https://github.com/ARMmbed/mbedtls-restricted.git
39+
MBED_TLS_URL:=git@github.com:ARMmbed/mbedtls-restricted.git
4040
MBED_TLS_DIR:=TARGET_IGNORE/mbedtls
4141
MBED_TLS_API:=$(MBED_TLS_DIR)/include/mbedtls
4242
MBED_TLS_GIT_CFG=$(MBED_TLS_DIR)/.git/config

features/mbedtls/inc/mbedtls/aes.h

Lines changed: 220 additions & 146 deletions
Large diffs are not rendered by default.

features/mbedtls/inc/mbedtls/aesni.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file aesni.h
33
*
44
* \brief AES-NI for hardware AES acceleration on some Intel processors
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*

features/mbedtls/inc/mbedtls/arc4.h

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
*
44
* \brief The ARCFOUR stream cipher
55
*
6+
* \warning ARC4 is considered a weak cipher and its use constitutes a
7+
* security risk. We recommend considering stronger ciphers instead.
8+
*/
9+
/*
610
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
711
* SPDX-License-Identifier: Apache-2.0
812
*
@@ -19,6 +23,7 @@
1923
* limitations under the License.
2024
*
2125
* This file is part of mbed TLS (https://tls.mbed.org)
26+
*
2227
*/
2328
#ifndef MBEDTLS_ARC4_H
2429
#define MBEDTLS_ARC4_H
@@ -31,6 +36,8 @@
3136

3237
#include <stddef.h>
3338

39+
#define MBEDTLS_ERR_ARC4_HW_ACCEL_FAILED -0x0019 /**< ARC4 hardware accelerator failed. */
40+
3441
#if !defined(MBEDTLS_ARC4_ALT)
3542
// Regular implementation
3643
//
@@ -40,7 +47,11 @@ extern "C" {
4047
#endif
4148

4249
/**
43-
* \brief ARC4 context structure
50+
* \brief ARC4 context structure
51+
*
52+
* \warning ARC4 is considered a weak cipher and its use constitutes a
53+
* security risk. We recommend considering stronger ciphers instead.
54+
*
4455
*/
4556
typedef struct
4657
{
@@ -54,13 +65,23 @@ mbedtls_arc4_context;
5465
* \brief Initialize ARC4 context
5566
*
5667
* \param ctx ARC4 context to be initialized
68+
*
69+
* \warning ARC4 is considered a weak cipher and its use constitutes a
70+
* security risk. We recommend considering stronger ciphers
71+
* instead.
72+
*
5773
*/
5874
void mbedtls_arc4_init( mbedtls_arc4_context *ctx );
5975

6076
/**
6177
* \brief Clear ARC4 context
6278
*
6379
* \param ctx ARC4 context to be cleared
80+
*
81+
* \warning ARC4 is considered a weak cipher and its use constitutes a
82+
* security risk. We recommend considering stronger ciphers
83+
* instead.
84+
*
6485
*/
6586
void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
6687

@@ -70,6 +91,11 @@ void mbedtls_arc4_free( mbedtls_arc4_context *ctx );
7091
* \param ctx ARC4 context to be setup
7192
* \param key the secret key
7293
* \param keylen length of the key, in bytes
94+
*
95+
* \warning ARC4 is considered a weak cipher and its use constitutes a
96+
* security risk. We recommend considering stronger ciphers
97+
* instead.
98+
*
7399
*/
74100
void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
75101
unsigned int keylen );
@@ -83,6 +109,11 @@ void mbedtls_arc4_setup( mbedtls_arc4_context *ctx, const unsigned char *key,
83109
* \param output buffer for the output data
84110
*
85111
* \return 0 if successful
112+
*
113+
* \warning ARC4 is considered a weak cipher and its use constitutes a
114+
* security risk. We recommend considering stronger ciphers
115+
* instead.
116+
*
86117
*/
87118
int mbedtls_arc4_crypt( mbedtls_arc4_context *ctx, size_t length, const unsigned char *input,
88119
unsigned char *output );
@@ -103,6 +134,11 @@ extern "C" {
103134
* \brief Checkup routine
104135
*
105136
* \return 0 if successful, or 1 if the test failed
137+
*
138+
* \warning ARC4 is considered a weak cipher and its use constitutes a
139+
* security risk. We recommend considering stronger ciphers
140+
* instead.
141+
*
106142
*/
107143
int mbedtls_arc4_self_test( int verbose );
108144

features/mbedtls/inc/mbedtls/asn1.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file asn1.h
33
*
44
* \brief Generic ASN.1 parsing
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*
@@ -59,7 +60,7 @@
5960

6061
/**
6162
* \name DER constants
62-
* These constants comply with DER encoded the ANS1 type tags.
63+
* These constants comply with the DER encoded ASN.1 type tags.
6364
* DER encoding uses hexadecimal representation.
6465
* An example DER sequence is:\n
6566
* - 0x02 -- tag indicating INTEGER

features/mbedtls/inc/mbedtls/asn1write.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file asn1write.h
33
*
44
* \brief ASN.1 buffer writing functionality
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*

features/mbedtls/inc/mbedtls/base64.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file base64.h
33
*
44
* \brief RFC 1521 base64 encoding/decoding
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*

features/mbedtls/inc/mbedtls/bignum.h

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
22
* \file bignum.h
33
*
4-
* \brief Multi-precision integer library
5-
*
4+
* \brief Multi-precision integer library
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*
@@ -70,7 +71,7 @@
7071
* Maximum size of MPIs allowed in bits and bytes for user-MPIs.
7172
* ( Default: 512 bytes => 4096 bits, Maximum tested: 2048 bytes => 16384 bits )
7273
*
73-
* Note: Calculations can results temporarily in larger MPIs. So the number
74+
* Note: Calculations can temporarily result in larger MPIs. So the number
7475
* of limbs required (MBEDTLS_MPI_MAX_LIMBS) is higher.
7576
*/
7677
#define MBEDTLS_MPI_MAX_SIZE 1024 /**< Maximum number of bytes for usable MPIs. */
@@ -683,6 +684,10 @@ int mbedtls_mpi_exp_mod( mbedtls_mpi *X, const mbedtls_mpi *A, const mbedtls_mpi
683684
*
684685
* \return 0 if successful,
685686
* MBEDTLS_ERR_MPI_ALLOC_FAILED if memory allocation failed
687+
*
688+
* \note The bytes obtained from the PRNG are interpreted
689+
* as a big-endian representation of an MPI; this can
690+
* be relevant in applications like deterministic ECDSA.
686691
*/
687692
int mbedtls_mpi_fill_random( mbedtls_mpi *X, size_t size,
688693
int (*f_rng)(void *, unsigned char *, size_t),

features/mbedtls/inc/mbedtls/blowfish.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file blowfish.h
33
*
44
* \brief Blowfish block cipher
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*
@@ -40,6 +41,7 @@
4041
#define MBEDTLS_BLOWFISH_BLOCKSIZE 8 /* Blowfish uses 64 bit blocks */
4142

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

4547
#if !defined(MBEDTLS_BLOWFISH_ALT)

features/mbedtls/inc/mbedtls/bn_mul.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
/**
22
* \file bn_mul.h
33
*
4-
* \brief Multi-precision integer library
5-
*
4+
* \brief Multi-precision integer library
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*

features/mbedtls/inc/mbedtls/camellia.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
* \file camellia.h
33
*
44
* \brief Camellia block cipher
5-
*
5+
*/
6+
/*
67
* Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
78
* SPDX-License-Identifier: Apache-2.0
89
*
@@ -37,6 +38,7 @@
3738

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

4143
#if !defined(MBEDTLS_CAMELLIA_ALT)
4244
// Regular implementation

0 commit comments

Comments
 (0)