Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

key_app_writer writes invalid private key DER file #2239

Merged
merged 2 commits into from
Mar 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
mbed TLS ChangeLog (Sorted per branch, date)

= mbed TLS x.xx.x branch released xxxx-xx-xx

Bugfix
* Fix private key DER output in the key_app_writer example. File contents
were shifted by one byte, creating an invalid ASN.1 tag. Fixed by
Christian Walther in #2239.

= mbed TLS 2.14.0 branch released 2018-11-19

Security
Expand Down
2 changes: 1 addition & 1 deletion programs/pkey/key_app_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static int write_private_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