From fcc172138cdae5b454cf478c198aae80530dc4d7 Mon Sep 17 00:00:00 2001
From: Paul Bakker
Date: Fri, 11 Oct 2013 09:36:52 +0200
Subject: [PATCH] Fixed const-correctness issues
---
ChangeLog | 1 +
include/polarssl/pk.h | 2 +-
library/pkwrite.c | 2 +-
library/x509_create.c | 2 +-
4 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6f194f771..5b32ef3fc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@ Bugfix
* Missing MSVC defines added
* Compile errors with POLARSSL_RSA_NO_CRT
* Header files with 'polarssl/'
+ * Const correctness
= PolarSSL-1.3.0 released on 2013-10-01
Features
diff --git a/include/polarssl/pk.h b/include/polarssl/pk.h
index b08f5e367..251c690e5 100644
--- a/include/polarssl/pk.h
+++ b/include/polarssl/pk.h
@@ -112,7 +112,7 @@ typedef enum
typedef struct
{
pk_debug_type type;
- char *name;
+ const char *name;
void *value;
} pk_debug_item;
diff --git a/library/pkwrite.c b/library/pkwrite.c
index a3e9c5724..fcebd48d5 100644
--- a/library/pkwrite.c
+++ b/library/pkwrite.c
@@ -312,7 +312,7 @@ int pk_write_key_pem( pk_context *key, unsigned char *buf, size_t size )
{
int ret;
unsigned char output_buf[4096];
- char *begin, *end;
+ const char *begin, *end;
size_t olen = 0;
if( ( ret = pk_write_key_der( key, output_buf, sizeof(output_buf) ) ) < 0 )
diff --git a/library/x509_create.c b/library/x509_create.c
index d7a1fee9f..d3d5851e3 100644
--- a/library/x509_create.c
+++ b/library/x509_create.c
@@ -36,7 +36,7 @@ int x509_string_to_names( asn1_named_data **head, char *name )
int ret = 0;
char *s = name, *c = s;
char *end = s + strlen( s );
- char *oid = NULL;
+ const char *oid = NULL;
int in_tag = 1;
asn1_named_data *cur;