mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 10:55:04 +00:00
Remove handle from MD context in single hash config
This commit is contained in:
parent
1292c35c03
commit
ccb2b62f0a
|
@ -104,8 +104,10 @@ typedef int mbedtls_md_handle_t;
|
||||||
*/
|
*/
|
||||||
typedef struct mbedtls_md_context_t
|
typedef struct mbedtls_md_context_t
|
||||||
{
|
{
|
||||||
|
#if !defined(MBEDTLS_MD_SINGLE_HASH)
|
||||||
/** Information about the associated message digest. */
|
/** Information about the associated message digest. */
|
||||||
mbedtls_md_handle_t md_info;
|
mbedtls_md_handle_t md_info;
|
||||||
|
#endif
|
||||||
|
|
||||||
/** The digest-specific context. */
|
/** The digest-specific context. */
|
||||||
void *md_ctx;
|
void *md_ctx;
|
||||||
|
@ -114,11 +116,20 @@ typedef struct mbedtls_md_context_t
|
||||||
void *hmac_ctx;
|
void *hmac_ctx;
|
||||||
} mbedtls_md_context_t;
|
} mbedtls_md_context_t;
|
||||||
|
|
||||||
|
#if !defined(MBEDTLS_MD_SINGLE_HASH)
|
||||||
static inline mbedtls_md_handle_t mbedtls_md_get_handle(
|
static inline mbedtls_md_handle_t mbedtls_md_get_handle(
|
||||||
struct mbedtls_md_context_t const *ctx )
|
struct mbedtls_md_context_t const *ctx )
|
||||||
{
|
{
|
||||||
return( ctx->md_info );
|
return( ctx->md_info );
|
||||||
}
|
}
|
||||||
|
#else /* !MBEDTLS_MD_SINGLE_HASH */
|
||||||
|
static inline mbedtls_md_handle_t mbedtls_md_get_handle(
|
||||||
|
struct mbedtls_md_context_t const *ctx )
|
||||||
|
{
|
||||||
|
((void) ctx);
|
||||||
|
return( MBEDTLS_MD_UNIQUE_VALID_HANDLE );
|
||||||
|
}
|
||||||
|
#endif /* !MBEDTLS_MD_SINGLE_HASH */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief This function returns the list of digests supported by the
|
* \brief This function returns the list of digests supported by the
|
||||||
|
|
|
@ -1167,7 +1167,9 @@ int mbedtls_md_setup( mbedtls_md_context_t *ctx, mbedtls_md_handle_t md_info, in
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(MBEDTLS_MD_SINGLE_HASH)
|
||||||
ctx->md_info = md_info;
|
ctx->md_info = md_info;
|
||||||
|
#endif
|
||||||
|
|
||||||
return( 0 );
|
return( 0 );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue