mirror of
https://github.com/ARMmbed/mbedtls.git
synced 2025-06-26 07:05:15 +08:00
Cast LMS allocation sizes to size_t
To prevent implict casting errors on 64-bit platforms Signed-off-by: Raef Coles <raef.coles@arm.com>
This commit is contained in:
parent
1310ecb389
commit
40f184c83e
@ -562,7 +562,7 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
|
|||||||
ctx->params.I_key_identifier,
|
ctx->params.I_key_identifier,
|
||||||
MBEDTLS_LMOTS_I_KEY_ID_LEN );
|
MBEDTLS_LMOTS_I_KEY_ID_LEN );
|
||||||
|
|
||||||
ctx->ots_private_keys = mbedtls_calloc( 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( mbedtls_lmots_private_t ) );
|
sizeof( mbedtls_lmots_private_t ) );
|
||||||
if( ctx->ots_private_keys == NULL )
|
if( ctx->ots_private_keys == NULL )
|
||||||
{
|
{
|
||||||
@ -570,7 +570,7 @@ int mbedtls_lms_generate_private_key( mbedtls_lms_private_t *ctx,
|
|||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx->ots_public_keys = mbedtls_calloc( MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
|
ctx->ots_public_keys = mbedtls_calloc( ( size_t )MERKLE_TREE_LEAF_NODE_AM(ctx->params.type),
|
||||||
sizeof( mbedtls_lmots_public_t ) );
|
sizeof( mbedtls_lmots_public_t ) );
|
||||||
if( ctx->ots_public_keys == NULL )
|
if( ctx->ots_public_keys == NULL )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user