summaryrefslogtreecommitdiffstats
path: root/crypto/x509
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-07-31 19:38:09 +0200
committerRichard Levitte <levitte@openssl.org>2016-08-04 17:02:48 +0200
commitc47ba4e96c7aa9c2f741f8c89b6440ed2c13b91c (patch)
tree0057bcd12bc5ef5437bdfde700d573f6ff2b56d7 /crypto/x509
parentcfc5e0aa739abeb8861d2127ca31addcc1149a3e (diff)
Constify some ASN1_OBJECT *obj input parameters
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/x509')
-rw-r--r--crypto/x509/x509_att.c7
-rw-r--r--crypto/x509/x509_ext.c7
-rw-r--r--crypto/x509/x509_req.c2
-rw-r--r--crypto/x509/x509_v3.c6
-rw-r--r--crypto/x509/x509name.c4
-rw-r--r--crypto/x509/x_x509a.c4
6 files changed, 15 insertions, 15 deletions
diff --git a/crypto/x509/x509_att.c b/crypto/x509/x509_att.c
index 044f80dfa9..15f0e4fc87 100644
--- a/crypto/x509/x509_att.c
+++ b/crypto/x509/x509_att.c
@@ -25,16 +25,15 @@ int X509at_get_attr_count(const STACK_OF(X509_ATTRIBUTE) *x)
int X509at_get_attr_by_NID(const STACK_OF(X509_ATTRIBUTE) *x, int nid,
int lastpos)
{
- ASN1_OBJECT *obj;
+ const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
- obj = OBJ_nid2obj(nid);
if (obj == NULL)
return (-2);
return (X509at_get_attr_by_OBJ(x, obj, lastpos));
}
int X509at_get_attr_by_OBJ(const STACK_OF(X509_ATTRIBUTE) *sk,
- ASN1_OBJECT *obj, int lastpos)
+ const ASN1_OBJECT *obj, int lastpos)
{
int n;
X509_ATTRIBUTE *ex;
@@ -151,7 +150,7 @@ STACK_OF(X509_ATTRIBUTE) *X509at_add1_attr_by_txt(STACK_OF(X509_ATTRIBUTE)
}
void *X509at_get0_data_by_OBJ(STACK_OF(X509_ATTRIBUTE) *x,
- ASN1_OBJECT *obj, int lastpos, int type)
+ const ASN1_OBJECT *obj, int lastpos, int type)
{
int i;
X509_ATTRIBUTE *at;
diff --git a/crypto/x509/x509_ext.c b/crypto/x509/x509_ext.c
index 55a95d9d3c..3bbb0a6b6c 100644
--- a/crypto/x509/x509_ext.c
+++ b/crypto/x509/x509_ext.c
@@ -27,7 +27,8 @@ int X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos)
return (X509v3_get_ext_by_NID(x->crl.extensions, nid, lastpos));
}
-int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, ASN1_OBJECT *obj, int lastpos)
+int X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj,
+ int lastpos)
{
return (X509v3_get_ext_by_OBJ(x->crl.extensions, obj, lastpos));
}
@@ -73,7 +74,7 @@ int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos)
return (X509v3_get_ext_by_NID(x->cert_info.extensions, nid, lastpos));
}
-int X509_get_ext_by_OBJ(const X509 *x, ASN1_OBJECT *obj, int lastpos)
+int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos)
{
return (X509v3_get_ext_by_OBJ(x->cert_info.extensions, obj, lastpos));
}
@@ -121,7 +122,7 @@ int X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos)
return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos));
}
-int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, ASN1_OBJECT *obj,
+int X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
int lastpos)
{
return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos));
diff --git a/crypto/x509/x509_req.c b/crypto/x509/x509_req.c
index e1d2c2002b..e7c2ae8a77 100644
--- a/crypto/x509/x509_req.c
+++ b/crypto/x509/x509_req.c
@@ -214,7 +214,7 @@ int X509_REQ_get_attr_by_NID(const X509_REQ *req, int nid, int lastpos)
return X509at_get_attr_by_NID(req->req_info.attributes, nid, lastpos);
}
-int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, ASN1_OBJECT *obj,
+int X509_REQ_get_attr_by_OBJ(const X509_REQ *req, const ASN1_OBJECT *obj,
int lastpos)
{
return X509at_get_attr_by_OBJ(req->req_info.attributes, obj, lastpos);
diff --git a/crypto/x509/x509_v3.c b/crypto/x509/x509_v3.c
index 18d1b4133e..ad126efeba 100644
--- a/crypto/x509/x509_v3.c
+++ b/crypto/x509/x509_v3.c
@@ -36,7 +36,7 @@ int X509v3_get_ext_by_NID(const STACK_OF(X509_EXTENSION) *x, int nid,
}
int X509v3_get_ext_by_OBJ(const STACK_OF(X509_EXTENSION) *sk,
- ASN1_OBJECT *obj, int lastpos)
+ const ASN1_OBJECT *obj, int lastpos)
{
int n;
X509_EXTENSION *ex;
@@ -151,7 +151,7 @@ X509_EXTENSION *X509_EXTENSION_create_by_NID(X509_EXTENSION **ex, int nid,
}
X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
- ASN1_OBJECT *obj, int crit,
+ const ASN1_OBJECT *obj, int crit,
ASN1_OCTET_STRING *data)
{
X509_EXTENSION *ret;
@@ -181,7 +181,7 @@ X509_EXTENSION *X509_EXTENSION_create_by_OBJ(X509_EXTENSION **ex,
return (NULL);
}
-int X509_EXTENSION_set_object(X509_EXTENSION *ex, ASN1_OBJECT *obj)
+int X509_EXTENSION_set_object(X509_EXTENSION *ex, const ASN1_OBJECT *obj)
{
if ((ex == NULL) || (obj == NULL))
return (0);
diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c
index 92074d323d..fa84bff434 100644
--- a/crypto/x509/x509name.c
+++ b/crypto/x509/x509name.c
@@ -26,7 +26,7 @@ int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len)
return (X509_NAME_get_text_by_OBJ(name, obj, buf, len));
}
-int X509_NAME_get_text_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, char *buf,
+int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, char *buf,
int len)
{
int i;
@@ -62,7 +62,7 @@ int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
}
/* NOTE: you should be passing -1, not 0 as lastpos */
-int X509_NAME_get_index_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int lastpos)
+int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int lastpos)
{
int n;
X509_NAME_ENTRY *ne;
diff --git a/crypto/x509/x_x509a.c b/crypto/x509/x_x509a.c
index 67b01a72a8..4c8f48e3b5 100644
--- a/crypto/x509/x_x509a.c
+++ b/crypto/x509/x_x509a.c
@@ -100,7 +100,7 @@ unsigned char *X509_keyid_get0(X509 *x, int *len)
return x->aux->keyid->data;
}
-int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj)
+int X509_add1_trust_object(X509 *x, const ASN1_OBJECT *obj)
{
X509_CERT_AUX *aux;
ASN1_OBJECT *objtmp = NULL;
@@ -121,7 +121,7 @@ int X509_add1_trust_object(X509 *x, ASN1_OBJECT *obj)
return 0;
}
-int X509_add1_reject_object(X509 *x, ASN1_OBJECT *obj)
+int X509_add1_reject_object(X509 *x, const ASN1_OBJECT *obj)
{
X509_CERT_AUX *aux;
ASN1_OBJECT *objtmp;