summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-06-12 11:17:50 +0200
committerRich Salz <rsalz@openssl.org>2016-06-15 13:22:38 -0400
commitfa3a84422dac112fa68eebb29d14df9c1d7acf00 (patch)
tree3a02cb8857858298ee8b31f36dfa186a7bd85cf9
parentdc423f898e7d15913d31fee311502239d4167266 (diff)
downloadopenssl-new-fa3a84422dac112fa68eebb29d14df9c1d7acf00.tar.gz
Constify some input buffers in asn1
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1215)
-rw-r--r--crypto/asn1/asn_moid.c7
-rw-r--r--crypto/asn1/asn_mstbl.c4
-rw-r--r--crypto/asn1/t_bitst.c4
-rw-r--r--include/openssl/asn1.h4
4 files changed, 10 insertions, 9 deletions
diff --git a/crypto/asn1/asn_moid.c b/crypto/asn1/asn_moid.c
index 9bffee62f7..8176b76008 100644
--- a/crypto/asn1/asn_moid.c
+++ b/crypto/asn1/asn_moid.c
@@ -18,7 +18,7 @@
/* Simple ASN1 OID module: add all objects in a given section */
-static int do_create(char *value, char *name);
+static int do_create(const char *value, const char *name);
static int oid_module_init(CONF_IMODULE *md, const CONF *cnf)
{
@@ -57,11 +57,12 @@ void ASN1_add_oid_module(void)
* shortname = some long name, 1.2.3.4
*/
-static int do_create(char *value, char *name)
+static int do_create(const char *value, const char *name)
{
int nid;
ASN1_OBJECT *oid;
- char *ln, *ostr, *p, *lntmp;
+ const char *ln, *ostr, *p;
+ char *lntmp;
p = strrchr(value, ',');
if (!p) {
ln = name;
diff --git a/crypto/asn1/asn_mstbl.c b/crypto/asn1/asn_mstbl.c
index 196dd56f06..8260939002 100644
--- a/crypto/asn1/asn_mstbl.c
+++ b/crypto/asn1/asn_mstbl.c
@@ -16,7 +16,7 @@
/* Multi string module: add table entries from a given section */
-static int do_tcreate(char *value, char *name);
+static int do_tcreate(const char *value, const char *name);
static int stbl_module_init(CONF_IMODULE *md, const CONF *cnf)
{
@@ -55,7 +55,7 @@ void ASN1_add_stable_module(void)
* n1:v1, n2:v2,... where name is "min", "max", "mask" or "flags".
*/
-static int do_tcreate(char *value, char *name)
+static int do_tcreate(const char *value, const char *name)
{
char *eptr;
int nid, i, rv = 0;
diff --git a/crypto/asn1/t_bitst.c b/crypto/asn1/t_bitst.c
index 0c3a2393ba..c0aeca4c78 100644
--- a/crypto/asn1/t_bitst.c
+++ b/crypto/asn1/t_bitst.c
@@ -30,7 +30,7 @@ int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
return 1;
}
-int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
+int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
BIT_STRING_BITNAME *tbl)
{
int bitnum;
@@ -44,7 +44,7 @@ int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
return 1;
}
-int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl)
+int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl)
{
BIT_STRING_BITNAME *bnam;
for (bnam = tbl; bnam->lname; bnam++) {
diff --git a/include/openssl/asn1.h b/include/openssl/asn1.h
index 7e2f72039f..4bae492f06 100644
--- a/include/openssl/asn1.h
+++ b/include/openssl/asn1.h
@@ -553,8 +553,8 @@ int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a,
int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
BIT_STRING_BITNAME *tbl, int indent);
-int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
-int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
+int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl);
+int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value,
BIT_STRING_BITNAME *tbl);
DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)