From 3c38f29a615a6da97088332d71883e4a617088f3 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Fri, 13 Jun 2014 17:37:46 +0200
Subject: [PATCH] Fix DER output of gen_key app (found by Gergely Budai)
---
ChangeLog | 1 +
programs/pkey/gen_key.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 110398ec2..4b266d572 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,7 @@ Bugfix
* Other minor issues (found by Peter Vaskovic)
* Fix symlink command for cross compiling with CMake (found by Andre
Heinecke)
+ * Fix DER output of gen_key app (found by Gergely Budai)
= PolarSSL 1.3.7 released on 2014-05-02
Features
diff --git a/programs/pkey/gen_key.c b/programs/pkey/gen_key.c
index 7c8efef6d..2f3ba358a 100644
--- a/programs/pkey/gen_key.c
+++ b/programs/pkey/gen_key.c
@@ -143,7 +143,7 @@ static int write_private_key( 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 )