Dynamically allocate/free restart subcontext in PK

This commit is contained in:
Manuel Pégourié-Gonnard 2017-08-18 16:22:06 +02:00
parent 15d7df2ba8
commit 0bbc66cc76
4 changed files with 108 additions and 10 deletions

View file

@ -135,7 +135,8 @@ typedef struct
*/
typedef struct
{
mbedtls_ecdsa_restart_ctx ecdsa; /* temporary */
const mbedtls_pk_info_t * pk_info; /**< Public key informations */
void * rs_ctx; /**< Underlying restart context */
} mbedtls_pk_restart_ctx;
#else
/* Now we can declare functions that take a pointer to that */

View file

@ -94,6 +94,14 @@ struct mbedtls_pk_info_t
/** Free the given context */
void (*ctx_free_func)( void *ctx );
#if defined(MBEDTLS_ECP_RESTARTABLE)
/** Allocate the restart context */
void * (*rs_alloc_func)( void );
/** Free the restart context */
void (*rs_free_func)( void *rs_ctx );
#endif /* MBEDTLS_ECP_RESTARTABLE */
/** Interface with the debug module */
void (*debug_func)( const void *ctx, mbedtls_pk_debug_item *items );