summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-05-30 15:35:45 +0000
committertb <>2018-05-30 15:35:45 +0000
commit590cacdf5d934adea172f307f0f00a458f99b2d9 (patch)
treea39f1ec92049ef4edf20bde709be0b740b1f4152
parenta3de66197e10139ea110e18e81ae0ed5a61c7773 (diff)
downloadopenbsd-590cacdf5d934adea172f307f0f00a458f99b2d9.tar.gz
openbsd-590cacdf5d934adea172f307f0f00a458f99b2d9.tar.bz2
openbsd-590cacdf5d934adea172f307f0f00a458f99b2d9.zip
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--src/lib/libcrypto/x509/x509.h7
-rw-r--r--src/lib/libcrypto/x509/x509name.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index 877f80eecc..29e00d7a5b 100644
--- a/src/lib/libcrypto/x509/x509.h
+++ b/src/lib/libcrypto/x509/x509.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509.h,v 1.67 2018/05/19 10:58:08 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.68 2018/05/30 15:35:45 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -1100,8 +1100,9 @@ int X509_NAME_get_text_by_OBJ(X509_NAME *name,
1100 1100
1101/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use 1101/* NOTE: you should be passsing -1, not 0 as lastpos. The functions that use
1102 * lastpos, search after that position on. */ 1102 * lastpos, search after that position on. */
1103int X509_NAME_get_index_by_NID(X509_NAME *name,int nid,int lastpos); 1103int X509_NAME_get_index_by_NID(const X509_NAME *name, int nid,
1104int X509_NAME_get_index_by_OBJ(X509_NAME *name, 1104 int lastpos);
1105int X509_NAME_get_index_by_OBJ(const X509_NAME *name,
1105 const ASN1_OBJECT *obj, int lastpos); 1106 const ASN1_OBJECT *obj, int lastpos);
1106X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc); 1107X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);
1107X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc); 1108X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *name, int loc);
diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c
index fa134a2a6a..3649d6ab7c 100644
--- a/src/lib/libcrypto/x509/x509name.c
+++ b/src/lib/libcrypto/x509/x509name.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509name.c,v 1.25 2018/05/19 10:58:08 tb Exp $ */ 1/* $OpenBSD: x509name.c,v 1.26 2018/05/30 15:35:45 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -107,7 +107,7 @@ X509_NAME_entry_count(const X509_NAME *name)
107} 107}
108 108
109int 109int
110X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos) 110X509_NAME_get_index_by_NID(const X509_NAME *name, int nid, int lastpos)
111{ 111{
112 ASN1_OBJECT *obj; 112 ASN1_OBJECT *obj;
113 113
@@ -119,7 +119,8 @@ X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos)
119 119
120/* NOTE: you should be passsing -1, not 0 as lastpos */ 120/* NOTE: you should be passsing -1, not 0 as lastpos */
121int 121int
122X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int lastpos) 122X509_NAME_get_index_by_OBJ(const X509_NAME *name, const ASN1_OBJECT *obj,
123 int lastpos)
123{ 124{
124 int n; 125 int n;
125 X509_NAME_ENTRY *ne; 126 X509_NAME_ENTRY *ne;