Skip to content

Commit 0573ba5

Browse files
committed
Update Mbed Crypto to version 2.1.0d0
1 parent f2d42bf commit 0573ba5

File tree

24 files changed

+1838
-1329
lines changed

24 files changed

+1838
-1329
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mbedcrypto-2.0.0
1+
mbedcrypto-2.1.0d0

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-2.0.0
32+
CRYPTO_RELEASE ?= mbedcrypto-2.1.0d0
3333
CRYPTO_REPO_URL ?= [email protected]:ARMmbed/mbedtls-psa.git
3434

3535
# Translate between Mbed Crypto namespace and Mbed OS namespace

features/mbedtls/mbed-crypto/inc/mbedtls/asn1.h

Lines changed: 164 additions & 69 deletions
Large diffs are not rendered by default.

features/mbedtls/mbed-crypto/inc/mbedtls/asn1write.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ int mbedtls_asn1_write_raw_buffer( unsigned char **p, unsigned char *start,
100100
* \param p The reference to the current position pointer.
101101
* \param start The start of the buffer, for bounds-checking.
102102
* \param X The MPI to write.
103+
* It must be non-negative.
103104
*
104105
* \return The number of bytes written to \p p on success.
105106
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -184,6 +185,7 @@ int mbedtls_asn1_write_bool( unsigned char **p, unsigned char *start,
184185
* \param p The reference to the current position pointer.
185186
* \param start The start of the buffer, for bounds-checking.
186187
* \param val The integer value to write.
188+
* It must be non-negative.
187189
*
188190
* \return The number of bytes written to \p p on success.
189191
* \return A negative \c MBEDTLS_ERR_ASN1_XXX error code on failure.
@@ -232,7 +234,7 @@ int mbedtls_asn1_write_printable_string( unsigned char **p,
232234

233235
/**
234236
* \brief Write a UTF8 string in ASN.1 format using the UTF8String
235-
* string encoding tag (#MBEDTLS_ASN1_PRINTABLE_STRING).
237+
* string encoding tag (#MBEDTLS_ASN1_UTF8_STRING).
236238
*
237239
* \note This function works backwards in data buffer.
238240
*
@@ -332,9 +334,13 @@ int mbedtls_asn1_write_octet_string( unsigned char **p, unsigned char *start,
332334
* through (will be updated in case of a new entry).
333335
* \param oid The OID to look for.
334336
* \param oid_len The size of the OID.
335-
* \param val The data to store (can be \c NULL if you want to fill
336-
* it by hand).
337+
* \param val The associated data to store. If this is \c NULL,
338+
* no data is copied to the new or existing buffer.
337339
* \param val_len The minimum length of the data buffer needed.
340+
* If this is 0, do not allocate a buffer for the associated
341+
* data.
342+
* If the OID was already present, enlarge, shrink or free
343+
* the existing buffer to fit \p val_len.
338344
*
339345
* \return A pointer to the new / existing entry on success.
340346
* \return \c NULL if if there was a memory allocation error.

features/mbedtls/mbed-crypto/inc/mbedtls/ctr_drbg.h

Lines changed: 174 additions & 43 deletions
Large diffs are not rendered by default.

features/mbedtls/mbed-crypto/inc/mbedtls/hmac_drbg.h

Lines changed: 202 additions & 114 deletions
Large diffs are not rendered by default.

features/mbedtls/mbed-crypto/inc/mbedtls/md_internal.h

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -46,42 +46,17 @@ extern "C" {
4646
*/
4747
struct mbedtls_md_info_t
4848
{
49-
/** Digest identifier */
50-
mbedtls_md_type_t type;
51-
5249
/** Name of the message digest */
5350
const char * name;
5451

52+
/** Digest identifier */
53+
mbedtls_md_type_t type;
54+
5555
/** Output length of the digest function in bytes */
56-
int size;
56+
unsigned char size;
5757

5858
/** Block length of the digest function in bytes */
59-
int block_size;
60-
61-
/** Digest initialisation function */
62-
int (*starts_func)( void *ctx );
63-
64-
/** Digest update function */
65-
int (*update_func)( void *ctx, const unsigned char *input, size_t ilen );
66-
67-
/** Digest finalisation function */
68-
int (*finish_func)( void *ctx, unsigned char *output );
69-
70-
/** Generic digest function */
71-
int (*digest_func)( const unsigned char *input, size_t ilen,
72-
unsigned char *output );
73-
74-
/** Allocate a new context */
75-
void * (*ctx_alloc_func)( void );
76-
77-
/** Free the given context */
78-
void (*ctx_free_func)( void *ctx );
79-
80-
/** Clone state from a context */
81-
void (*clone_func)( void *dst, const void *src );
82-
83-
/** Internal use only */
84-
int (*process_func)( void *ctx, const unsigned char *input );
59+
unsigned char block_size;
8560
};
8661

8762
#if defined(MBEDTLS_MD2_C)

0 commit comments

Comments
 (0)