aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeden Amero <jaeden.amero@arm.com>2019-03-05 16:35:48 +0000
committerJaeden Amero <jaeden.amero@arm.com>2019-03-05 16:35:48 +0000
commiteb0195d55b21fe4dd694279ead78e34dec0ef466 (patch)
treefa7ae8db72554ec6cd6fd3c5d5427aab42e73971
parent0a9f9b20b633aa5fcf2a1a657b9497a90ef958b1 (diff)
parente0f90f65571c4862c9e33ed1bf5cfc7823625f7f (diff)
downloadmbedtls-eb0195d55b21fe4dd694279ead78e34dec0ef466.zip
mbedtls-eb0195d55b21fe4dd694279ead78e34dec0ef466.tar.gz
mbedtls-eb0195d55b21fe4dd694279ead78e34dec0ef466.tar.bz2
Merge remote-tracking branch 'origin/pr/2239' into development
* origin/pr/2239: Add ChangeLog entry Fix private DER output shifted by one byte.
-rw-r--r--ChangeLog3
-rw-r--r--programs/pkey/key_app_writer.c2
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index aa7f517..9deefa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -49,6 +49,9 @@ Bugfix
extensions in CSRs and CRTs that caused these bitstrings to not be encoded
correctly as trailing zeroes were not accounted for as unused bits in the
leading content octet. Fixes #1610.
+ * 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.
Changes
* Reduce RAM consumption during session renegotiation by not storing
diff --git a/programs/pkey/key_app_writer.c b/programs/pkey/key_app_writer.c
index 500e258..b81530c 100644
--- a/programs/pkey/key_app_writer.c
+++ b/programs/pkey/key_app_writer.c
@@ -189,7 +189,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 )