1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-29 11:41:15 +03:00

Rework mbedtls_ecp_write_key to remove unnecessary output parameter

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman
2020-06-11 17:00:36 +02:00
parent e3fd39289e
commit c9b7f78647
5 changed files with 14 additions and 32 deletions

View File

@ -166,10 +166,9 @@ static int pk_write_ec_private( unsigned char **p, unsigned char *start,
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t byte_length = ( ec->grp.pbits + 7 ) / 8;
size_t output_length;
unsigned char tmp[MBEDTLS_ECP_MAX_BYTES];
ret = mbedtls_ecp_write_key( ec->grp.id, ec, &output_length, tmp, byte_length );
ret = mbedtls_ecp_write_key( ec->grp.id, ec, tmp, byte_length );
if( ret != 0 )
goto exit;
ret = mbedtls_asn1_write_octet_string( p, start, tmp, byte_length );