1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Moved PK key writing from X509 module to PK module

This commit is contained in:
Paul Bakker
2013-09-15 14:54:56 +02:00
parent 1a7550ac67
commit c7bb02be77
13 changed files with 575 additions and 445 deletions

View File

@ -89,14 +89,14 @@ static int write_public_key( pk_context *key, const char *output_file )
if( opt.output_format == OUTPUT_FORMAT_PEM )
{
if( ( ret = x509write_pubkey_pem( key, output_buf, 16000 ) ) != 0 )
if( ( ret = pk_write_pubkey_pem( key, output_buf, 16000 ) ) != 0 )
return( ret );
len = strlen( (char *) output_buf );
}
else
{
if( ( ret = x509write_pubkey_der( key, output_buf, 16000 ) ) < 0 )
if( ( ret = pk_write_pubkey_der( key, output_buf, 16000 ) ) < 0 )
return( ret );
len = ret;
@ -125,14 +125,14 @@ static int write_private_key( pk_context *key, const char *output_file )
memset(output_buf, 0, 16000);
if( opt.output_format == OUTPUT_FORMAT_PEM )
{
if( ( ret = x509write_key_pem( key, output_buf, 16000 ) ) != 0 )
if( ( ret = pk_write_key_pem( key, output_buf, 16000 ) ) != 0 )
return( ret );
len = strlen( (char *) output_buf );
}
else
{
if( ( ret = x509write_key_der( key, output_buf, 16000 ) ) < 0 )
if( ( ret = pk_write_key_der( key, output_buf, 16000 ) ) < 0 )
return( ret );
len = ret;