提交 fa3a8442 编写于 作者: F FdaSilvaYY 提交者: Rich Salz

Constify some input buffers in asn1

Reviewed-by: NKurt Roeckx <kurt@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1215)
上级 dc423f89
......@@ -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;
......
......@@ -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;
......
......@@ -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++) {
......
......@@ -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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册