Skip to content

Commit 9fcab05

Browse files
committed
mbedtls: Update to Mbed TLS 2.18.1-rc1
Update to Mbed TLS 2.18.1-rc1 and Mbed Crypto 1.1.1.
1 parent 22c82dc commit 9fcab05

File tree

9 files changed

+25
-20
lines changed

9 files changed

+25
-20
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.18.0-rc3
1+
mbedtls-2.18.1-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.18.0-rc3
30+
MBED_TLS_RELEASE ?= mbedtls-2.18.1-rc1
3131
MBED_TLS_REPO_URL ?= [email protected]:ARMmbed/mbedtls-restricted.git
3232

3333
# Translate between mbed TLS namespace and mbed namespace

features/mbedtls/inc/mbedtls/platform.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ int mbedtls_platform_set_snprintf( int (*snprintf_func)( char * s, size_t n,
256256
* the destination buffer is too short.
257257
*/
258258
#if defined(MBEDTLS_PLATFORM_HAS_NON_CONFORMING_VSNPRINTF)
259+
#include <stdarg.h>
259260
/* For Older Windows (inc. MSYS2), we provide our own fixed implementation */
260261
int mbedtls_platform_win32_vsnprintf( char *s, size_t n, const char *fmt, va_list arg );
261262
#endif

features/mbedtls/inc/mbedtls/version.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,17 +39,17 @@
3939
* Major, Minor, Patchlevel
4040
*/
4141
#define MBEDTLS_VERSION_MAJOR 2
42-
#define MBEDTLS_VERSION_MINOR 17
42+
#define MBEDTLS_VERSION_MINOR 18
4343
#define MBEDTLS_VERSION_PATCH 0
4444

4545
/**
4646
* The single version number has the following structure:
4747
* MMNNPP00
4848
* Major version | Minor version | Patch version
4949
*/
50-
#define MBEDTLS_VERSION_NUMBER 0x02110000
51-
#define MBEDTLS_VERSION_STRING "2.17.0"
52-
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.17.0"
50+
#define MBEDTLS_VERSION_NUMBER 0x02120000
51+
#define MBEDTLS_VERSION_STRING "2.18.0"
52+
#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.18.0"
5353

5454
#if defined(MBEDTLS_VERSION_C)
5555

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mbedcrypto-1.1.0d2
1+
mbedcrypto-1.1.1

features/mbedtls/mbed-crypto/importer/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
# Set the Mbed Crypto release to import (this can/should be edited before
3131
# import)
32-
CRYPTO_RELEASE ?= mbedcrypto-1.1.0d2
32+
CRYPTO_RELEASE ?= mbedcrypto-1.1.1
3333
CRYPTO_REPO_URL ?= [email protected]:ARMmbed/mbed-crypto.git
3434

3535
# Translate between Mbed Crypto namespace and Mbed OS namespace

features/mbedtls/mbed-crypto/src/ecp.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,8 +2004,10 @@ static unsigned char ecp_pick_window_size( const mbedtls_ecp_group *grp,
20042004
* Make sure w is within bounds.
20052005
* (The last test is useful only for very small curves in the test suite.)
20062006
*/
2007+
#if( MBEDTLS_ECP_WINDOW_SIZE < 6 )
20072008
if( w > MBEDTLS_ECP_WINDOW_SIZE )
20082009
w = MBEDTLS_ECP_WINDOW_SIZE;
2010+
#endif
20092011
if( w >= grp->nbits )
20102012
w = 2;
20112013

features/mbedtls/mbed-crypto/src/havege.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
#include "mbedtls/timing.h"
3939
#include "mbedtls/platform_util.h"
4040

41+
#include <stdint.h>
4142
#include <string.h>
4243

4344
/* ------------------------------------------------------------------------
@@ -54,7 +55,7 @@
5455
* ------------------------------------------------------------------------
5556
*/
5657

57-
#define SWAP(X,Y) { int *T = (X); (X) = (Y); (Y) = T; }
58+
#define SWAP(X,Y) { uint32_t *T = (X); (X) = (Y); (Y) = T; }
5859

5960
#define TST1_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1;
6061
#define TST2_ENTER if( PTEST & 1 ) { PTEST ^= 3; PTEST >>= 1;
@@ -77,7 +78,7 @@
7778
PTX = (PT1 >> 18) & 7; \
7879
PT1 &= 0x1FFF; \
7980
PT2 &= 0x1FFF; \
80-
CLK = (int) mbedtls_timing_hardclock(); \
81+
CLK = (uint32_t) mbedtls_timing_hardclock(); \
8182
\
8283
i = 0; \
8384
A = &WALK[PT1 ]; RES[i++] ^= *A; \
@@ -100,7 +101,7 @@
100101
\
101102
IN = (*A >> (5)) ^ (*A << (27)) ^ CLK; \
102103
*A = (*B >> (6)) ^ (*B << (26)) ^ CLK; \
103-
*B = IN; CLK = (int) mbedtls_timing_hardclock(); \
104+
*B = IN; CLK = (uint32_t) mbedtls_timing_hardclock(); \
104105
*C = (*C >> (7)) ^ (*C << (25)) ^ CLK; \
105106
*D = (*D >> (8)) ^ (*D << (24)) ^ CLK; \
106107
\
@@ -158,10 +159,11 @@
158159
*/
159160
static void havege_fill( mbedtls_havege_state *hs )
160161
{
161-
int i, n = 0;
162-
int U1, U2, *A, *B, *C, *D;
163-
int PT1, PT2, *WALK, RES[16];
164-
int PTX, PTY, CLK, PTEST, IN;
162+
size_t n = 0;
163+
size_t i;
164+
uint32_t U1, U2, *A, *B, *C, *D;
165+
uint32_t PT1, PT2, *WALK, RES[16];
166+
uint32_t PTX, PTY, CLK, PTEST, IN;
165167

166168
WALK = hs->WALK;
167169
PT1 = hs->PT1;
@@ -212,16 +214,16 @@ void mbedtls_havege_free( mbedtls_havege_state *hs )
212214
*/
213215
int mbedtls_havege_random( void *p_rng, unsigned char *buf, size_t len )
214216
{
215-
int val;
217+
uint32_t val;
216218
size_t use_len;
217219
mbedtls_havege_state *hs = (mbedtls_havege_state *) p_rng;
218220
unsigned char *p = buf;
219221

220222
while( len > 0 )
221223
{
222224
use_len = len;
223-
if( use_len > sizeof(int) )
224-
use_len = sizeof(int);
225+
if( use_len > sizeof( val ) )
226+
use_len = sizeof( val );
225227

226228
if( hs->offset[1] >= MBEDTLS_HAVEGE_COLLECT_SIZE )
227229
havege_fill( hs );

features/mbedtls/src/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ LOCAL_CFLAGS += -fPIC -fpic
3535
endif
3636
endif
3737

38-
SOEXT_TLS=so.12
39-
SOEXT_X509=so.0
38+
SOEXT_TLS=so.13
39+
SOEXT_X509=so.1
4040
SOEXT_CRYPTO=so.3
4141

4242
# Set AR_DASH= (empty string) to use an ar implementation that does not accept

0 commit comments

Comments
 (0)