Commit 279432a7 authored by Paul Bakker's avatar Paul Bakker
Browse files

- Fixed size of clean

parent 4cf2b7f8
......@@ -260,7 +260,7 @@ int cipher_init_ctx( cipher_context_t *ctx, const cipher_info_t *cipher_info )
if( NULL == cipher_info || NULL == ctx )
return POLARSSL_ERR_CIPHER_BAD_INPUT_DATA;
memset( ctx, 0, sizeof( ctx ) );
memset( ctx, 0, sizeof( cipher_context_t ) );
if( NULL == ( ctx->cipher_ctx = cipher_info->base->ctx_alloc_func() ) )
return POLARSSL_ERR_CIPHER_ALLOC_FAILED;
......
......@@ -152,11 +152,10 @@ const md_info_t *md_info_from_type( md_type_t md_type )
int md_init_ctx( md_context_t *ctx, const md_info_t *md_info )
{
if( md_info == NULL )
if( md_info == NULL || ctx == NULL )
return POLARSSL_ERR_MD_BAD_INPUT_DATA;
if( ctx == NULL || ctx->md_ctx != NULL )
return POLARSSL_ERR_MD_BAD_INPUT_DATA;
memset( ctx, 0, sizeof( md_context_t ) );
if( ( ctx->md_ctx = md_info->ctx_alloc_func() ) == NULL )
return POLARSSL_ERR_MD_ALLOC_FAILED;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment