summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortb <>2018-05-18 19:28:27 +0000
committertb <>2018-05-18 19:28:27 +0000
commit8f0380c45f6d68d154c00d69c95ab79609a0cd2d (patch)
treeb0b90c4c5881d826304b70527e219a4c38b1f50c
parent6d0ad79537e2da5fef8cb4f37397db382c5b87b4 (diff)
downloadopenbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.tar.gz
openbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.tar.bz2
openbsd-8f0380c45f6d68d154c00d69c95ab79609a0cd2d.zip
Add const to the 'x' and 'obj' arguments of:
X509_get_ext(3), X509_get_ext_by_NID(3), X509_get_ext_by_OBJ(3), X509_get_ext_by_critical(3), X509_get_ext_count(3), X509_get_ext_d2i(3). tested in a bulk by sthen ok jsing
-rw-r--r--src/lib/libcrypto/x509/x509.h15
-rw-r--r--src/lib/libcrypto/x509/x509_ext.c14
2 files changed, 15 insertions, 14 deletions
diff --git a/src/lib/libcrypto/x509/x509.h b/src/lib/libcrypto/x509/x509.h
index e99e8e0238..e77d090d96 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.64 2018/05/18 19:24:08 tb Exp $ */ 1/* $OpenBSD: x509.h,v 1.65 2018/05/18 19:28:27 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 *
@@ -1140,14 +1140,15 @@ X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
1140STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x, 1140STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
1141 X509_EXTENSION *ex, int loc); 1141 X509_EXTENSION *ex, int loc);
1142 1142
1143int X509_get_ext_count(X509 *x); 1143int X509_get_ext_count(const X509 *x);
1144int X509_get_ext_by_NID(X509 *x, int nid, int lastpos); 1144int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);
1145int X509_get_ext_by_OBJ(X509 *x,ASN1_OBJECT *obj,int lastpos); 1145int X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj,
1146int X509_get_ext_by_critical(X509 *x, int crit, int lastpos); 1146 int lastpos);
1147X509_EXTENSION *X509_get_ext(X509 *x, int loc); 1147int X509_get_ext_by_critical(const X509 *x, int crit, int lastpos);
1148X509_EXTENSION *X509_get_ext(const X509 *x, int loc);
1148X509_EXTENSION *X509_delete_ext(X509 *x, int loc); 1149X509_EXTENSION *X509_delete_ext(X509 *x, int loc);
1149int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc); 1150int X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc);
1150void * X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx); 1151void * X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx);
1151int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, 1152int X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit,
1152 unsigned long flags); 1153 unsigned long flags);
1153 1154
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c
index 2903f2b7a1..21374a26e2 100644
--- a/src/lib/libcrypto/x509/x509_ext.c
+++ b/src/lib/libcrypto/x509/x509_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_ext.c,v 1.11 2018/05/18 18:37:23 tb Exp $ */ 1/* $OpenBSD: x509_ext.c,v 1.12 2018/05/18 19:28:27 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 *
@@ -121,32 +121,32 @@ X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
121} 121}
122 122
123int 123int
124X509_get_ext_count(X509 *x) 124X509_get_ext_count(const X509 *x)
125{ 125{
126 return (X509v3_get_ext_count(x->cert_info->extensions)); 126 return (X509v3_get_ext_count(x->cert_info->extensions));
127} 127}
128 128
129int 129int
130X509_get_ext_by_NID(X509 *x, int nid, int lastpos) 130X509_get_ext_by_NID(const X509 *x, int nid, int lastpos)
131{ 131{
132 return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); 132 return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos));
133} 133}
134 134
135int 135int
136X509_get_ext_by_OBJ(X509 *x, ASN1_OBJECT *obj, int lastpos) 136X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos)
137{ 137{
138 return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); 138 return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos));
139} 139}
140 140
141int 141int
142X509_get_ext_by_critical(X509 *x, int crit, int lastpos) 142X509_get_ext_by_critical(const X509 *x, int crit, int lastpos)
143{ 143{
144 return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit, 144 return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit,
145 lastpos)); 145 lastpos));
146} 146}
147 147
148X509_EXTENSION * 148X509_EXTENSION *
149X509_get_ext(X509 *x, int loc) 149X509_get_ext(const X509 *x, int loc)
150{ 150{
151 return (X509v3_get_ext(x->cert_info->extensions, loc)); 151 return (X509v3_get_ext(x->cert_info->extensions, loc));
152} 152}
@@ -164,7 +164,7 @@ X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
164} 164}
165 165
166void * 166void *
167X509_get_ext_d2i(X509 *x, int nid, int *crit, int *idx) 167X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
168{ 168{
169 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); 169 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
170} 170}