Skip to content

Commit b233b85

Browse files
committed
Update mbedtls from 2.28.2 to 2.28.3
1 parent 0fd290d commit b233b85

File tree

216 files changed

+42411
-42032
lines changed

Some content is hidden

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

216 files changed

+42411
-42032
lines changed

vendor/mbedtls/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,8 @@ For machines with a Unix shell and OpenSSL (and optionally GnuTLS) installed, ad
190190
- `tests/scripts/depends.py` test builds in configurations with a single curve, key exchange, hash, cipher, or pkalg on.
191191
- `tests/scripts/all.sh` runs a combination of the above tests, plus some more, with various build options (such as ASan, full `config.h`, etc).
192192

193+
Instead of manually installing the required versions of all tools required for testing, it is possible to use the Docker images from our CI systems, as explained in [our testing infrastructure repository](https://github.com/Mbed-TLS/mbedtls-test/blob/master/README.md#quick-start).
194+
193195
Porting Mbed TLS
194196
----------------
195197

vendor/mbedtls/configs/config-ccm-psk-dtls1_2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
* save ROM and a few bytes of RAM by specifying our own ciphersuite list
7373
*/
7474
#define MBEDTLS_SSL_CIPHERSUITES \
75-
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
76-
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
75+
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
76+
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
7777

7878
/*
7979
* Save RAM at the expense of interoperability: do this only if you control

vendor/mbedtls/configs/config-ccm-psk-tls1_2.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@
6262
* save ROM and a few bytes of RAM by specifying our own ciphersuite list
6363
*/
6464
#define MBEDTLS_SSL_CIPHERSUITES \
65-
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
66-
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
65+
MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
66+
MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
6767

6868
/*
6969
* Save RAM at the expense of interoperability: do this only if you control

vendor/mbedtls/include/mbedtls/aes.h

Lines changed: 72 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
/** AES hardware accelerator failed. */
7373
#define MBEDTLS_ERR_AES_HW_ACCEL_FAILED -0x0025
7474

75-
#if ( defined(__ARMCC_VERSION) || defined(_MSC_VER) ) && \
75+
#if (defined(__ARMCC_VERSION) || defined(_MSC_VER)) && \
7676
!defined(inline) && !defined(__cplusplus)
7777
#define inline __inline
7878
#endif
@@ -88,8 +88,7 @@ extern "C" {
8888
/**
8989
* \brief The AES context-type definition.
9090
*/
91-
typedef struct mbedtls_aes_context
92-
{
91+
typedef struct mbedtls_aes_context {
9392
int nr; /*!< The number of rounds. */
9493
uint32_t *rk; /*!< AES round keys. */
9594
uint32_t buf[68]; /*!< Unaligned data buffer. This buffer can
@@ -107,8 +106,7 @@ mbedtls_aes_context;
107106
/**
108107
* \brief The AES XTS context-type definition.
109108
*/
110-
typedef struct mbedtls_aes_xts_context
111-
{
109+
typedef struct mbedtls_aes_xts_context {
112110
mbedtls_aes_context crypt; /*!< The AES context to use for AES block
113111
encryption or decryption. */
114112
mbedtls_aes_context tweak; /*!< The AES context used for tweak
@@ -128,7 +126,7 @@ typedef struct mbedtls_aes_xts_context
128126
*
129127
* \param ctx The AES context to initialize. This must not be \c NULL.
130128
*/
131-
void mbedtls_aes_init( mbedtls_aes_context *ctx );
129+
void mbedtls_aes_init(mbedtls_aes_context *ctx);
132130

133131
/**
134132
* \brief This function releases and clears the specified AES context.
@@ -137,7 +135,7 @@ void mbedtls_aes_init( mbedtls_aes_context *ctx );
137135
* If this is \c NULL, this function does nothing.
138136
* Otherwise, the context must have been at least initialized.
139137
*/
140-
void mbedtls_aes_free( mbedtls_aes_context *ctx );
138+
void mbedtls_aes_free(mbedtls_aes_context *ctx);
141139

142140
#if defined(MBEDTLS_CIPHER_MODE_XTS)
143141
/**
@@ -148,7 +146,7 @@ void mbedtls_aes_free( mbedtls_aes_context *ctx );
148146
*
149147
* \param ctx The AES XTS context to initialize. This must not be \c NULL.
150148
*/
151-
void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx );
149+
void mbedtls_aes_xts_init(mbedtls_aes_xts_context *ctx);
152150

153151
/**
154152
* \brief This function releases and clears the specified AES XTS context.
@@ -157,7 +155,7 @@ void mbedtls_aes_xts_init( mbedtls_aes_xts_context *ctx );
157155
* If this is \c NULL, this function does nothing.
158156
* Otherwise, the context must have been at least initialized.
159157
*/
160-
void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx );
158+
void mbedtls_aes_xts_free(mbedtls_aes_xts_context *ctx);
161159
#endif /* MBEDTLS_CIPHER_MODE_XTS */
162160

163161
/**
@@ -176,8 +174,8 @@ void mbedtls_aes_xts_free( mbedtls_aes_xts_context *ctx );
176174
* \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure.
177175
*/
178176
MBEDTLS_CHECK_RETURN_TYPICAL
179-
int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key,
180-
unsigned int keybits );
177+
int mbedtls_aes_setkey_enc(mbedtls_aes_context *ctx, const unsigned char *key,
178+
unsigned int keybits);
181179

182180
/**
183181
* \brief This function sets the decryption key.
@@ -195,8 +193,8 @@ int mbedtls_aes_setkey_enc( mbedtls_aes_context *ctx, const unsigned char *key,
195193
* \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure.
196194
*/
197195
MBEDTLS_CHECK_RETURN_TYPICAL
198-
int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key,
199-
unsigned int keybits );
196+
int mbedtls_aes_setkey_dec(mbedtls_aes_context *ctx, const unsigned char *key,
197+
unsigned int keybits);
200198

201199
#if defined(MBEDTLS_CIPHER_MODE_XTS)
202200
/**
@@ -216,9 +214,9 @@ int mbedtls_aes_setkey_dec( mbedtls_aes_context *ctx, const unsigned char *key,
216214
* \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure.
217215
*/
218216
MBEDTLS_CHECK_RETURN_TYPICAL
219-
int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx,
220-
const unsigned char *key,
221-
unsigned int keybits );
217+
int mbedtls_aes_xts_setkey_enc(mbedtls_aes_xts_context *ctx,
218+
const unsigned char *key,
219+
unsigned int keybits);
222220

223221
/**
224222
* \brief This function prepares an XTS context for decryption and
@@ -237,9 +235,9 @@ int mbedtls_aes_xts_setkey_enc( mbedtls_aes_xts_context *ctx,
237235
* \return #MBEDTLS_ERR_AES_INVALID_KEY_LENGTH on failure.
238236
*/
239237
MBEDTLS_CHECK_RETURN_TYPICAL
240-
int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx,
241-
const unsigned char *key,
242-
unsigned int keybits );
238+
int mbedtls_aes_xts_setkey_dec(mbedtls_aes_xts_context *ctx,
239+
const unsigned char *key,
240+
unsigned int keybits);
243241
#endif /* MBEDTLS_CIPHER_MODE_XTS */
244242

245243
/**
@@ -266,10 +264,10 @@ int mbedtls_aes_xts_setkey_dec( mbedtls_aes_xts_context *ctx,
266264
* \return \c 0 on success.
267265
*/
268266
MBEDTLS_CHECK_RETURN_TYPICAL
269-
int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx,
270-
int mode,
271-
const unsigned char input[16],
272-
unsigned char output[16] );
267+
int mbedtls_aes_crypt_ecb(mbedtls_aes_context *ctx,
268+
int mode,
269+
const unsigned char input[16],
270+
unsigned char output[16]);
273271

274272
#if defined(MBEDTLS_CIPHER_MODE_CBC)
275273
/**
@@ -314,12 +312,12 @@ int mbedtls_aes_crypt_ecb( mbedtls_aes_context *ctx,
314312
* on failure.
315313
*/
316314
MBEDTLS_CHECK_RETURN_TYPICAL
317-
int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
318-
int mode,
319-
size_t length,
320-
unsigned char iv[16],
321-
const unsigned char *input,
322-
unsigned char *output );
315+
int mbedtls_aes_crypt_cbc(mbedtls_aes_context *ctx,
316+
int mode,
317+
size_t length,
318+
unsigned char iv[16],
319+
const unsigned char *input,
320+
unsigned char *output);
323321
#endif /* MBEDTLS_CIPHER_MODE_CBC */
324322

325323
#if defined(MBEDTLS_CIPHER_MODE_XTS)
@@ -359,12 +357,12 @@ int mbedtls_aes_crypt_cbc( mbedtls_aes_context *ctx,
359357
* length is larger than 2^20 blocks (16 MiB).
360358
*/
361359
MBEDTLS_CHECK_RETURN_TYPICAL
362-
int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
363-
int mode,
364-
size_t length,
365-
const unsigned char data_unit[16],
366-
const unsigned char *input,
367-
unsigned char *output );
360+
int mbedtls_aes_crypt_xts(mbedtls_aes_xts_context *ctx,
361+
int mode,
362+
size_t length,
363+
const unsigned char data_unit[16],
364+
const unsigned char *input,
365+
unsigned char *output);
368366
#endif /* MBEDTLS_CIPHER_MODE_XTS */
369367

370368
#if defined(MBEDTLS_CIPHER_MODE_CFB)
@@ -408,13 +406,13 @@ int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
408406
* \return \c 0 on success.
409407
*/
410408
MBEDTLS_CHECK_RETURN_TYPICAL
411-
int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx,
412-
int mode,
413-
size_t length,
414-
size_t *iv_off,
415-
unsigned char iv[16],
416-
const unsigned char *input,
417-
unsigned char *output );
409+
int mbedtls_aes_crypt_cfb128(mbedtls_aes_context *ctx,
410+
int mode,
411+
size_t length,
412+
size_t *iv_off,
413+
unsigned char iv[16],
414+
const unsigned char *input,
415+
unsigned char *output);
418416

419417
/**
420418
* \brief This function performs an AES-CFB8 encryption or decryption
@@ -453,12 +451,12 @@ int mbedtls_aes_crypt_cfb128( mbedtls_aes_context *ctx,
453451
* \return \c 0 on success.
454452
*/
455453
MBEDTLS_CHECK_RETURN_TYPICAL
456-
int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx,
457-
int mode,
458-
size_t length,
459-
unsigned char iv[16],
460-
const unsigned char *input,
461-
unsigned char *output );
454+
int mbedtls_aes_crypt_cfb8(mbedtls_aes_context *ctx,
455+
int mode,
456+
size_t length,
457+
unsigned char iv[16],
458+
const unsigned char *input,
459+
unsigned char *output);
462460
#endif /*MBEDTLS_CIPHER_MODE_CFB */
463461

464462
#if defined(MBEDTLS_CIPHER_MODE_OFB)
@@ -508,12 +506,12 @@ int mbedtls_aes_crypt_cfb8( mbedtls_aes_context *ctx,
508506
* \return \c 0 on success.
509507
*/
510508
MBEDTLS_CHECK_RETURN_TYPICAL
511-
int mbedtls_aes_crypt_ofb( mbedtls_aes_context *ctx,
512-
size_t length,
513-
size_t *iv_off,
514-
unsigned char iv[16],
515-
const unsigned char *input,
516-
unsigned char *output );
509+
int mbedtls_aes_crypt_ofb(mbedtls_aes_context *ctx,
510+
size_t length,
511+
size_t *iv_off,
512+
unsigned char iv[16],
513+
const unsigned char *input,
514+
unsigned char *output);
517515

518516
#endif /* MBEDTLS_CIPHER_MODE_OFB */
519517

@@ -591,13 +589,13 @@ int mbedtls_aes_crypt_ofb( mbedtls_aes_context *ctx,
591589
* \return \c 0 on success.
592590
*/
593591
MBEDTLS_CHECK_RETURN_TYPICAL
594-
int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
595-
size_t length,
596-
size_t *nc_off,
597-
unsigned char nonce_counter[16],
598-
unsigned char stream_block[16],
599-
const unsigned char *input,
600-
unsigned char *output );
592+
int mbedtls_aes_crypt_ctr(mbedtls_aes_context *ctx,
593+
size_t length,
594+
size_t *nc_off,
595+
unsigned char nonce_counter[16],
596+
unsigned char stream_block[16],
597+
const unsigned char *input,
598+
unsigned char *output);
601599
#endif /* MBEDTLS_CIPHER_MODE_CTR */
602600

603601
/**
@@ -612,9 +610,9 @@ int mbedtls_aes_crypt_ctr( mbedtls_aes_context *ctx,
612610
* \return \c 0 on success.
613611
*/
614612
MBEDTLS_CHECK_RETURN_TYPICAL
615-
int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
616-
const unsigned char input[16],
617-
unsigned char output[16] );
613+
int mbedtls_internal_aes_encrypt(mbedtls_aes_context *ctx,
614+
const unsigned char input[16],
615+
unsigned char output[16]);
618616

619617
/**
620618
* \brief Internal AES block decryption function. This is only
@@ -628,9 +626,9 @@ int mbedtls_internal_aes_encrypt( mbedtls_aes_context *ctx,
628626
* \return \c 0 on success.
629627
*/
630628
MBEDTLS_CHECK_RETURN_TYPICAL
631-
int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx,
632-
const unsigned char input[16],
633-
unsigned char output[16] );
629+
int mbedtls_internal_aes_decrypt(mbedtls_aes_context *ctx,
630+
const unsigned char input[16],
631+
unsigned char output[16]);
634632

635633
#if !defined(MBEDTLS_DEPRECATED_REMOVED)
636634
#if defined(MBEDTLS_DEPRECATED_WARNING)
@@ -648,9 +646,9 @@ int mbedtls_internal_aes_decrypt( mbedtls_aes_context *ctx,
648646
* \param input Plaintext block.
649647
* \param output Output (ciphertext) block.
650648
*/
651-
MBEDTLS_DEPRECATED void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
652-
const unsigned char input[16],
653-
unsigned char output[16] );
649+
MBEDTLS_DEPRECATED void mbedtls_aes_encrypt(mbedtls_aes_context *ctx,
650+
const unsigned char input[16],
651+
unsigned char output[16]);
654652

655653
/**
656654
* \brief Deprecated internal AES block decryption function
@@ -662,9 +660,9 @@ MBEDTLS_DEPRECATED void mbedtls_aes_encrypt( mbedtls_aes_context *ctx,
662660
* \param input Ciphertext block.
663661
* \param output Output (plaintext) block.
664662
*/
665-
MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
666-
const unsigned char input[16],
667-
unsigned char output[16] );
663+
MBEDTLS_DEPRECATED void mbedtls_aes_decrypt(mbedtls_aes_context *ctx,
664+
const unsigned char input[16],
665+
unsigned char output[16]);
668666

669667
#undef MBEDTLS_DEPRECATED
670668
#endif /* !MBEDTLS_DEPRECATED_REMOVED */
@@ -678,7 +676,7 @@ MBEDTLS_DEPRECATED void mbedtls_aes_decrypt( mbedtls_aes_context *ctx,
678676
* \return \c 1 on failure.
679677
*/
680678
MBEDTLS_CHECK_RETURN_CRITICAL
681-
int mbedtls_aes_self_test( int verbose );
679+
int mbedtls_aes_self_test(int verbose);
682680

683681
#endif /* MBEDTLS_SELF_TEST */
684682

0 commit comments

Comments
 (0)