commit | 3966d71fa81d1e4769de5790401bbe23774e0e33 | [log] [tgz] |
---|---|---|
author | Paul Bakker <p.j.bakker@polarssl.org> | Thu Jul 10 12:03:09 2014 +0200 |
committer | Paul Bakker <p.j.bakker@polarssl.org> | Thu Jul 10 15:27:09 2014 +0200 |
tree | 6298cb5f25c114e7da61c199d1a1187e83c9ea3f | |
parent | b196fc23b1504642493f961a4e628018da79f225 [diff] |
gen_key should open file as binary for writing DER keys
diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c index 67e3747..4cbbd0f 100644 --- a/programs/pkey/gen_key.c +++ b/programs/pkey/gen_key.c
@@ -146,7 +146,7 @@ c = output_buf + sizeof(output_buf) - len; } - if( ( f = fopen( output_file, "w" ) ) == NULL ) + if( ( f = fopen( output_file, "wb" ) ) == NULL ) return( -1 ); if( fwrite( c, 1, len, f ) != len )