Skip to content

Commit e9e3040

Browse files
author
Hanno Becker
committed
Update mbed TLS to version 2.5.0-rc1
1 parent 5ebe295 commit e9e3040

File tree

21 files changed

+872
-183
lines changed

21 files changed

+872
-183
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.4.2
1+
mbedtls-2.5.0-rc1

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.4.2
30+
MBED_TLS_RELEASE ?= mbedtls-2.5.0-rc1
3131

3232
# Translate between mbed TLS namespace and mbed namespace
3333
TARGET_PREFIX:=../

features/mbedtls/inc/mbedtls/aes.h

Lines changed: 62 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
#define MBEDTLS_ERR_AES_INVALID_KEY_LENGTH -0x0020 /**< Invalid key length. */
4040
#define MBEDTLS_ERR_AES_INVALID_INPUT_LENGTH -0x0022 /**< Invalid data input length. */
4141

42+
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
43+
!defined(inline) && !defined(__cplusplus)
44+
#define inline __inline
45+
#endif
46+
4247
#if !defined(MBEDTLS_AES_ALT)
4348
// Regular implementation
4449
//
@@ -253,10 +258,12 @@ int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
253258
* \param ctx AES context
254259
* \param input Plaintext block
255260
* \param output Output (ciphertext) block
261+
*
262+
* \return 0 if successful
256263
*/
257-
void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
258-
const unsigned char input[16],
259-
unsigned char output[16] );
264+
int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
265+
const unsigned char input[16],
266+
unsigned char output[16] );
260267

261268
/**
262269
* \brief Internal AES block decryption function
@@ -266,10 +273,59 @@ void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
266273
* \param ctx AES context
267274
* \param input Ciphertext block
268275
* \param output Output (plaintext) block
276+
*
277+
* \return 0 if successful
278+
*/
279+
int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx,
280+
const unsigned char input[16],
281+
unsigned char output[16] );
282+
283+
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
284+
#if defined(MBEDTLS_DEPRECATED_WARNING)
285+
#define MBEDTLS_DEPRECATED __attribute__((deprecated))
286+
#else
287+
#define MBEDTLS_DEPRECATED
288+
#endif
289+
/**
290+
* \brief Internal AES block encryption function
291+
* (Only exposed to allow overriding it,
292+
* see MBEDTLS_AES_ENCRYPT_ALT)
293+
*
294+
* \deprecated Superseded by mbedtls_aes_encrypt_ext() in 2.5.0
295+
*
296+
* \param ctx AES context
297+
* \param input Plaintext block
298+
* \param output Output (ciphertext) block
269299
*/
270-
void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
271-
const unsigned char input[16],
272-
unsigned char output[16] );
300+
MBEDTLS_DEPRECATED static inline void mbedtls_aes_encrypt(
301+
mbedtls_aes_context *ctx,
302+
const unsigned char input[16],
303+
unsigned char output[16] )
304+
{
305+
mbedtls_internal_aes_encrypt( ctx, input, output );
306+
}
307+
308+
/**
309+
* \brief Internal AES block decryption function
310+
* (Only exposed to allow overriding it,
311+
* see MBEDTLS_AES_DECRYPT_ALT)
312+
*
313+
* \deprecated Superseded by mbedtls_aes_decrypt_ext() in 2.5.0
314+
*
315+
* \param ctx AES context
316+
* \param input Ciphertext block
317+
* \param output Output (plaintext) block
318+
*/
319+
MBEDTLS_DEPRECATED static inline void mbedtls_aes_decrypt(
320+
mbedtls_aes_context *ctx,
321+
const unsigned char input[16],
322+
unsigned char output[16] )
323+
{
324+
mbedtls_internal_aes_decrypt( ctx, input, output );
325+
}
326+
327+
#undef MBEDTLS_DEPRECATED
328+
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
273329

274330
#ifdef __cplusplus
275331
}

features/mbedtls/inc/mbedtls/check_config.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,38 @@
150150
#error "MBEDTLS_GCM_C defined, but not all prerequisites"
151151
#endif
152152

153+
#if defined(MBEDTLS_ECP_RANDOMIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
154+
#error "MBEDTLS_ECP_RANDOMIZE_JAC_ALT defined, but not all prerequisites"
155+
#endif
156+
157+
#if defined(MBEDTLS_ECP_ADD_MIXED_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
158+
#error "MBEDTLS_ECP_ADD_MIXED_ALT defined, but not all prerequisites"
159+
#endif
160+
161+
#if defined(MBEDTLS_ECP_DOUBLE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
162+
#error "MBEDTLS_ECP_DOUBLE_JAC_ALT defined, but not all prerequisites"
163+
#endif
164+
165+
#if defined(MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
166+
#error "MBEDTLS_ECP_NORMALIZE_JAC_MANY_ALT defined, but not all prerequisites"
167+
#endif
168+
169+
#if defined(MBEDTLS_ECP_NORMALIZE_JAC_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
170+
#error "MBEDTLS_ECP_NORMALIZE_JAC_ALT defined, but not all prerequisites"
171+
#endif
172+
173+
#if defined(MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
174+
#error "MBEDTLS_ECP_DOUBLE_ADD_MXZ_ALT defined, but not all prerequisites"
175+
#endif
176+
177+
#if defined(MBEDTLS_ECP_RANDOMIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
178+
#error "MBEDTLS_ECP_RANDOMIZE_MXZ_ALT defined, but not all prerequisites"
179+
#endif
180+
181+
#if defined(MBEDTLS_ECP_NORMALIZE_MXZ_ALT) && !defined(MBEDTLS_ECP_INTERNAL_ALT)
182+
#error "MBEDTLS_ECP_NORMALIZE_MXZ_ALT defined, but not all prerequisites"
183+
#endif
184+
153185
#if defined(MBEDTLS_HAVEGE_C) && !defined(MBEDTLS_TIMING_C)
154186
#error "MBEDTLS_HAVEGE_C defined, but not all prerequisites"
155187
#endif

0 commit comments

Comments
 (0)