Const-correct various X509_NAME APIs.
Half of them were marked const and half weren't.
Change-Id: Ia9135f743b06f07aafac8655ded84d01e59cf481
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/39764
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/x509/x509name.c b/crypto/x509/x509name.c
index fa621f2..fbb76f0 100644
--- a/crypto/x509/x509name.c
+++ b/crypto/x509/x509name.c
@@ -177,7 +177,7 @@
}
int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
- unsigned char *bytes, int len, int loc,
+ const unsigned char *bytes, int len, int loc,
int set)
{
X509_NAME_ENTRY *ne;
@@ -191,7 +191,7 @@
}
int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
- unsigned char *bytes, int len, int loc,
+ const unsigned char *bytes, int len, int loc,
int set)
{
X509_NAME_ENTRY *ne;
@@ -298,7 +298,8 @@
}
X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
- int type, unsigned char *bytes,
+ int type,
+ const unsigned char *bytes,
int len)
{
const ASN1_OBJECT *obj = OBJ_nid2obj(nid);
diff --git a/include/openssl/x509.h b/include/openssl/x509.h
index 438212c..7bf4923 100644
--- a/include/openssl/x509.h
+++ b/include/openssl/x509.h
@@ -959,13 +959,13 @@
OPENSSL_EXPORT int X509_NAME_add_entry(X509_NAME *name,X509_NAME_ENTRY *ne,
int loc, int set);
OPENSSL_EXPORT int X509_NAME_add_entry_by_OBJ(X509_NAME *name, ASN1_OBJECT *obj, int type,
- unsigned char *bytes, int len, int loc, int set);
+ const unsigned char *bytes, int len, int loc, int set);
OPENSSL_EXPORT int X509_NAME_add_entry_by_NID(X509_NAME *name, int nid, int type,
- unsigned char *bytes, int len, int loc, int set);
+ const unsigned char *bytes, int len, int loc, int set);
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne,
const char *field, int type, const unsigned char *bytes, int len);
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID(X509_NAME_ENTRY **ne, int nid,
- int type,unsigned char *bytes, int len);
+ int type, const unsigned char *bytes, int len);
OPENSSL_EXPORT int X509_NAME_add_entry_by_txt(X509_NAME *name, const char *field, int type,
const unsigned char *bytes, int len, int loc, int set);
OPENSSL_EXPORT X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_OBJ(X509_NAME_ENTRY **ne,