Skip to content

Commit

Permalink
remove additional zero byte when writing pub der
Browse files Browse the repository at this point in the history
Remove `- 1` for setting location of output buffer,
which added a leading zero which cause failure in ASN1 parsing.
Fixes Mbed-TLS#1257
  • Loading branch information
Ron Eldor committed Jan 7, 2018
1 parent ec9c626 commit bb51cb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion programs/pkey/key_app_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int write_public_key( mbedtls_pk_context *key, const char *output_file )
return( ret );

len = ret;
c = output_buf + sizeof(output_buf) - len - 1;
c = output_buf + sizeof(output_buf) - len;
}

if( ( f = fopen( output_file, "w" ) ) == NULL )
Expand Down

0 comments on commit bb51cb3

Please sign in to comment.