mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-25 17:25:37 +01:00
Reintroduce md_init_ctx compatibility wrapper
This commit is contained in:
parent
abb674467b
commit
147fa097e2
@ -6,7 +6,8 @@ Features
|
||||
* Support for DTLS 1.0 and 1.2 (RFC 6347).
|
||||
|
||||
API Changes
|
||||
* md_init_ctx() gained a new argument for optional hmac usage
|
||||
* md_init_ctx() is deprecated in favour of md_setup(), that adds a third
|
||||
argument (allowing memory savings if HMAC is not used)
|
||||
* Removed individual mdX_hmac and shaX_hmac functions (use generic
|
||||
md_hmac functions from md.h)
|
||||
* Change md_info_t into an opaque structure (use md_get_xxx() accessors).
|
||||
|
@ -125,6 +125,31 @@ void md_init( md_context_t *ctx );
|
||||
*/
|
||||
void md_free( md_context_t *ctx );
|
||||
|
||||
#if ! defined(POLARSSL_DEPRECATED_REMOVED)
|
||||
#if defined(POLARSSL_DEPRECATED_WARNING)
|
||||
#define DEPRECATED __attribute__((deprecated))
|
||||
#else
|
||||
#define DEPRECATED
|
||||
#endif
|
||||
/**
|
||||
* \brief Initialises and fills the message digest context structure
|
||||
* with the appropriate values.
|
||||
*
|
||||
* \deprecated Superseded by md_setup() in 2.0.0
|
||||
*
|
||||
* \param ctx context to initialise. May not be NULL. The
|
||||
* digest-specific context (ctx->md_ctx) must be NULL. It will
|
||||
* be allocated, and must be freed using md_free() later.
|
||||
* \param md_info message digest to use.
|
||||
*
|
||||
* \returns \c 0 on success, \c POLARSSL_ERR_MD_BAD_INPUT_DATA on
|
||||
* parameter failure, \c POLARSSL_ERR_MD_ALLOC_FAILED if
|
||||
* allocation of the digest-specific context failed.
|
||||
*/
|
||||
int md_init_ctx( md_context_t *ctx, const md_info_t *md_info ) DEPRECATED;
|
||||
#undef DEPRECATED
|
||||
#endif /* POLARSSL_DEPRECATED_REMOVED */
|
||||
|
||||
/**
|
||||
* \brief Initialises and fills the message digest context structure
|
||||
* with the appropriate values.
|
||||
|
@ -199,7 +199,14 @@ void md_free( md_context_t *ctx )
|
||||
polarssl_zeroize( ctx, sizeof( md_context_t ) );
|
||||
}
|
||||
|
||||
int md_setup( md_context_t *ctx, const md_info_t *md_info, int hmac )
|
||||
#if ! defined(POLARSSL_DEPRECATED_REMOVED)
|
||||
int md_init_ctx( md_context_t *ctx, const md_info_t *md_info )
|
||||
{
|
||||
return md_setup( ctx, md_info, 1 );
|
||||
}
|
||||
#endif
|
||||
|
||||
int md_setup( md_context_t *ctx, const md_info_t *md_info, int hmac )
|
||||
{
|
||||
if( md_info == NULL || ctx == NULL )
|
||||
return( POLARSSL_ERR_MD_BAD_INPUT_DATA );
|
||||
|
Loading…
Reference in New Issue
Block a user