mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-29 09:54:21 +01:00
Fix bug introduced when splitting init functions
This commit is contained in:
parent
06939cebef
commit
ccc302692a
@ -74,10 +74,6 @@ int mbedtls_ccm_setkey( mbedtls_ccm_context *ctx,
|
|||||||
int ret;
|
int ret;
|
||||||
const mbedtls_cipher_info_t *cipher_info;
|
const mbedtls_cipher_info_t *cipher_info;
|
||||||
|
|
||||||
memset( ctx, 0, sizeof( mbedtls_ccm_context ) );
|
|
||||||
|
|
||||||
mbedtls_cipher_init( &ctx->cipher_ctx );
|
|
||||||
|
|
||||||
cipher_info = mbedtls_cipher_info_from_values( cipher, keysize, MBEDTLS_MODE_ECB );
|
cipher_info = mbedtls_cipher_info_from_values( cipher, keysize, MBEDTLS_MODE_ECB );
|
||||||
if( cipher_info == NULL )
|
if( cipher_info == NULL )
|
||||||
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
return( MBEDTLS_ERR_CCM_BAD_INPUT );
|
||||||
|
@ -82,7 +82,6 @@ int mbedtls_ctr_drbg_seed_entropy_len(
|
|||||||
int ret;
|
int ret;
|
||||||
unsigned char key[MBEDTLS_CTR_DRBG_KEYSIZE];
|
unsigned char key[MBEDTLS_CTR_DRBG_KEYSIZE];
|
||||||
|
|
||||||
memset( ctx, 0, sizeof(mbedtls_ctr_drbg_context) );
|
|
||||||
memset( key, 0, MBEDTLS_CTR_DRBG_KEYSIZE );
|
memset( key, 0, MBEDTLS_CTR_DRBG_KEYSIZE );
|
||||||
|
|
||||||
mbedtls_aes_init( &ctx->aes_ctx );
|
mbedtls_aes_init( &ctx->aes_ctx );
|
||||||
|
@ -167,10 +167,6 @@ int mbedtls_gcm_setkey( mbedtls_gcm_context *ctx,
|
|||||||
int ret;
|
int ret;
|
||||||
const mbedtls_cipher_info_t *cipher_info;
|
const mbedtls_cipher_info_t *cipher_info;
|
||||||
|
|
||||||
memset( ctx, 0, sizeof(mbedtls_gcm_context) );
|
|
||||||
|
|
||||||
mbedtls_cipher_init( &ctx->cipher_ctx );
|
|
||||||
|
|
||||||
cipher_info = mbedtls_cipher_info_from_values( cipher, keysize, MBEDTLS_MODE_ECB );
|
cipher_info = mbedtls_cipher_info_from_values( cipher, keysize, MBEDTLS_MODE_ECB );
|
||||||
if( cipher_info == NULL )
|
if( cipher_info == NULL )
|
||||||
return( MBEDTLS_ERR_GCM_BAD_INPUT );
|
return( MBEDTLS_ERR_GCM_BAD_INPUT );
|
||||||
|
@ -105,10 +105,6 @@ int mbedtls_hmac_drbg_seed_buf( mbedtls_hmac_drbg_context *ctx,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
memset( ctx, 0, sizeof( mbedtls_hmac_drbg_context ) );
|
|
||||||
|
|
||||||
mbedtls_md_init( &ctx->md_ctx );
|
|
||||||
|
|
||||||
if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 )
|
if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
@ -179,10 +175,6 @@ int mbedtls_hmac_drbg_seed( mbedtls_hmac_drbg_context *ctx,
|
|||||||
int ret;
|
int ret;
|
||||||
size_t entropy_len, md_size;
|
size_t entropy_len, md_size;
|
||||||
|
|
||||||
memset( ctx, 0, sizeof( mbedtls_hmac_drbg_context ) );
|
|
||||||
|
|
||||||
mbedtls_md_init( &ctx->md_ctx );
|
|
||||||
|
|
||||||
if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 )
|
if( ( ret = mbedtls_md_setup( &ctx->md_ctx, md_info, 1 ) ) != 0 )
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user