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:
@ -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 );
|
||||
|
Reference in New Issue
Block a user