summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_ext.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_ext.c')
-rw-r--r--src/lib/libcrypto/x509/x509_ext.c29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_ext.c b/src/lib/libcrypto/x509/x509_ext.c
index 1445951199..95679265c3 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.13 2021/11/01 20:53:08 tb Exp $ */ 1/* $OpenBSD: x509_ext.c,v 1.14 2022/11/14 17:48:50 beck 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 *
@@ -72,42 +72,49 @@ X509_CRL_get_ext_count(const X509_CRL *x)
72{ 72{
73 return (X509v3_get_ext_count(x->crl->extensions)); 73 return (X509v3_get_ext_count(x->crl->extensions));
74} 74}
75LCRYPTO_ALIAS(X509_CRL_get_ext_count)
75 76
76int 77int
77X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos) 78X509_CRL_get_ext_by_NID(const X509_CRL *x, int nid, int lastpos)
78{ 79{
79 return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos)); 80 return (X509v3_get_ext_by_NID(x->crl->extensions, nid, lastpos));
80} 81}
82LCRYPTO_ALIAS(X509_CRL_get_ext_by_NID)
81 83
82int 84int
83X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos) 85X509_CRL_get_ext_by_OBJ(const X509_CRL *x, const ASN1_OBJECT *obj, int lastpos)
84{ 86{
85 return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos)); 87 return (X509v3_get_ext_by_OBJ(x->crl->extensions, obj, lastpos));
86} 88}
89LCRYPTO_ALIAS(X509_CRL_get_ext_by_OBJ)
87 90
88int 91int
89X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos) 92X509_CRL_get_ext_by_critical(const X509_CRL *x, int crit, int lastpos)
90{ 93{
91 return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos)); 94 return (X509v3_get_ext_by_critical(x->crl->extensions, crit, lastpos));
92} 95}
96LCRYPTO_ALIAS(X509_CRL_get_ext_by_critical)
93 97
94X509_EXTENSION * 98X509_EXTENSION *
95X509_CRL_get_ext(const X509_CRL *x, int loc) 99X509_CRL_get_ext(const X509_CRL *x, int loc)
96{ 100{
97 return (X509v3_get_ext(x->crl->extensions, loc)); 101 return (X509v3_get_ext(x->crl->extensions, loc));
98} 102}
103LCRYPTO_ALIAS(X509_CRL_get_ext)
99 104
100X509_EXTENSION * 105X509_EXTENSION *
101X509_CRL_delete_ext(X509_CRL *x, int loc) 106X509_CRL_delete_ext(X509_CRL *x, int loc)
102{ 107{
103 return (X509v3_delete_ext(x->crl->extensions, loc)); 108 return (X509v3_delete_ext(x->crl->extensions, loc));
104} 109}
110LCRYPTO_ALIAS(X509_CRL_delete_ext)
105 111
106void * 112void *
107X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx) 113X509_CRL_get_ext_d2i(const X509_CRL *x, int nid, int *crit, int *idx)
108{ 114{
109 return X509V3_get_d2i(x->crl->extensions, nid, crit, idx); 115 return X509V3_get_d2i(x->crl->extensions, nid, crit, idx);
110} 116}
117LCRYPTO_ALIAS(X509_CRL_get_ext_d2i)
111 118
112int 119int
113X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit, 120X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
@@ -115,30 +122,35 @@ X509_CRL_add1_ext_i2d(X509_CRL *x, int nid, void *value, int crit,
115{ 122{
116 return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags); 123 return X509V3_add1_i2d(&x->crl->extensions, nid, value, crit, flags);
117} 124}
125LCRYPTO_ALIAS(X509_CRL_add1_ext_i2d)
118 126
119int 127int
120X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc) 128X509_CRL_add_ext(X509_CRL *x, X509_EXTENSION *ex, int loc)
121{ 129{
122 return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL); 130 return (X509v3_add_ext(&(x->crl->extensions), ex, loc) != NULL);
123} 131}
132LCRYPTO_ALIAS(X509_CRL_add_ext)
124 133
125int 134int
126X509_get_ext_count(const X509 *x) 135X509_get_ext_count(const X509 *x)
127{ 136{
128 return (X509v3_get_ext_count(x->cert_info->extensions)); 137 return (X509v3_get_ext_count(x->cert_info->extensions));
129} 138}
139LCRYPTO_ALIAS(X509_get_ext_count)
130 140
131int 141int
132X509_get_ext_by_NID(const X509 *x, int nid, int lastpos) 142X509_get_ext_by_NID(const X509 *x, int nid, int lastpos)
133{ 143{
134 return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos)); 144 return (X509v3_get_ext_by_NID(x->cert_info->extensions, nid, lastpos));
135} 145}
146LCRYPTO_ALIAS(X509_get_ext_by_NID)
136 147
137int 148int
138X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos) 149X509_get_ext_by_OBJ(const X509 *x, const ASN1_OBJECT *obj, int lastpos)
139{ 150{
140 return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos)); 151 return (X509v3_get_ext_by_OBJ(x->cert_info->extensions, obj, lastpos));
141} 152}
153LCRYPTO_ALIAS(X509_get_ext_by_OBJ)
142 154
143int 155int
144X509_get_ext_by_critical(const X509 *x, int crit, int lastpos) 156X509_get_ext_by_critical(const X509 *x, int crit, int lastpos)
@@ -146,30 +158,35 @@ X509_get_ext_by_critical(const X509 *x, int crit, int lastpos)
146 return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit, 158 return (X509v3_get_ext_by_critical(x->cert_info->extensions, crit,
147 lastpos)); 159 lastpos));
148} 160}
161LCRYPTO_ALIAS(X509_get_ext_by_critical)
149 162
150X509_EXTENSION * 163X509_EXTENSION *
151X509_get_ext(const X509 *x, int loc) 164X509_get_ext(const X509 *x, int loc)
152{ 165{
153 return (X509v3_get_ext(x->cert_info->extensions, loc)); 166 return (X509v3_get_ext(x->cert_info->extensions, loc));
154} 167}
168LCRYPTO_ALIAS(X509_get_ext)
155 169
156X509_EXTENSION * 170X509_EXTENSION *
157X509_delete_ext(X509 *x, int loc) 171X509_delete_ext(X509 *x, int loc)
158{ 172{
159 return (X509v3_delete_ext(x->cert_info->extensions, loc)); 173 return (X509v3_delete_ext(x->cert_info->extensions, loc));
160} 174}
175LCRYPTO_ALIAS(X509_delete_ext)
161 176
162int 177int
163X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc) 178X509_add_ext(X509 *x, X509_EXTENSION *ex, int loc)
164{ 179{
165 return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL); 180 return (X509v3_add_ext(&(x->cert_info->extensions), ex, loc) != NULL);
166} 181}
182LCRYPTO_ALIAS(X509_add_ext)
167 183
168void * 184void *
169X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx) 185X509_get_ext_d2i(const X509 *x, int nid, int *crit, int *idx)
170{ 186{
171 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx); 187 return X509V3_get_d2i(x->cert_info->extensions, nid, crit, idx);
172} 188}
189LCRYPTO_ALIAS(X509_get_ext_d2i)
173 190
174int 191int
175X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags) 192X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags)
@@ -177,18 +194,21 @@ X509_add1_ext_i2d(X509 *x, int nid, void *value, int crit, unsigned long flags)
177 return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit, 194 return X509V3_add1_i2d(&x->cert_info->extensions, nid, value, crit,
178 flags); 195 flags);
179} 196}
197LCRYPTO_ALIAS(X509_add1_ext_i2d)
180 198
181int 199int
182X509_REVOKED_get_ext_count(const X509_REVOKED *x) 200X509_REVOKED_get_ext_count(const X509_REVOKED *x)
183{ 201{
184 return (X509v3_get_ext_count(x->extensions)); 202 return (X509v3_get_ext_count(x->extensions));
185} 203}
204LCRYPTO_ALIAS(X509_REVOKED_get_ext_count)
186 205
187int 206int
188X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos) 207X509_REVOKED_get_ext_by_NID(const X509_REVOKED *x, int nid, int lastpos)
189{ 208{
190 return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos)); 209 return (X509v3_get_ext_by_NID(x->extensions, nid, lastpos));
191} 210}
211LCRYPTO_ALIAS(X509_REVOKED_get_ext_by_NID)
192 212
193int 213int
194X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj, 214X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
@@ -196,36 +216,42 @@ X509_REVOKED_get_ext_by_OBJ(const X509_REVOKED *x, const ASN1_OBJECT *obj,
196{ 216{
197 return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos)); 217 return (X509v3_get_ext_by_OBJ(x->extensions, obj, lastpos));
198} 218}
219LCRYPTO_ALIAS(X509_REVOKED_get_ext_by_OBJ)
199 220
200int 221int
201X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, int lastpos) 222X509_REVOKED_get_ext_by_critical(const X509_REVOKED *x, int crit, int lastpos)
202{ 223{
203 return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos)); 224 return (X509v3_get_ext_by_critical(x->extensions, crit, lastpos));
204} 225}
226LCRYPTO_ALIAS(X509_REVOKED_get_ext_by_critical)
205 227
206X509_EXTENSION * 228X509_EXTENSION *
207X509_REVOKED_get_ext(const X509_REVOKED *x, int loc) 229X509_REVOKED_get_ext(const X509_REVOKED *x, int loc)
208{ 230{
209 return (X509v3_get_ext(x->extensions, loc)); 231 return (X509v3_get_ext(x->extensions, loc));
210} 232}
233LCRYPTO_ALIAS(X509_REVOKED_get_ext)
211 234
212X509_EXTENSION * 235X509_EXTENSION *
213X509_REVOKED_delete_ext(X509_REVOKED *x, int loc) 236X509_REVOKED_delete_ext(X509_REVOKED *x, int loc)
214{ 237{
215 return (X509v3_delete_ext(x->extensions, loc)); 238 return (X509v3_delete_ext(x->extensions, loc));
216} 239}
240LCRYPTO_ALIAS(X509_REVOKED_delete_ext)
217 241
218int 242int
219X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc) 243X509_REVOKED_add_ext(X509_REVOKED *x, X509_EXTENSION *ex, int loc)
220{ 244{
221 return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL); 245 return (X509v3_add_ext(&(x->extensions), ex, loc) != NULL);
222} 246}
247LCRYPTO_ALIAS(X509_REVOKED_add_ext)
223 248
224void * 249void *
225X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx) 250X509_REVOKED_get_ext_d2i(const X509_REVOKED *x, int nid, int *crit, int *idx)
226{ 251{
227 return X509V3_get_d2i(x->extensions, nid, crit, idx); 252 return X509V3_get_d2i(x->extensions, nid, crit, idx);
228} 253}
254LCRYPTO_ALIAS(X509_REVOKED_get_ext_d2i)
229 255
230int 256int
231X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit, 257X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
@@ -233,3 +259,4 @@ X509_REVOKED_add1_ext_i2d(X509_REVOKED *x, int nid, void *value, int crit,
233{ 259{
234 return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags); 260 return X509V3_add1_i2d(&x->extensions, nid, value, crit, flags);
235} 261}
262LCRYPTO_ALIAS(X509_REVOKED_add1_ext_i2d)