summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ts/ts_rsp_utils.c
diff options
context:
space:
mode:
authorjsing <>2014-04-21 16:32:06 +0000
committerjsing <>2014-04-21 16:32:06 +0000
commitdbe50a7f3c84521e4543ad2e5292244bd0b81414 (patch)
treebe04a70e8733f1afb3ae549ad26c1c50ec666f15 /src/lib/libcrypto/ts/ts_rsp_utils.c
parent4e74c38c506a70910cb7f88175f2f718983bbdc6 (diff)
downloadopenbsd-dbe50a7f3c84521e4543ad2e5292244bd0b81414.tar.gz
openbsd-dbe50a7f3c84521e4543ad2e5292244bd0b81414.tar.bz2
openbsd-dbe50a7f3c84521e4543ad2e5292244bd0b81414.zip
KNF.
Diffstat (limited to 'src/lib/libcrypto/ts/ts_rsp_utils.c')
-rw-r--r--src/lib/libcrypto/ts/ts_rsp_utils.c358
1 files changed, 192 insertions, 166 deletions
diff --git a/src/lib/libcrypto/ts/ts_rsp_utils.c b/src/lib/libcrypto/ts/ts_rsp_utils.c
index 401c1fdc51..89c3e8f63c 100644
--- a/src/lib/libcrypto/ts/ts_rsp_utils.c
+++ b/src/lib/libcrypto/ts/ts_rsp_utils.c
@@ -10,7 +10,7 @@
10 * are met: 10 * are met:
11 * 11 *
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 14 *
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in 16 * notice, this list of conditions and the following disclaimer in
@@ -64,346 +64,372 @@
64 64
65/* Function definitions. */ 65/* Function definitions. */
66 66
67int TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info) 67int
68 { 68TS_RESP_set_status_info(TS_RESP *a, TS_STATUS_INFO *status_info)
69{
69 TS_STATUS_INFO *new_status_info; 70 TS_STATUS_INFO *new_status_info;
70 71
71 if (a->status_info == status_info) 72 if (a->status_info == status_info)
72 return 1; 73 return 1;
73 new_status_info = TS_STATUS_INFO_dup(status_info); 74 new_status_info = TS_STATUS_INFO_dup(status_info);
74 if (new_status_info == NULL) 75 if (new_status_info == NULL) {
75 {
76 TSerr(TS_F_TS_RESP_SET_STATUS_INFO, ERR_R_MALLOC_FAILURE); 76 TSerr(TS_F_TS_RESP_SET_STATUS_INFO, ERR_R_MALLOC_FAILURE);
77 return 0; 77 return 0;
78 } 78 }
79 TS_STATUS_INFO_free(a->status_info); 79 TS_STATUS_INFO_free(a->status_info);
80 a->status_info = new_status_info; 80 a->status_info = new_status_info;
81 81
82 return 1; 82 return 1;
83 } 83}
84 84
85TS_STATUS_INFO *TS_RESP_get_status_info(TS_RESP *a) 85TS_STATUS_INFO *
86 { 86TS_RESP_get_status_info(TS_RESP *a)
87{
87 return a->status_info; 88 return a->status_info;
88 } 89}
89 90
90/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */ 91/* Caller loses ownership of PKCS7 and TS_TST_INFO objects. */
91void TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info) 92void
92 { 93TS_RESP_set_tst_info(TS_RESP *a, PKCS7 *p7, TS_TST_INFO *tst_info)
94{
93 /* Set new PKCS7 and TST_INFO objects. */ 95 /* Set new PKCS7 and TST_INFO objects. */
94 PKCS7_free(a->token); 96 PKCS7_free(a->token);
95 a->token = p7; 97 a->token = p7;
96 TS_TST_INFO_free(a->tst_info); 98 TS_TST_INFO_free(a->tst_info);
97 a->tst_info = tst_info; 99 a->tst_info = tst_info;
98 } 100}
99 101
100PKCS7 *TS_RESP_get_token(TS_RESP *a) 102PKCS7 *
101 { 103TS_RESP_get_token(TS_RESP *a)
104{
102 return a->token; 105 return a->token;
103 } 106}
104 107
105TS_TST_INFO *TS_RESP_get_tst_info(TS_RESP *a) 108TS_TST_INFO *
106 { 109TS_RESP_get_tst_info(TS_RESP *a)
110{
107 return a->tst_info; 111 return a->tst_info;
108 } 112}
109 113
110int TS_TST_INFO_set_version(TS_TST_INFO *a, long version) 114int
111 { 115TS_TST_INFO_set_version(TS_TST_INFO *a, long version)
116{
112 return ASN1_INTEGER_set(a->version, version); 117 return ASN1_INTEGER_set(a->version, version);
113 } 118}
114 119
115long TS_TST_INFO_get_version(const TS_TST_INFO *a) 120long
116 { 121TS_TST_INFO_get_version(const TS_TST_INFO *a)
122{
117 return ASN1_INTEGER_get(a->version); 123 return ASN1_INTEGER_get(a->version);
118 } 124}
119 125
120int TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy) 126int
121 { 127TS_TST_INFO_set_policy_id(TS_TST_INFO *a, ASN1_OBJECT *policy)
128{
122 ASN1_OBJECT *new_policy; 129 ASN1_OBJECT *new_policy;
123 130
124 if (a->policy_id == policy) 131 if (a->policy_id == policy)
125 return 1; 132 return 1;
126 new_policy = OBJ_dup(policy); 133 new_policy = OBJ_dup(policy);
127 if (new_policy == NULL) 134 if (new_policy == NULL) {
128 {
129 TSerr(TS_F_TS_TST_INFO_SET_POLICY_ID, ERR_R_MALLOC_FAILURE); 135 TSerr(TS_F_TS_TST_INFO_SET_POLICY_ID, ERR_R_MALLOC_FAILURE);
130 return 0; 136 return 0;
131 } 137 }
132 ASN1_OBJECT_free(a->policy_id); 138 ASN1_OBJECT_free(a->policy_id);
133 a->policy_id = new_policy; 139 a->policy_id = new_policy;
134 return 1; 140 return 1;
135 } 141}
136 142
137ASN1_OBJECT *TS_TST_INFO_get_policy_id(TS_TST_INFO *a) 143ASN1_OBJECT *
138 { 144TS_TST_INFO_get_policy_id(TS_TST_INFO *a)
145{
139 return a->policy_id; 146 return a->policy_id;
140 } 147}
141 148
142int TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint) 149int
143 { 150TS_TST_INFO_set_msg_imprint(TS_TST_INFO *a, TS_MSG_IMPRINT *msg_imprint)
151{
144 TS_MSG_IMPRINT *new_msg_imprint; 152 TS_MSG_IMPRINT *new_msg_imprint;
145 153
146 if (a->msg_imprint == msg_imprint) 154 if (a->msg_imprint == msg_imprint)
147 return 1; 155 return 1;
148 new_msg_imprint = TS_MSG_IMPRINT_dup(msg_imprint); 156 new_msg_imprint = TS_MSG_IMPRINT_dup(msg_imprint);
149 if (new_msg_imprint == NULL) 157 if (new_msg_imprint == NULL) {
150 {
151 TSerr(TS_F_TS_TST_INFO_SET_MSG_IMPRINT, ERR_R_MALLOC_FAILURE); 158 TSerr(TS_F_TS_TST_INFO_SET_MSG_IMPRINT, ERR_R_MALLOC_FAILURE);
152 return 0; 159 return 0;
153 } 160 }
154 TS_MSG_IMPRINT_free(a->msg_imprint); 161 TS_MSG_IMPRINT_free(a->msg_imprint);
155 a->msg_imprint = new_msg_imprint; 162 a->msg_imprint = new_msg_imprint;
156 return 1; 163 return 1;
157 } 164}
158 165
159TS_MSG_IMPRINT *TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a) 166TS_MSG_IMPRINT *
160 { 167TS_TST_INFO_get_msg_imprint(TS_TST_INFO *a)
168{
161 return a->msg_imprint; 169 return a->msg_imprint;
162 } 170}
163 171
164int TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial) 172int
165 { 173TS_TST_INFO_set_serial(TS_TST_INFO *a, const ASN1_INTEGER *serial)
174{
166 ASN1_INTEGER *new_serial; 175 ASN1_INTEGER *new_serial;
167 176
168 if (a->serial == serial) 177 if (a->serial == serial)
169 return 1; 178 return 1;
170 new_serial = ASN1_INTEGER_dup(serial); 179 new_serial = ASN1_INTEGER_dup(serial);
171 if (new_serial == NULL) 180 if (new_serial == NULL) {
172 {
173 TSerr(TS_F_TS_TST_INFO_SET_SERIAL, ERR_R_MALLOC_FAILURE); 181 TSerr(TS_F_TS_TST_INFO_SET_SERIAL, ERR_R_MALLOC_FAILURE);
174 return 0; 182 return 0;
175 } 183 }
176 ASN1_INTEGER_free(a->serial); 184 ASN1_INTEGER_free(a->serial);
177 a->serial = new_serial; 185 a->serial = new_serial;
178 return 1; 186 return 1;
179 } 187}
180 188
181const ASN1_INTEGER *TS_TST_INFO_get_serial(const TS_TST_INFO *a) 189const ASN1_INTEGER *
182 { 190TS_TST_INFO_get_serial(const TS_TST_INFO *a)
191{
183 return a->serial; 192 return a->serial;
184 } 193}
185 194
186int TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime) 195int
187 { 196TS_TST_INFO_set_time(TS_TST_INFO *a, const ASN1_GENERALIZEDTIME *gtime)
197{
188 ASN1_GENERALIZEDTIME *new_time; 198 ASN1_GENERALIZEDTIME *new_time;
189 199
190 if (a->time == gtime) 200 if (a->time == gtime)
191 return 1; 201 return 1;
192 new_time = M_ASN1_GENERALIZEDTIME_dup(gtime); 202 new_time = M_ASN1_GENERALIZEDTIME_dup(gtime);
193 if (new_time == NULL) 203 if (new_time == NULL) {
194 {
195 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE); 204 TSerr(TS_F_TS_TST_INFO_SET_TIME, ERR_R_MALLOC_FAILURE);
196 return 0; 205 return 0;
197 } 206 }
198 ASN1_GENERALIZEDTIME_free(a->time); 207 ASN1_GENERALIZEDTIME_free(a->time);
199 a->time = new_time; 208 a->time = new_time;
200 return 1; 209 return 1;
201 } 210}
202 211
203const ASN1_GENERALIZEDTIME *TS_TST_INFO_get_time(const TS_TST_INFO *a) 212const ASN1_GENERALIZEDTIME *
204 { 213TS_TST_INFO_get_time(const TS_TST_INFO *a)
214{
205 return a->time; 215 return a->time;
206 } 216}
207 217
208int TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy) 218int
209 { 219TS_TST_INFO_set_accuracy(TS_TST_INFO *a, TS_ACCURACY *accuracy)
220{
210 TS_ACCURACY *new_accuracy; 221 TS_ACCURACY *new_accuracy;
211 222
212 if (a->accuracy == accuracy) 223 if (a->accuracy == accuracy)
213 return 1; 224 return 1;
214 new_accuracy = TS_ACCURACY_dup(accuracy); 225 new_accuracy = TS_ACCURACY_dup(accuracy);
215 if (new_accuracy == NULL) 226 if (new_accuracy == NULL) {
216 {
217 TSerr(TS_F_TS_TST_INFO_SET_ACCURACY, ERR_R_MALLOC_FAILURE); 227 TSerr(TS_F_TS_TST_INFO_SET_ACCURACY, ERR_R_MALLOC_FAILURE);
218 return 0; 228 return 0;
219 } 229 }
220 TS_ACCURACY_free(a->accuracy); 230 TS_ACCURACY_free(a->accuracy);
221 a->accuracy = new_accuracy; 231 a->accuracy = new_accuracy;
222 return 1; 232 return 1;
223 } 233}
224 234
225TS_ACCURACY *TS_TST_INFO_get_accuracy(TS_TST_INFO *a) 235TS_ACCURACY *
226 { 236TS_TST_INFO_get_accuracy(TS_TST_INFO *a)
237{
227 return a->accuracy; 238 return a->accuracy;
228 } 239}
229 240
230int TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds) 241int
231 { 242TS_ACCURACY_set_seconds(TS_ACCURACY *a, const ASN1_INTEGER *seconds)
243{
232 ASN1_INTEGER *new_seconds; 244 ASN1_INTEGER *new_seconds;
233 245
234 if (a->seconds == seconds) 246 if (a->seconds == seconds)
235 return 1; 247 return 1;
236 new_seconds = ASN1_INTEGER_dup(seconds); 248 new_seconds = ASN1_INTEGER_dup(seconds);
237 if (new_seconds == NULL) 249 if (new_seconds == NULL) {
238 {
239 TSerr(TS_F_TS_ACCURACY_SET_SECONDS, ERR_R_MALLOC_FAILURE); 250 TSerr(TS_F_TS_ACCURACY_SET_SECONDS, ERR_R_MALLOC_FAILURE);
240 return 0; 251 return 0;
241 } 252 }
242 ASN1_INTEGER_free(a->seconds); 253 ASN1_INTEGER_free(a->seconds);
243 a->seconds = new_seconds; 254 a->seconds = new_seconds;
244 return 1; 255 return 1;
245 } 256}
246 257
247const ASN1_INTEGER *TS_ACCURACY_get_seconds(const TS_ACCURACY *a) 258const ASN1_INTEGER *
248 { 259TS_ACCURACY_get_seconds(const TS_ACCURACY *a)
260{
249 return a->seconds; 261 return a->seconds;
250 } 262}
251 263
252int TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis) 264int
253 { 265TS_ACCURACY_set_millis(TS_ACCURACY *a, const ASN1_INTEGER *millis)
266{
254 ASN1_INTEGER *new_millis = NULL; 267 ASN1_INTEGER *new_millis = NULL;
255 268
256 if (a->millis == millis) 269 if (a->millis == millis)
257 return 1; 270 return 1;
258 if (millis != NULL) 271 if (millis != NULL) {
259 {
260 new_millis = ASN1_INTEGER_dup(millis); 272 new_millis = ASN1_INTEGER_dup(millis);
261 if (new_millis == NULL) 273 if (new_millis == NULL) {
262 { 274 TSerr(TS_F_TS_ACCURACY_SET_MILLIS,
263 TSerr(TS_F_TS_ACCURACY_SET_MILLIS, 275 ERR_R_MALLOC_FAILURE);
264 ERR_R_MALLOC_FAILURE);
265 return 0; 276 return 0;
266 }
267 } 277 }
278 }
268 ASN1_INTEGER_free(a->millis); 279 ASN1_INTEGER_free(a->millis);
269 a->millis = new_millis; 280 a->millis = new_millis;
270 return 1; 281 return 1;
271 } 282}
272 283
273const ASN1_INTEGER *TS_ACCURACY_get_millis(const TS_ACCURACY *a) 284const ASN1_INTEGER *
274 { 285TS_ACCURACY_get_millis(const TS_ACCURACY *a)
286{
275 return a->millis; 287 return a->millis;
276 } 288}
277 289
278int TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros) 290int
279 { 291TS_ACCURACY_set_micros(TS_ACCURACY *a, const ASN1_INTEGER *micros)
292{
280 ASN1_INTEGER *new_micros = NULL; 293 ASN1_INTEGER *new_micros = NULL;
281 294
282 if (a->micros == micros) 295 if (a->micros == micros)
283 return 1; 296 return 1;
284 if (micros != NULL) 297 if (micros != NULL) {
285 {
286 new_micros = ASN1_INTEGER_dup(micros); 298 new_micros = ASN1_INTEGER_dup(micros);
287 if (new_micros == NULL) 299 if (new_micros == NULL) {
288 { 300 TSerr(TS_F_TS_ACCURACY_SET_MICROS,
289 TSerr(TS_F_TS_ACCURACY_SET_MICROS, 301 ERR_R_MALLOC_FAILURE);
290 ERR_R_MALLOC_FAILURE);
291 return 0; 302 return 0;
292 }
293 } 303 }
304 }
294 ASN1_INTEGER_free(a->micros); 305 ASN1_INTEGER_free(a->micros);
295 a->micros = new_micros; 306 a->micros = new_micros;
296 return 1; 307 return 1;
297 } 308}
298 309
299const ASN1_INTEGER *TS_ACCURACY_get_micros(const TS_ACCURACY *a) 310const ASN1_INTEGER *
300 { 311TS_ACCURACY_get_micros(const TS_ACCURACY *a)
312{
301 return a->micros; 313 return a->micros;
302 } 314}
303 315
304int TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering) 316int
305 { 317TS_TST_INFO_set_ordering(TS_TST_INFO *a, int ordering)
318{
306 a->ordering = ordering ? 0xFF : 0x00; 319 a->ordering = ordering ? 0xFF : 0x00;
307 return 1; 320 return 1;
308 } 321}
309 322
310int TS_TST_INFO_get_ordering(const TS_TST_INFO *a) 323int
311 { 324TS_TST_INFO_get_ordering(const TS_TST_INFO *a)
325{
312 return a->ordering ? 1 : 0; 326 return a->ordering ? 1 : 0;
313 } 327}
314 328
315int TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce) 329int
316 { 330TS_TST_INFO_set_nonce(TS_TST_INFO *a, const ASN1_INTEGER *nonce)
331{
317 ASN1_INTEGER *new_nonce; 332 ASN1_INTEGER *new_nonce;
318 333
319 if (a->nonce == nonce) 334 if (a->nonce == nonce)
320 return 1; 335 return 1;
321 new_nonce = ASN1_INTEGER_dup(nonce); 336 new_nonce = ASN1_INTEGER_dup(nonce);
322 if (new_nonce == NULL) 337 if (new_nonce == NULL) {
323 {
324 TSerr(TS_F_TS_TST_INFO_SET_NONCE, ERR_R_MALLOC_FAILURE); 338 TSerr(TS_F_TS_TST_INFO_SET_NONCE, ERR_R_MALLOC_FAILURE);
325 return 0; 339 return 0;
326 } 340 }
327 ASN1_INTEGER_free(a->nonce); 341 ASN1_INTEGER_free(a->nonce);
328 a->nonce = new_nonce; 342 a->nonce = new_nonce;
329 return 1; 343 return 1;
330 } 344}
331 345
332const ASN1_INTEGER *TS_TST_INFO_get_nonce(const TS_TST_INFO *a) 346const ASN1_INTEGER *
333 { 347TS_TST_INFO_get_nonce(const TS_TST_INFO *a)
348{
334 return a->nonce; 349 return a->nonce;
335 } 350}
336 351
337int TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa) 352int
338 { 353TS_TST_INFO_set_tsa(TS_TST_INFO *a, GENERAL_NAME *tsa)
354{
339 GENERAL_NAME *new_tsa; 355 GENERAL_NAME *new_tsa;
340 356
341 if (a->tsa == tsa) 357 if (a->tsa == tsa)
342 return 1; 358 return 1;
343 new_tsa = GENERAL_NAME_dup(tsa); 359 new_tsa = GENERAL_NAME_dup(tsa);
344 if (new_tsa == NULL) 360 if (new_tsa == NULL) {
345 {
346 TSerr(TS_F_TS_TST_INFO_SET_TSA, ERR_R_MALLOC_FAILURE); 361 TSerr(TS_F_TS_TST_INFO_SET_TSA, ERR_R_MALLOC_FAILURE);
347 return 0; 362 return 0;
348 } 363 }
349 GENERAL_NAME_free(a->tsa); 364 GENERAL_NAME_free(a->tsa);
350 a->tsa = new_tsa; 365 a->tsa = new_tsa;
351 return 1; 366 return 1;
352 } 367}
353 368
354GENERAL_NAME *TS_TST_INFO_get_tsa(TS_TST_INFO *a) 369GENERAL_NAME *
355 { 370TS_TST_INFO_get_tsa(TS_TST_INFO *a)
371{
356 return a->tsa; 372 return a->tsa;
357 } 373}
358 374
359STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a) 375STACK_OF(X509_EXTENSION) *TS_TST_INFO_get_exts(TS_TST_INFO *a)
360 { 376{
361 return a->extensions; 377 return a->extensions;
362 } 378}
363 379
364void TS_TST_INFO_ext_free(TS_TST_INFO *a) 380void
365 { 381TS_TST_INFO_ext_free(TS_TST_INFO *a)
366 if (!a) return; 382{
383 if (!a)
384 return;
367 sk_X509_EXTENSION_pop_free(a->extensions, X509_EXTENSION_free); 385 sk_X509_EXTENSION_pop_free(a->extensions, X509_EXTENSION_free);
368 a->extensions = NULL; 386 a->extensions = NULL;
369 } 387}
370 388
371int TS_TST_INFO_get_ext_count(TS_TST_INFO *a) 389int
372 { 390TS_TST_INFO_get_ext_count(TS_TST_INFO *a)
391{
373 return X509v3_get_ext_count(a->extensions); 392 return X509v3_get_ext_count(a->extensions);
374 } 393}
375 394
376int TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos) 395int
377 { 396TS_TST_INFO_get_ext_by_NID(TS_TST_INFO *a, int nid, int lastpos)
397{
378 return X509v3_get_ext_by_NID(a->extensions, nid, lastpos); 398 return X509v3_get_ext_by_NID(a->extensions, nid, lastpos);
379 } 399}
380 400
381int TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos) 401int
382 { 402TS_TST_INFO_get_ext_by_OBJ(TS_TST_INFO *a, ASN1_OBJECT *obj, int lastpos)
403{
383 return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos); 404 return X509v3_get_ext_by_OBJ(a->extensions, obj, lastpos);
384 } 405}
385 406
386int TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos) 407int
387 { 408TS_TST_INFO_get_ext_by_critical(TS_TST_INFO *a, int crit, int lastpos)
409{
388 return X509v3_get_ext_by_critical(a->extensions, crit, lastpos); 410 return X509v3_get_ext_by_critical(a->extensions, crit, lastpos);
389 } 411}
390 412
391X509_EXTENSION *TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc) 413X509_EXTENSION *
392 { 414TS_TST_INFO_get_ext(TS_TST_INFO *a, int loc)
393 return X509v3_get_ext(a->extensions,loc); 415{
394 } 416 return X509v3_get_ext(a->extensions, loc);
395 417}
396X509_EXTENSION *TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc) 418
397 { 419X509_EXTENSION *
398 return X509v3_delete_ext(a->extensions,loc); 420TS_TST_INFO_delete_ext(TS_TST_INFO *a, int loc)
399 } 421{
400 422 return X509v3_delete_ext(a->extensions, loc);
401int TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc) 423}
402 { 424
403 return X509v3_add_ext(&a->extensions,ex,loc) != NULL; 425int
404 } 426TS_TST_INFO_add_ext(TS_TST_INFO *a, X509_EXTENSION *ex, int loc)
405 427{
406void *TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx) 428 return X509v3_add_ext(&a->extensions, ex, loc) != NULL;
407 { 429}
430
431void *
432TS_TST_INFO_get_ext_d2i(TS_TST_INFO *a, int nid, int *crit, int *idx)
433{
408 return X509V3_get_d2i(a->extensions, nid, crit, idx); 434 return X509V3_get_d2i(a->extensions, nid, crit, idx);
409 } 435}