mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-10 06:44:28 +00:00
gen_key should open file as binary for writing DER keys
This commit is contained in:
parent
b196fc23b1
commit
3966d71fa8
@ -146,7 +146,7 @@ static int write_private_key( pk_context *key, const char *output_file )
|
|||||||
c = output_buf + sizeof(output_buf) - len;
|
c = output_buf + sizeof(output_buf) - len;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ( f = fopen( output_file, "w" ) ) == NULL )
|
if( ( f = fopen( output_file, "wb" ) ) == NULL )
|
||||||
return( -1 );
|
return( -1 );
|
||||||
|
|
||||||
if( fwrite( c, 1, len, f ) != len )
|
if( fwrite( c, 1, len, f ) != len )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user