summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2018-05-30 15:35:46 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2018-05-30 15:35:46 +0000
commiteb64d832216e57f49ccc89c7ce838b2a8720766b (patch)
treeeef90341625da51e1f043873a2a9283071691e52
parentf6046734c373760cd258b99d61f991c2e0c4c85b (diff)
Add a const qualifier to the `name' argument of
X509_NAME_get_index_by_{OBJ,NID}(). tested in a bulk build by sthen suggested by & ok jsing
-rw-r--r--lib/libcrypto/x509/x509.h7
-rw-r--r--lib/libcrypto/x509/x509name.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/lib/libcrypto/x509/x509.h b/lib/libcrypto/x509/x509.h
index 877f80eeccf..29e00d7a5bb 100644
--- a/lib/libcrypto/x509/x509.h
+++ b/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.67 2018/05/19 10:58:08 tb Exp $ */
+/* $OpenBSD: x509.h,v 1.68 2018/05/30 15:35:45 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1100,8 +1100,9 @@ int X509_NAME_get_text_by_OBJ(X509_NAME *name,
/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
* lastpos, search after that position on. */
-int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos);
-int X509_NAME_get_index_by_OBJ(X509_NAME *name,
+int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid,
+ int lastpos);
+int X509_NAME_get_index_by_OBJ(const X509_NAME *name,
const ASN1_OBJECT *obj, int lastpos);
X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
diff --git a/lib/libcrypto/x509/x509name.c b/lib/libcrypto/x509/x509name.c
index fa134a2a6af..3649d6ab7cd 100644
--- a/lib/libcrypto/x509/x509name.c
+++ b/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509name.c,v 1.25 2018/05/19 10:58:08 tb Exp $ */
+/* $OpenBSD: x509name.c,v 1.26 2018/05/30 15:35:45 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -107,7 +107,7 @@ X509_NAME_entry_count(const X509_NAME *name)
}
int
-X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
+X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos)
{
ASN1_OBJECT *obj;
@@ -119,7 +119,8 @@ X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
/* NOTE: you should be passsing -1, not 0 as lastpos */
int
-X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int lastpos)
+X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
+ int lastpos)
{
int n;
X509_NAME_ENTRY *ne;