mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-08-01 10:06:53 +03:00
Fix LMS not checking RNG function return value
Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
@ -545,9 +545,13 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
|
|||||||
ctx->params.type = type;
|
ctx->params.type = type;
|
||||||
ctx->params.otstype = otstype;
|
ctx->params.otstype = otstype;
|
||||||
|
|
||||||
f_rng( p_rng,
|
ret = f_rng( p_rng,
|
||||||
ctx->params.I_key_identifier,
|
ctx->params.I_key_identifier,
|
||||||
MBEDTLS_LMOTS_I_KEY_ID_LEN );
|
MBEDTLS_LMOTS_I_KEY_ID_LEN );
|
||||||
|
if( ret != 0 )
|
||||||
|
{
|
||||||
|
goto exit;
|
||||||
|
}
|
||||||
|
|
||||||
ctx->ots_private_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
|
ctx->ots_private_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
|
||||||
sizeof( *ctx->ots_private_keys ) );
|
sizeof( *ctx->ots_private_keys ) );
|
||||||
|
Reference in New Issue
Block a user