Coverage Report

Created: 2026-01-09 07:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/openssl/include/openssl/asn1t.h
Line
Count
Source
1
/*
2
 * WARNING: do not edit!
3
 * Generated by Makefile from include/openssl/asn1t.h.in
4
 *
5
 * Copyright 2000-2021 The OpenSSL Project Authors. All Rights Reserved.
6
 *
7
 * Licensed under the Apache License 2.0 (the "License").  You may not use
8
 * this file except in compliance with the License.  You can obtain a copy
9
 * in the file LICENSE in the source distribution or at
10
 * https://www.openssl.org/source/license.html
11
 */
12
13
/* clang-format off */
14
15
/* clang-format on */
16
17
#ifndef OPENSSL_ASN1T_H
18
#define OPENSSL_ASN1T_H
19
#pragma once
20
21
#include <openssl/macros.h>
22
#ifndef OPENSSL_NO_DEPRECATED_3_0
23
#define HEADER_ASN1T_H
24
#endif
25
26
#include <stddef.h>
27
#include <openssl/e_os2.h>
28
#include <openssl/asn1.h>
29
30
#ifdef OPENSSL_BUILD_SHLIBCRYPTO
31
#undef OPENSSL_EXTERN
32
#define OPENSSL_EXTERN OPENSSL_EXPORT
33
#endif
34
35
/* ASN1 template defines, structures and functions */
36
37
#ifdef __cplusplus
38
extern "C" {
39
#endif
40
41
/*-
42
 * These are the possible values for the itype field of the
43
 * ASN1_ITEM structure and determine how it is interpreted.
44
 *
45
 * For PRIMITIVE types the underlying type
46
 * determines the behaviour if items is NULL.
47
 *
48
 * Otherwise templates must contain a single
49
 * template and the type is treated in the
50
 * same way as the type specified in the template.
51
 *
52
 * For SEQUENCE types the templates field points
53
 * to the members, the size field is the
54
 * structure size.
55
 *
56
 * For CHOICE types the templates field points
57
 * to each possible member (typically a union)
58
 * and the 'size' field is the offset of the
59
 * selector.
60
 *
61
 * The 'funcs' field is used for application-specific
62
 * data and functions.
63
 *
64
 * The EXTERN type uses a new style d2i/i2d.
65
 * The new style should be used where possible
66
 * because it avoids things like the d2i IMPLICIT
67
 * hack.
68
 *
69
 * MSTRING is a multiple string type, it is used
70
 * for a CHOICE of character strings where the
71
 * actual strings all occupy an ASN1_STRING
72
 * structure. In this case the 'utype' field
73
 * has a special meaning, it is used as a mask
74
 * of acceptable types using the B_ASN1 constants.
75
 *
76
 * NDEF_SEQUENCE is the same as SEQUENCE except
77
 * that it will use indefinite length constructed
78
 * encoding if requested.
79
 *
80
 */
81
82
0
#define ASN1_ITYPE_PRIMITIVE 0x0
83
0
#define ASN1_ITYPE_SEQUENCE 0x1
84
0
#define ASN1_ITYPE_CHOICE 0x2
85
/* unused value                          0x3 */
86
0
#define ASN1_ITYPE_EXTERN 0x4
87
0
#define ASN1_ITYPE_MSTRING 0x5
88
0
#define ASN1_ITYPE_NDEF_SEQUENCE 0x6
89
90
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
91
0
#define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
92
93
/* Macros for start and end of ASN1_ITEM definition */
94
95
#define ASN1_ITEM_start(itname)        \
96
    const ASN1_ITEM *itname##_it(void) \
97
0
    {                                  \
98
0
        static const ASN1_ITEM local_it = {
99
100
#define static_ASN1_ITEM_start(itname) \
101
0
    static ASN1_ITEM_start(itname)
102
103
#define ASN1_ITEM_end(itname) \
104
0
    }                         \
105
0
    ;                         \
106
0
    return &local_it;         \
107
0
    }
108
109
/* Macros to aid ASN1 template writing */
110
111
#define ASN1_ITEM_TEMPLATE(tname) \
112
    static const ASN1_TEMPLATE tname##_item_tt
113
114
#define ASN1_ITEM_TEMPLATE_END(tname) \
115
    ;                                 \
116
0
    ASN1_ITEM_start(tname)            \
117
0
        ASN1_ITYPE_PRIMITIVE,         \
118
0
        -1,                           \
119
0
        &tname##_item_tt,             \
120
0
        0,                            \
121
0
        NULL,                         \
122
0
        0,                            \
123
0
        #tname ASN1_ITEM_end(tname)
124
#define static_ASN1_ITEM_TEMPLATE_END(tname) \
125
    ;                                        \
126
0
    static_ASN1_ITEM_start(tname)            \
127
0
        ASN1_ITYPE_PRIMITIVE,                \
128
0
        -1,                                  \
129
0
        &tname##_item_tt,                    \
130
0
        0,                                   \
131
0
        NULL,                                \
132
0
        0,                                   \
133
0
        #tname ASN1_ITEM_end(tname)
134
135
/* This is a ASN1 type which just embeds a template */
136
137
/*-
138
 * This pair helps declare a SEQUENCE. We can do:
139
 *
140
 *      ASN1_SEQUENCE(stname) = {
141
 *              ... SEQUENCE components ...
142
 *      } ASN1_SEQUENCE_END(stname)
143
 *
144
 *      This will produce an ASN1_ITEM called stname_it
145
 *      for a structure called stname.
146
 *
147
 *      If you want the same structure but a different
148
 *      name then use:
149
 *
150
 *      ASN1_SEQUENCE(itname) = {
151
 *              ... SEQUENCE components ...
152
 *      } ASN1_SEQUENCE_END_name(stname, itname)
153
 *
154
 *      This will create an item called itname_it using
155
 *      a structure called stname.
156
 */
157
158
#define ASN1_SEQUENCE(tname) \
159
    static const ASN1_TEMPLATE tname##_seq_tt[]
160
161
#define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
162
163
#define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname)
164
165
#define ASN1_SEQUENCE_END_name(stname, tname)           \
166
    ;                                                   \
167
0
    ASN1_ITEM_start(tname)                              \
168
0
        ASN1_ITYPE_SEQUENCE,                            \
169
0
        V_ASN1_SEQUENCE,                                \
170
0
        tname##_seq_tt,                                 \
171
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
172
0
        NULL,                                           \
173
0
        sizeof(stname),                                 \
174
0
        #tname ASN1_ITEM_end(tname)
175
176
#define static_ASN1_SEQUENCE_END_name(stname, tname)    \
177
    ;                                                   \
178
0
    static_ASN1_ITEM_start(tname)                       \
179
0
        ASN1_ITYPE_SEQUENCE,                            \
180
0
        V_ASN1_SEQUENCE,                                \
181
0
        tname##_seq_tt,                                 \
182
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
183
0
        NULL,                                           \
184
0
        sizeof(stname),                                 \
185
0
        #stname ASN1_ITEM_end(tname)
186
187
#define ASN1_NDEF_SEQUENCE(tname) \
188
    ASN1_SEQUENCE(tname)
189
190
#define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
191
    ASN1_SEQUENCE_cb(tname, cb)
192
193
#define ASN1_SEQUENCE_cb(tname, cb)                                     \
194
    static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \
195
    ASN1_SEQUENCE(tname)
196
197
#define ASN1_SEQUENCE_const_cb(tname, const_cb)                                                \
198
    static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb }; \
199
    ASN1_SEQUENCE(tname)
200
201
#define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb)                                       \
202
    static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb }; \
203
    ASN1_SEQUENCE(tname)
204
205
#define ASN1_SEQUENCE_ref(tname, cb)                                                                                                   \
206
    static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL }; \
207
    ASN1_SEQUENCE(tname)
208
209
#define ASN1_SEQUENCE_enc(tname, enc, cb)                                                                   \
210
    static const ASN1_AUX tname##_aux = { NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL }; \
211
    ASN1_SEQUENCE(tname)
212
213
#define ASN1_NDEF_SEQUENCE_END(tname)                   \
214
    ;                                                   \
215
0
    ASN1_ITEM_start(tname)                              \
216
0
        ASN1_ITYPE_NDEF_SEQUENCE,                       \
217
0
        V_ASN1_SEQUENCE,                                \
218
0
        tname##_seq_tt,                                 \
219
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
220
0
        NULL,                                           \
221
0
        sizeof(tname),                                  \
222
0
        #tname ASN1_ITEM_end(tname)
223
#define static_ASN1_NDEF_SEQUENCE_END(tname)            \
224
    ;                                                   \
225
    static_ASN1_ITEM_start(tname)                       \
226
        ASN1_ITYPE_NDEF_SEQUENCE,                       \
227
        V_ASN1_SEQUENCE,                                \
228
        tname##_seq_tt,                                 \
229
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
230
        NULL,                                           \
231
        sizeof(tname),                                  \
232
        #tname ASN1_ITEM_end(tname)
233
234
#define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
235
236
#define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
237
#define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname)
238
239
#define ASN1_SEQUENCE_END_ref(stname, tname)            \
240
    ;                                                   \
241
0
    ASN1_ITEM_start(tname)                              \
242
0
        ASN1_ITYPE_SEQUENCE,                            \
243
0
        V_ASN1_SEQUENCE,                                \
244
0
        tname##_seq_tt,                                 \
245
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
246
0
        &tname##_aux,                                   \
247
0
        sizeof(stname),                                 \
248
0
        #tname ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_it
Unexecuted instantiation: DHparams_it
Unexecuted instantiation: PKCS7_SIGNER_INFO_it
Unexecuted instantiation: PKCS7_RECIP_INFO_it
Unexecuted instantiation: RSAPrivateKey_it
Unexecuted instantiation: RSAPublicKey_it
Unexecuted instantiation: RSA_PSS_PARAMS_it
Unexecuted instantiation: RSA_OAEP_PARAMS_it
Unexecuted instantiation: X509_CRL_INFO_it
Unexecuted instantiation: X509_CRL_it
Unexecuted instantiation: X509_REQ_INFO_it
Unexecuted instantiation: X509_REQ_it
Unexecuted instantiation: X509_CINF_it
Unexecuted instantiation: X509_it
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_it
249
#define static_ASN1_SEQUENCE_END_ref(stname, tname)     \
250
    ;                                                   \
251
0
    static_ASN1_ITEM_start(tname)                       \
252
0
        ASN1_ITYPE_SEQUENCE,                            \
253
0
        V_ASN1_SEQUENCE,                                \
254
0
        tname##_seq_tt,                                 \
255
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
256
0
        &tname##_aux,                                   \
257
0
        sizeof(stname),                                 \
258
0
        #stname ASN1_ITEM_end(tname)
Unexecuted instantiation: dsa_asn1.c:DSAPrivateKey_it
Unexecuted instantiation: dsa_asn1.c:DSAparams_it
Unexecuted instantiation: dsa_asn1.c:DSAPublicKey_it
259
260
#define ASN1_NDEF_SEQUENCE_END_cb(stname, tname)        \
261
    ;                                                   \
262
0
    ASN1_ITEM_start(tname)                              \
263
0
        ASN1_ITYPE_NDEF_SEQUENCE,                       \
264
0
        V_ASN1_SEQUENCE,                                \
265
0
        tname##_seq_tt,                                 \
266
0
        sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE), \
267
0
        &tname##_aux,                                   \
268
0
        sizeof(stname),                                 \
269
0
        #stname ASN1_ITEM_end(tname)
270
271
/*-
272
 * This pair helps declare a CHOICE type. We can do:
273
 *
274
 *      ASN1_CHOICE(chname) = {
275
 *              ... CHOICE options ...
276
 *      ASN1_CHOICE_END(chname)
277
 *
278
 *      This will produce an ASN1_ITEM called chname_it
279
 *      for a structure called chname. The structure
280
 *      definition must look like this:
281
 *      typedef struct {
282
 *              int type;
283
 *              union {
284
 *                      ASN1_SOMETHING *opt1;
285
 *                      ASN1_SOMEOTHER *opt2;
286
 *              } value;
287
 *      } chname;
288
 *
289
 *      the name of the selector must be 'type'.
290
 *      to use an alternative selector name use the
291
 *      ASN1_CHOICE_END_selector() version.
292
 */
293
294
#define ASN1_CHOICE(tname) \
295
    static const ASN1_TEMPLATE tname##_ch_tt[]
296
297
#define ASN1_CHOICE_cb(tname, cb)                                       \
298
    static const ASN1_AUX tname##_aux = { NULL, 0, 0, 0, cb, 0, NULL }; \
299
    ASN1_CHOICE(tname)
300
301
#define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
302
303
#define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname)
304
305
#define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
306
307
#define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type)
308
309
#define ASN1_CHOICE_END_selector(stname, tname, selname) \
310
    ;                                                    \
311
0
    ASN1_ITEM_start(tname)                               \
312
0
        ASN1_ITYPE_CHOICE,                               \
313
0
        offsetof(stname, selname),                       \
314
0
        tname##_ch_tt,                                   \
315
0
        sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),   \
316
0
        NULL,                                            \
317
0
        sizeof(stname),                                  \
318
0
        #stname ASN1_ITEM_end(tname)
319
320
#define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
321
    ;                                                           \
322
    static_ASN1_ITEM_start(tname)                               \
323
        ASN1_ITYPE_CHOICE,                                      \
324
        offsetof(stname, selname),                              \
325
        tname##_ch_tt,                                          \
326
        sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),          \
327
        NULL,                                                   \
328
        sizeof(stname),                                         \
329
        #stname ASN1_ITEM_end(tname)
330
331
#define ASN1_CHOICE_END_cb(stname, tname, selname)     \
332
    ;                                                  \
333
0
    ASN1_ITEM_start(tname)                             \
334
0
        ASN1_ITYPE_CHOICE,                             \
335
0
        offsetof(stname, selname),                     \
336
0
        tname##_ch_tt,                                 \
337
0
        sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE), \
338
0
        &tname##_aux,                                  \
339
0
        sizeof(stname),                                \
340
0
        #stname ASN1_ITEM_end(tname)
341
342
/* This helps with the template wrapper form of ASN1_ITEM */
343
344
#define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
345
    (flags), (tag), 0,                                  \
346
    #name, ASN1_ITEM_ref(type)                          \
347
}
348
349
/* These help with SEQUENCE or CHOICE components */
350
351
/* used to declare other types */
352
353
#define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
354
    (flags), (tag), offsetof(stname, field),            \
355
    #field, ASN1_ITEM_ref(type)                         \
356
}
357
358
/* implicit and explicit helper macros */
359
360
#define ASN1_IMP_EX(stname, field, type, tag, ex) \
361
    ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type)
362
363
#define ASN1_EXP_EX(stname, field, type, tag, ex) \
364
    ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type)
365
366
/* Any defined by macros: the field used is in the table itself */
367
368
#define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
369
#define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
370
371
/* Plain simple type */
372
#define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0, 0, stname, field, type)
373
/* Embedded simple type */
374
#define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED, 0, stname, field, type)
375
376
/* OPTIONAL simple type */
377
#define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
378
#define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED, 0, stname, field, type)
379
380
/* IMPLICIT tagged simple type */
381
#define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
382
#define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
383
384
/* IMPLICIT tagged OPTIONAL simple type */
385
#define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
386
#define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED)
387
388
/* Same as above but EXPLICIT */
389
390
#define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
391
#define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
392
#define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
393
#define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_EMBED)
394
395
/* SEQUENCE OF type */
396
#define ASN1_SEQUENCE_OF(stname, field, type) \
397
    ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
398
399
/* OPTIONAL SEQUENCE OF */
400
#define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
401
    ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL, 0, stname, field, type)
402
403
/* Same as above but for SET OF */
404
405
#define ASN1_SET_OF(stname, field, type) \
406
    ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
407
408
#define ASN1_SET_OF_OPT(stname, field, type) \
409
    ASN1_EX_TYPE(ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL, 0, stname, field, type)
410
411
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
412
413
#define ASN1_IMP_SET_OF(stname, field, type, tag) \
414
    ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
415
416
#define ASN1_EXP_SET_OF(stname, field, type, tag) \
417
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
418
419
#define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
420
    ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL)
421
422
#define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
423
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF | ASN1_TFLG_OPTIONAL)
424
425
#define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
426
    ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
427
428
#define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
429
    ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL)
430
431
#define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
432
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
433
434
#define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
435
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF | ASN1_TFLG_OPTIONAL)
436
437
/* EXPLICIT using indefinite length constructed form */
438
#define ASN1_NDEF_EXP(stname, field, type, tag) \
439
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
440
441
/* EXPLICIT OPTIONAL using indefinite length constructed form */
442
#define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
443
    ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL | ASN1_TFLG_NDEF)
444
445
/* Macros for the ASN1_ADB structure */
446
447
#define ASN1_ADB(name) \
448
    static const ASN1_ADB_TABLE name##_adbtbl[]
449
450
#define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
451
    ;                                                       \
452
    static const ASN1_ITEM *name##_adb(void)                \
453
0
    {                                                       \
454
0
        static const ASN1_ADB internal_adb = {              \
455
0
            flags,                                          \
456
0
            offsetof(name, field),                          \
457
0
            adb_cb,                                         \
458
0
            name##_adbtbl,                                  \
459
0
            sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE), \
460
0
            def,                                            \
461
0
            none                                            \
462
0
        };                                                  \
463
0
        return (const ASN1_ITEM *)&internal_adb;            \
464
0
    }                                                       \
465
    void dummy_function(void)
466
467
#define ADB_ENTRY(val, template) { val, template }
468
469
#define ASN1_ADB_TEMPLATE(name) \
470
    static const ASN1_TEMPLATE name##_tt
471
472
/*
473
 * This is the ASN1 template structure that defines a wrapper round the
474
 * actual type. It determines the actual position of the field in the value
475
 * structure, various flags such as OPTIONAL and the field name.
476
 */
477
478
struct ASN1_TEMPLATE_st {
479
    unsigned long flags; /* Various flags */
480
    long tag; /* tag, not used if no tagging */
481
    unsigned long offset; /* Offset of this field in structure */
482
    const char *field_name; /* Field name */
483
    ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
484
};
485
486
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
487
488
#define ASN1_TEMPLATE_item(t) (t->item_ptr)
489
#define ASN1_TEMPLATE_adb(t) (t->item_ptr)
490
491
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
492
typedef struct ASN1_ADB_st ASN1_ADB;
493
494
struct ASN1_ADB_st {
495
    unsigned long flags; /* Various flags */
496
    unsigned long offset; /* Offset of selector field */
497
    int (*adb_cb)(long *psel); /* Application callback */
498
    const ASN1_ADB_TABLE *tbl; /* Table of possible types */
499
    long tblcount; /* Number of entries in tbl */
500
    const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
501
    const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
502
};
503
504
struct ASN1_ADB_TABLE_st {
505
    long value; /* NID for an object or value for an int */
506
    const ASN1_TEMPLATE tt; /* item for this value */
507
};
508
509
/* template flags */
510
511
/* Field is optional */
512
0
#define ASN1_TFLG_OPTIONAL (0x1)
513
514
/* Field is a SET OF */
515
0
#define ASN1_TFLG_SET_OF (0x1 << 1)
516
517
/* Field is a SEQUENCE OF */
518
0
#define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
519
520
/*
521
 * Special case: this refers to a SET OF that will be sorted into DER order
522
 * when encoded *and* the corresponding STACK will be modified to match the
523
 * new order.
524
 */
525
#define ASN1_TFLG_SET_ORDER (0x3 << 1)
526
527
/* Mask for SET OF or SEQUENCE OF */
528
0
#define ASN1_TFLG_SK_MASK (0x3 << 1)
529
530
/*
531
 * These flags mean the tag should be taken from the tag field. If EXPLICIT
532
 * then the underlying type is used for the inner tag.
533
 */
534
535
/* IMPLICIT tagging */
536
0
#define ASN1_TFLG_IMPTAG (0x1 << 3)
537
538
/* EXPLICIT tagging, inner tag from underlying type */
539
0
#define ASN1_TFLG_EXPTAG (0x2 << 3)
540
541
0
#define ASN1_TFLG_TAG_MASK (0x3 << 3)
542
543
/* context specific IMPLICIT */
544
#define ASN1_TFLG_IMPLICIT (ASN1_TFLG_IMPTAG | ASN1_TFLG_CONTEXT)
545
546
/* context specific EXPLICIT */
547
#define ASN1_TFLG_EXPLICIT (ASN1_TFLG_EXPTAG | ASN1_TFLG_CONTEXT)
548
549
/*
550
 * If tagging is in force these determine the type of tag to use. Otherwise
551
 * the tag is determined by the underlying type. These values reflect the
552
 * actual octet format.
553
 */
554
555
/* Universal tag */
556
#define ASN1_TFLG_UNIVERSAL (0x0 << 6)
557
/* Application tag */
558
#define ASN1_TFLG_APPLICATION (0x1 << 6)
559
/* Context specific tag */
560
#define ASN1_TFLG_CONTEXT (0x2 << 6)
561
/* Private tag */
562
#define ASN1_TFLG_PRIVATE (0x3 << 6)
563
564
0
#define ASN1_TFLG_TAG_CLASS (0x3 << 6)
565
566
/*
567
 * These are for ANY DEFINED BY type. In this case the 'item' field points to
568
 * an ASN1_ADB structure which contains a table of values to decode the
569
 * relevant type
570
 */
571
572
0
#define ASN1_TFLG_ADB_MASK (0x3 << 8)
573
574
0
#define ASN1_TFLG_ADB_OID (0x1 << 8)
575
576
#define ASN1_TFLG_ADB_INT (0x1 << 9)
577
578
/*
579
 * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
580
 * indefinite length constructed encoding to be used if required.
581
 */
582
583
0
#define ASN1_TFLG_NDEF (0x1 << 11)
584
585
/* Field is embedded and not a pointer */
586
0
#define ASN1_TFLG_EMBED (0x1 << 12)
587
588
/* This is the actual ASN1 item itself */
589
590
struct ASN1_ITEM_st {
591
    char itype; /* The item type, primitive, SEQUENCE, CHOICE
592
                 * or extern */
593
    long utype; /* underlying type */
594
    const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
595
                                     * the contents */
596
    long tcount; /* Number of templates if SEQUENCE or CHOICE */
597
    const void *funcs; /* further data and type-specific functions */
598
    /* funcs can be ASN1_PRIMITIVE_FUNCS*, ASN1_EXTERN_FUNCS*, or ASN1_AUX* */
599
    long size; /* Structure size (usually) */
600
    const char *sname; /* Structure name */
601
};
602
603
/*
604
 * Cache for ASN1 tag and length, so we don't keep re-reading it for things
605
 * like CHOICE
606
 */
607
608
struct ASN1_TLC_st {
609
    char valid; /* Values below are valid */
610
    int ret; /* return value */
611
    long plen; /* length */
612
    int ptag; /* class value */
613
    int pclass; /* class value */
614
    int hdrlen; /* header length */
615
};
616
617
/* Typedefs for ASN1 function pointers */
618
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
619
    const ASN1_ITEM *it, int tag, int aclass, char opt,
620
    ASN1_TLC *ctx);
621
622
typedef int ASN1_ex_d2i_ex(ASN1_VALUE **pval, const unsigned char **in, long len,
623
    const ASN1_ITEM *it, int tag, int aclass, char opt,
624
    ASN1_TLC *ctx, OSSL_LIB_CTX *libctx,
625
    const char *propq);
626
typedef int ASN1_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
627
    const ASN1_ITEM *it, int tag, int aclass);
628
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
629
typedef int ASN1_ex_new_ex_func(ASN1_VALUE **pval, const ASN1_ITEM *it,
630
    OSSL_LIB_CTX *libctx, const char *propq);
631
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
632
633
typedef int ASN1_ex_print_func(BIO *out, const ASN1_VALUE **pval,
634
    int indent, const char *fname,
635
    const ASN1_PCTX *pctx);
636
637
typedef int ASN1_primitive_i2c(const ASN1_VALUE **pval, unsigned char *cont,
638
    int *putype, const ASN1_ITEM *it);
639
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
640
    int len, int utype, char *free_cont,
641
    const ASN1_ITEM *it);
642
typedef int ASN1_primitive_print(BIO *out, const ASN1_VALUE **pval,
643
    const ASN1_ITEM *it, int indent,
644
    const ASN1_PCTX *pctx);
645
646
typedef struct ASN1_EXTERN_FUNCS_st {
647
    void *app_data;
648
    ASN1_ex_new_func *asn1_ex_new;
649
    ASN1_ex_free_func *asn1_ex_free;
650
    ASN1_ex_free_func *asn1_ex_clear;
651
    ASN1_ex_d2i *asn1_ex_d2i;
652
    ASN1_ex_i2d *asn1_ex_i2d;
653
    ASN1_ex_print_func *asn1_ex_print;
654
    ASN1_ex_new_ex_func *asn1_ex_new_ex;
655
    ASN1_ex_d2i_ex *asn1_ex_d2i_ex;
656
} ASN1_EXTERN_FUNCS;
657
658
typedef struct ASN1_PRIMITIVE_FUNCS_st {
659
    void *app_data;
660
    unsigned long flags;
661
    ASN1_ex_new_func *prim_new;
662
    ASN1_ex_free_func *prim_free;
663
    ASN1_ex_free_func *prim_clear;
664
    ASN1_primitive_c2i *prim_c2i;
665
    ASN1_primitive_i2c *prim_i2c;
666
    ASN1_primitive_print *prim_print;
667
} ASN1_PRIMITIVE_FUNCS;
668
669
/*
670
 * This is the ASN1_AUX structure: it handles various miscellaneous
671
 * requirements. For example the use of reference counts and an informational
672
 * callback. The "informational callback" is called at various points during
673
 * the ASN1 encoding and decoding. It can be used to provide minor
674
 * customisation of the structures used. This is most useful where the
675
 * supplied routines *almost* do the right thing but need some extra help at
676
 * a few points. If the callback returns zero then it is assumed a fatal
677
 * error has occurred and the main operation should be abandoned. If major
678
 * changes in the default behaviour are required then an external type is
679
 * more appropriate.
680
 * For the operations ASN1_OP_I2D_PRE, ASN1_OP_I2D_POST, ASN1_OP_PRINT_PRE, and
681
 * ASN1_OP_PRINT_POST, meanwhile a variant of the callback with const parameter
682
 * 'in' is provided to make clear statically that its input is not modified. If
683
 * and only if this variant is in use the flag ASN1_AFLG_CONST_CB must be set.
684
 */
685
686
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
687
    void *exarg);
688
typedef int ASN1_aux_const_cb(int operation, const ASN1_VALUE **in,
689
    const ASN1_ITEM *it, void *exarg);
690
691
typedef struct ASN1_AUX_st {
692
    void *app_data;
693
    int flags;
694
    int ref_offset; /* Offset of reference value */
695
    int ref_lock; /* Offset of lock value */
696
    ASN1_aux_cb *asn1_cb;
697
    int enc_offset; /* Offset of ASN1_ENCODING structure */
698
    ASN1_aux_const_cb *asn1_const_cb; /* for ASN1_OP_I2D_ and ASN1_OP_PRINT_ */
699
} ASN1_AUX;
700
701
/* For print related callbacks exarg points to this structure */
702
typedef struct ASN1_PRINT_ARG_st {
703
    BIO *out;
704
    int indent;
705
    const ASN1_PCTX *pctx;
706
} ASN1_PRINT_ARG;
707
708
/* For streaming related callbacks exarg points to this structure */
709
typedef struct ASN1_STREAM_ARG_st {
710
    /* BIO to stream through */
711
    BIO *out;
712
    /* BIO with filters appended */
713
    BIO *ndef_bio;
714
    /* Streaming I/O boundary */
715
    unsigned char **boundary;
716
} ASN1_STREAM_ARG;
717
718
/* Flags in ASN1_AUX */
719
720
/* Use a reference count */
721
0
#define ASN1_AFLG_REFCOUNT 1
722
/* Save the encoding of structure (useful for signatures) */
723
0
#define ASN1_AFLG_ENCODING 2
724
/* The Sequence length is invalid */
725
0
#define ASN1_AFLG_BROKEN 4
726
/* Use the new asn1_const_cb */
727
0
#define ASN1_AFLG_CONST_CB 8
728
729
/* operation values for asn1_cb */
730
731
0
#define ASN1_OP_NEW_PRE 0
732
0
#define ASN1_OP_NEW_POST 1
733
0
#define ASN1_OP_FREE_PRE 2
734
0
#define ASN1_OP_FREE_POST 3
735
0
#define ASN1_OP_D2I_PRE 4
736
0
#define ASN1_OP_D2I_POST 5
737
0
#define ASN1_OP_I2D_PRE 6
738
0
#define ASN1_OP_I2D_POST 7
739
0
#define ASN1_OP_PRINT_PRE 8
740
0
#define ASN1_OP_PRINT_POST 9
741
0
#define ASN1_OP_STREAM_PRE 10
742
0
#define ASN1_OP_STREAM_POST 11
743
0
#define ASN1_OP_DETACHED_PRE 12
744
0
#define ASN1_OP_DETACHED_POST 13
745
0
#define ASN1_OP_DUP_PRE 14
746
0
#define ASN1_OP_DUP_POST 15
747
0
#define ASN1_OP_GET0_LIBCTX 16
748
0
#define ASN1_OP_GET0_PROPQ 17
749
750
/* Macro to implement a primitive type */
751
#define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
752
#define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
753
0
    ASN1_ITEM_start(itname)                       \
754
0
        ASN1_ITYPE_PRIMITIVE,                     \
755
0
        V_##vname, NULL, 0, NULL, ex, #itname ASN1_ITEM_end(itname)
756
757
/* Macro to implement a multi string type */
758
#define IMPLEMENT_ASN1_MSTRING(itname, mask) \
759
0
    ASN1_ITEM_start(itname)                  \
760
0
        ASN1_ITYPE_MSTRING,                  \
761
0
        mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname ASN1_ITEM_end(itname)
762
763
#define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
764
0
    ASN1_ITEM_start(sname)                       \
765
0
        ASN1_ITYPE_EXTERN,                       \
766
0
        tag,                                     \
767
0
        NULL,                                    \
768
0
        0,                                       \
769
0
        &fptrs,                                  \
770
0
        0,                                       \
771
0
        #sname ASN1_ITEM_end(sname)
772
773
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
774
775
#define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
776
777
#define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
778
779
#define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
780
    IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
781
782
#define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
783
    IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
784
785
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
786
    IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
787
788
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
789
    pre stname *fname##_new(void)                                         \
790
    {                                                                     \
791
        return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname));           \
792
    }                                                                     \
793
    pre void fname##_free(stname *a)                                      \
794
    {                                                                     \
795
        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));          \
796
    }
797
798
#define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
799
    stname *fname##_new(void)                                       \
800
0
    {                                                               \
801
0
        return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname));     \
802
0
    }                                                               \
Unexecuted instantiation: X509_ATTRIBUTE_new
Unexecuted instantiation: X509_NAME_ENTRY_new
Unexecuted instantiation: X509_NAME_new
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_new
Unexecuted instantiation: ASN1_NULL_new
Unexecuted instantiation: ASN1_TYPE_new
Unexecuted instantiation: ASN1_PRINTABLE_new
Unexecuted instantiation: DISPLAYTEXT_new
Unexecuted instantiation: DIRECTORYSTRING_new
Unexecuted instantiation: X509_ALGOR_new
Unexecuted instantiation: X509_SIG_new
Unexecuted instantiation: X9_62_PENTANOMIAL_new
Unexecuted instantiation: X9_62_CHARACTERISTIC_TWO_new
Unexecuted instantiation: ECPARAMETERS_new
Unexecuted instantiation: ECPKPARAMETERS_new
Unexecuted instantiation: EC_PRIVATEKEY_new
Unexecuted instantiation: PKCS7_SIGNED_new
Unexecuted instantiation: PKCS7_SIGNER_INFO_new
Unexecuted instantiation: PKCS7_ISSUER_AND_SERIAL_new
Unexecuted instantiation: PKCS7_ENVELOPE_new
Unexecuted instantiation: PKCS7_RECIP_INFO_new
Unexecuted instantiation: PKCS7_ENC_CONTENT_new
Unexecuted instantiation: PKCS7_SIGN_ENVELOPE_new
Unexecuted instantiation: PKCS7_ENCRYPT_new
Unexecuted instantiation: PKCS7_DIGEST_new
Unexecuted instantiation: RSA_PSS_PARAMS_new
Unexecuted instantiation: RSA_OAEP_PARAMS_new
Unexecuted instantiation: SM2_Ciphertext_new
Unexecuted instantiation: X509_REVOKED_new
Unexecuted instantiation: X509_CRL_INFO_new
Unexecuted instantiation: X509_CRL_new
Unexecuted instantiation: X509_EXTENSION_new
Unexecuted instantiation: X509_PUBKEY_new
Unexecuted instantiation: X509_REQ_INFO_new
Unexecuted instantiation: X509_REQ_new
Unexecuted instantiation: X509_CINF_new
Unexecuted instantiation: X509_new
Unexecuted instantiation: X509_CERT_AUX_new
Unexecuted instantiation: ASN1_TIME_new
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_new
Unexecuted instantiation: PBEPARAM_new
Unexecuted instantiation: PBE2PARAM_new
Unexecuted instantiation: PBKDF2PARAM_new
Unexecuted instantiation: PBMAC1PARAM_new
Unexecuted instantiation: SCRYPT_PARAMS_new
Unexecuted instantiation: NETSCAPE_SPKAC_new
Unexecuted instantiation: NETSCAPE_SPKI_new
Unexecuted instantiation: X509_VAL_new
Unexecuted instantiation: OCSP_SIGNATURE_new
Unexecuted instantiation: OCSP_CERTID_new
Unexecuted instantiation: OCSP_ONEREQ_new
Unexecuted instantiation: OCSP_REQINFO_new
Unexecuted instantiation: OCSP_REQUEST_new
Unexecuted instantiation: OCSP_RESPBYTES_new
Unexecuted instantiation: OCSP_RESPONSE_new
Unexecuted instantiation: OCSP_RESPID_new
Unexecuted instantiation: OCSP_REVOKEDINFO_new
Unexecuted instantiation: OCSP_CERTSTATUS_new
Unexecuted instantiation: OCSP_SINGLERESP_new
Unexecuted instantiation: OCSP_RESPDATA_new
Unexecuted instantiation: OCSP_BASICRESP_new
Unexecuted instantiation: OCSP_CRLID_new
Unexecuted instantiation: OCSP_SERVICELOC_new
Unexecuted instantiation: PKCS12_MAC_DATA_new
Unexecuted instantiation: PKCS12_BAGS_new
Unexecuted instantiation: PKCS12_SAFEBAG_new
Unexecuted instantiation: IPAddressRange_new
Unexecuted instantiation: IPAddressOrRange_new
Unexecuted instantiation: IPAddressChoice_new
Unexecuted instantiation: IPAddressFamily_new
Unexecuted instantiation: AUTHORITY_KEYID_new
Unexecuted instantiation: ASRange_new
Unexecuted instantiation: ASIdOrRange_new
Unexecuted instantiation: ASIdentifierChoice_new
Unexecuted instantiation: ASIdentifiers_new
Unexecuted instantiation: BASIC_CONSTRAINTS_new
Unexecuted instantiation: CERTIFICATEPOLICIES_new
Unexecuted instantiation: POLICYINFO_new
Unexecuted instantiation: POLICYQUALINFO_new
Unexecuted instantiation: USERNOTICE_new
Unexecuted instantiation: NOTICEREF_new
Unexecuted instantiation: DIST_POINT_NAME_new
Unexecuted instantiation: DIST_POINT_new
Unexecuted instantiation: CRL_DIST_POINTS_new
Unexecuted instantiation: ISSUING_DIST_POINT_new
Unexecuted instantiation: OSSL_AA_DIST_POINT_new
Unexecuted instantiation: OTHERNAME_new
Unexecuted instantiation: EDIPARTYNAME_new
Unexecuted instantiation: GENERAL_NAME_new
Unexecuted instantiation: GENERAL_NAMES_new
Unexecuted instantiation: ACCESS_DESCRIPTION_new
Unexecuted instantiation: AUTHORITY_INFO_ACCESS_new
Unexecuted instantiation: GENERAL_SUBTREE_new
Unexecuted instantiation: NAME_CONSTRAINTS_new
Unexecuted instantiation: PROXY_POLICY_new
Unexecuted instantiation: PROXY_CERT_INFO_EXTENSION_new
Unexecuted instantiation: POLICY_CONSTRAINTS_new
Unexecuted instantiation: PKEY_USAGE_PERIOD_new
Unexecuted instantiation: POLICY_MAPPING_new
Unexecuted instantiation: OSSL_ROLE_SPEC_CERT_ID_new
Unexecuted instantiation: OSSL_ROLE_SPEC_CERT_ID_SYNTAX_new
Unexecuted instantiation: OSSL_ATTRIBUTES_SYNTAX_new
Unexecuted instantiation: SXNETID_new
Unexecuted instantiation: SXNET_new
Unexecuted instantiation: OSSL_DAY_TIME_new
Unexecuted instantiation: OSSL_DAY_TIME_BAND_new
Unexecuted instantiation: OSSL_TIME_SPEC_DAY_new
Unexecuted instantiation: OSSL_TIME_SPEC_WEEKS_new
Unexecuted instantiation: OSSL_TIME_SPEC_MONTH_new
Unexecuted instantiation: OSSL_NAMED_DAY_new
Unexecuted instantiation: OSSL_TIME_SPEC_X_DAY_OF_new
Unexecuted instantiation: OSSL_TIME_SPEC_ABSOLUTE_new
Unexecuted instantiation: OSSL_TIME_SPEC_TIME_new
Unexecuted instantiation: OSSL_TIME_SPEC_new
Unexecuted instantiation: OSSL_TIME_PERIOD_new
Unexecuted instantiation: TLS_FEATURE_new
Unexecuted instantiation: OSSL_USER_NOTICE_SYNTAX_new
Unexecuted instantiation: X509_ACERT_new
Unexecuted instantiation: X509_ACERT_INFO_new
Unexecuted instantiation: OSSL_ISSUER_SERIAL_new
Unexecuted instantiation: OSSL_OBJECT_DIGEST_INFO_new
Unexecuted instantiation: X509_ACERT_ISSUER_V2FORM_new
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_CHOICE_new
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_ITEM_new
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_SYNTAX_new
Unexecuted instantiation: OSSL_TARGET_new
Unexecuted instantiation: OSSL_TARGETS_new
Unexecuted instantiation: OSSL_TARGETING_INFORMATION_new
Unexecuted instantiation: NAMING_AUTHORITY_new
Unexecuted instantiation: PROFESSION_INFO_new
Unexecuted instantiation: ADMISSIONS_new
Unexecuted instantiation: ADMISSION_SYNTAX_new
Unexecuted instantiation: OSSL_HASH_new
Unexecuted instantiation: OSSL_INFO_SYNTAX_new
Unexecuted instantiation: OSSL_INFO_SYNTAX_POINTER_new
Unexecuted instantiation: OSSL_PRIVILEGE_POLICY_ID_new
Unexecuted instantiation: OSSL_ATTRIBUTE_DESCRIPTOR_new
Unexecuted instantiation: OSSL_ATAV_new
Unexecuted instantiation: OSSL_ATTRIBUTE_TYPE_MAPPING_new
Unexecuted instantiation: OSSL_ATTRIBUTE_VALUE_MAPPING_new
Unexecuted instantiation: OSSL_ATTRIBUTE_MAPPING_new
Unexecuted instantiation: OSSL_ATTRIBUTE_MAPPINGS_new
Unexecuted instantiation: OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_new
Unexecuted instantiation: OSSL_BASIC_ATTR_CONSTRAINTS_new
Unexecuted instantiation: EXTENDED_KEY_USAGE_new
Unexecuted instantiation: ISSUER_SIGN_TOOL_new
803
    void fname##_free(stname *a)                                    \
804
0
    {                                                               \
805
0
        ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname));    \
806
0
    }
Unexecuted instantiation: X509_ATTRIBUTE_free
Unexecuted instantiation: X509_NAME_ENTRY_free
Unexecuted instantiation: X509_NAME_free
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_free
Unexecuted instantiation: ASN1_NULL_free
Unexecuted instantiation: ASN1_TYPE_free
Unexecuted instantiation: ASN1_PRINTABLE_free
Unexecuted instantiation: DISPLAYTEXT_free
Unexecuted instantiation: DIRECTORYSTRING_free
Unexecuted instantiation: X509_ALGOR_free
Unexecuted instantiation: X509_SIG_free
Unexecuted instantiation: X9_62_PENTANOMIAL_free
Unexecuted instantiation: X9_62_CHARACTERISTIC_TWO_free
Unexecuted instantiation: ECPARAMETERS_free
Unexecuted instantiation: ECPKPARAMETERS_free
Unexecuted instantiation: EC_PRIVATEKEY_free
Unexecuted instantiation: PKCS7_SIGNED_free
Unexecuted instantiation: PKCS7_SIGNER_INFO_free
Unexecuted instantiation: PKCS7_ISSUER_AND_SERIAL_free
Unexecuted instantiation: PKCS7_ENVELOPE_free
Unexecuted instantiation: PKCS7_RECIP_INFO_free
Unexecuted instantiation: PKCS7_ENC_CONTENT_free
Unexecuted instantiation: PKCS7_SIGN_ENVELOPE_free
Unexecuted instantiation: PKCS7_ENCRYPT_free
Unexecuted instantiation: PKCS7_DIGEST_free
Unexecuted instantiation: RSA_PSS_PARAMS_free
Unexecuted instantiation: RSA_OAEP_PARAMS_free
Unexecuted instantiation: SM2_Ciphertext_free
Unexecuted instantiation: X509_REVOKED_free
Unexecuted instantiation: X509_CRL_INFO_free
Unexecuted instantiation: X509_CRL_free
Unexecuted instantiation: X509_EXTENSION_free
Unexecuted instantiation: X509_PUBKEY_free
Unexecuted instantiation: X509_REQ_INFO_free
Unexecuted instantiation: X509_REQ_free
Unexecuted instantiation: X509_CINF_free
Unexecuted instantiation: X509_free
Unexecuted instantiation: X509_CERT_AUX_free
Unexecuted instantiation: ASN1_TIME_free
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_free
Unexecuted instantiation: PBEPARAM_free
Unexecuted instantiation: PBE2PARAM_free
Unexecuted instantiation: PBKDF2PARAM_free
Unexecuted instantiation: PBMAC1PARAM_free
Unexecuted instantiation: SCRYPT_PARAMS_free
Unexecuted instantiation: NETSCAPE_SPKAC_free
Unexecuted instantiation: NETSCAPE_SPKI_free
Unexecuted instantiation: X509_VAL_free
Unexecuted instantiation: OCSP_SIGNATURE_free
Unexecuted instantiation: OCSP_CERTID_free
Unexecuted instantiation: OCSP_ONEREQ_free
Unexecuted instantiation: OCSP_REQINFO_free
Unexecuted instantiation: OCSP_REQUEST_free
Unexecuted instantiation: OCSP_RESPBYTES_free
Unexecuted instantiation: OCSP_RESPONSE_free
Unexecuted instantiation: OCSP_RESPID_free
Unexecuted instantiation: OCSP_REVOKEDINFO_free
Unexecuted instantiation: OCSP_CERTSTATUS_free
Unexecuted instantiation: OCSP_SINGLERESP_free
Unexecuted instantiation: OCSP_RESPDATA_free
Unexecuted instantiation: OCSP_BASICRESP_free
Unexecuted instantiation: OCSP_CRLID_free
Unexecuted instantiation: OCSP_SERVICELOC_free
Unexecuted instantiation: PKCS12_MAC_DATA_free
Unexecuted instantiation: PKCS12_BAGS_free
Unexecuted instantiation: PKCS12_SAFEBAG_free
Unexecuted instantiation: IPAddressRange_free
Unexecuted instantiation: IPAddressOrRange_free
Unexecuted instantiation: IPAddressChoice_free
Unexecuted instantiation: IPAddressFamily_free
Unexecuted instantiation: AUTHORITY_KEYID_free
Unexecuted instantiation: ASRange_free
Unexecuted instantiation: ASIdOrRange_free
Unexecuted instantiation: ASIdentifierChoice_free
Unexecuted instantiation: ASIdentifiers_free
Unexecuted instantiation: BASIC_CONSTRAINTS_free
Unexecuted instantiation: CERTIFICATEPOLICIES_free
Unexecuted instantiation: POLICYINFO_free
Unexecuted instantiation: POLICYQUALINFO_free
Unexecuted instantiation: USERNOTICE_free
Unexecuted instantiation: NOTICEREF_free
Unexecuted instantiation: DIST_POINT_NAME_free
Unexecuted instantiation: DIST_POINT_free
Unexecuted instantiation: CRL_DIST_POINTS_free
Unexecuted instantiation: ISSUING_DIST_POINT_free
Unexecuted instantiation: OSSL_AA_DIST_POINT_free
Unexecuted instantiation: OTHERNAME_free
Unexecuted instantiation: EDIPARTYNAME_free
Unexecuted instantiation: GENERAL_NAME_free
Unexecuted instantiation: GENERAL_NAMES_free
Unexecuted instantiation: ACCESS_DESCRIPTION_free
Unexecuted instantiation: AUTHORITY_INFO_ACCESS_free
Unexecuted instantiation: GENERAL_SUBTREE_free
Unexecuted instantiation: NAME_CONSTRAINTS_free
Unexecuted instantiation: PROXY_POLICY_free
Unexecuted instantiation: PROXY_CERT_INFO_EXTENSION_free
Unexecuted instantiation: POLICY_CONSTRAINTS_free
Unexecuted instantiation: PKEY_USAGE_PERIOD_free
Unexecuted instantiation: POLICY_MAPPING_free
Unexecuted instantiation: OSSL_ROLE_SPEC_CERT_ID_free
Unexecuted instantiation: OSSL_ROLE_SPEC_CERT_ID_SYNTAX_free
Unexecuted instantiation: OSSL_ATTRIBUTES_SYNTAX_free
Unexecuted instantiation: SXNETID_free
Unexecuted instantiation: SXNET_free
Unexecuted instantiation: OSSL_DAY_TIME_free
Unexecuted instantiation: OSSL_DAY_TIME_BAND_free
Unexecuted instantiation: OSSL_TIME_SPEC_DAY_free
Unexecuted instantiation: OSSL_TIME_SPEC_WEEKS_free
Unexecuted instantiation: OSSL_TIME_SPEC_MONTH_free
Unexecuted instantiation: OSSL_NAMED_DAY_free
Unexecuted instantiation: OSSL_TIME_SPEC_X_DAY_OF_free
Unexecuted instantiation: OSSL_TIME_SPEC_ABSOLUTE_free
Unexecuted instantiation: OSSL_TIME_SPEC_TIME_free
Unexecuted instantiation: OSSL_TIME_SPEC_free
Unexecuted instantiation: OSSL_TIME_PERIOD_free
Unexecuted instantiation: TLS_FEATURE_free
Unexecuted instantiation: OSSL_USER_NOTICE_SYNTAX_free
Unexecuted instantiation: X509_ACERT_free
Unexecuted instantiation: X509_ACERT_INFO_free
Unexecuted instantiation: OSSL_ISSUER_SERIAL_free
Unexecuted instantiation: OSSL_OBJECT_DIGEST_INFO_free
Unexecuted instantiation: X509_ACERT_ISSUER_V2FORM_free
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_CHOICE_free
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_ITEM_free
Unexecuted instantiation: OSSL_ALLOWED_ATTRIBUTES_SYNTAX_free
Unexecuted instantiation: OSSL_TARGET_free
Unexecuted instantiation: OSSL_TARGETS_free
Unexecuted instantiation: OSSL_TARGETING_INFORMATION_free
Unexecuted instantiation: NAMING_AUTHORITY_free
Unexecuted instantiation: PROFESSION_INFO_free
Unexecuted instantiation: ADMISSIONS_free
Unexecuted instantiation: ADMISSION_SYNTAX_free
Unexecuted instantiation: OSSL_HASH_free
Unexecuted instantiation: OSSL_INFO_SYNTAX_free
Unexecuted instantiation: OSSL_INFO_SYNTAX_POINTER_free
Unexecuted instantiation: OSSL_PRIVILEGE_POLICY_ID_free
Unexecuted instantiation: OSSL_ATTRIBUTE_DESCRIPTOR_free
Unexecuted instantiation: OSSL_ATAV_free
Unexecuted instantiation: OSSL_ATTRIBUTE_TYPE_MAPPING_free
Unexecuted instantiation: OSSL_ATTRIBUTE_VALUE_MAPPING_free
Unexecuted instantiation: OSSL_ATTRIBUTE_MAPPING_free
Unexecuted instantiation: OSSL_ATTRIBUTE_MAPPINGS_free
Unexecuted instantiation: OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX_free
Unexecuted instantiation: OSSL_BASIC_ATTR_CONSTRAINTS_free
Unexecuted instantiation: EXTENDED_KEY_USAGE_free
Unexecuted instantiation: ISSUER_SIGN_TOOL_free
807
808
#define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname)    \
809
    IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
810
    IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
811
812
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)                       \
813
    stname *d2i_##fname(stname **a, const unsigned char **in, long len)                    \
814
0
    {                                                                                      \
815
0
        return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname)); \
816
0
    }                                                                                      \
Unexecuted instantiation: d2i_X509_ATTRIBUTE
Unexecuted instantiation: d2i_X509_NAME_ENTRY
Unexecuted instantiation: d2i_X509_NAME
Unexecuted instantiation: d2i_PKCS8_PRIV_KEY_INFO
Unexecuted instantiation: d2i_ASN1_OCTET_STRING
Unexecuted instantiation: d2i_ASN1_INTEGER
Unexecuted instantiation: d2i_ASN1_ENUMERATED
Unexecuted instantiation: d2i_ASN1_BIT_STRING
Unexecuted instantiation: d2i_ASN1_UTF8STRING
Unexecuted instantiation: d2i_ASN1_PRINTABLESTRING
Unexecuted instantiation: d2i_ASN1_T61STRING
Unexecuted instantiation: d2i_ASN1_IA5STRING
Unexecuted instantiation: d2i_ASN1_GENERALSTRING
Unexecuted instantiation: d2i_ASN1_UTCTIME
Unexecuted instantiation: d2i_ASN1_GENERALIZEDTIME
Unexecuted instantiation: d2i_ASN1_VISIBLESTRING
Unexecuted instantiation: d2i_ASN1_UNIVERSALSTRING
Unexecuted instantiation: d2i_ASN1_BMPSTRING
Unexecuted instantiation: d2i_ASN1_NULL
Unexecuted instantiation: d2i_ASN1_TYPE
Unexecuted instantiation: d2i_ASN1_PRINTABLE
Unexecuted instantiation: d2i_DISPLAYTEXT
Unexecuted instantiation: d2i_DIRECTORYSTRING
Unexecuted instantiation: d2i_ASN1_SEQUENCE_ANY
Unexecuted instantiation: d2i_ASN1_SET_ANY
Unexecuted instantiation: d2i_X509_ALGOR
Unexecuted instantiation: d2i_X509_ALGORS
Unexecuted instantiation: d2i_X509_SIG
Unexecuted instantiation: d2i_DHparams
Unexecuted instantiation: d2i_int_dhx
Unexecuted instantiation: d2i_DSAPrivateKey
Unexecuted instantiation: d2i_DSAparams
Unexecuted instantiation: d2i_DSAPublicKey
Unexecuted instantiation: d2i_ECPKPARAMETERS
Unexecuted instantiation: d2i_EC_PRIVATEKEY
Unexecuted instantiation: d2i_PKCS7_SIGNED
Unexecuted instantiation: d2i_PKCS7_SIGNER_INFO
Unexecuted instantiation: d2i_PKCS7_ISSUER_AND_SERIAL
Unexecuted instantiation: d2i_PKCS7_ENVELOPE
Unexecuted instantiation: d2i_PKCS7_RECIP_INFO
Unexecuted instantiation: d2i_PKCS7_ENC_CONTENT
Unexecuted instantiation: d2i_PKCS7_SIGN_ENVELOPE
Unexecuted instantiation: d2i_PKCS7_ENCRYPT
Unexecuted instantiation: d2i_PKCS7_DIGEST
Unexecuted instantiation: d2i_RSA_PSS_PARAMS
Unexecuted instantiation: d2i_RSA_OAEP_PARAMS
Unexecuted instantiation: d2i_RSAPrivateKey
Unexecuted instantiation: d2i_RSAPublicKey
Unexecuted instantiation: d2i_SM2_Ciphertext
Unexecuted instantiation: d2i_X509_REVOKED
Unexecuted instantiation: d2i_X509_CRL_INFO
Unexecuted instantiation: d2i_X509_CRL
Unexecuted instantiation: d2i_X509_EXTENSION
Unexecuted instantiation: d2i_X509_EXTENSIONS
Unexecuted instantiation: d2i_X509_PUBKEY
Unexecuted instantiation: d2i_X509_REQ_INFO
Unexecuted instantiation: d2i_X509_REQ
Unexecuted instantiation: d2i_X509_CINF
Unexecuted instantiation: d2i_X509
Unexecuted instantiation: d2i_X509_CERT_AUX
Unexecuted instantiation: d2i_ASN1_TIME
Unexecuted instantiation: d2i_NETSCAPE_CERT_SEQUENCE
Unexecuted instantiation: d2i_PBEPARAM
Unexecuted instantiation: d2i_PBE2PARAM
Unexecuted instantiation: d2i_PBKDF2PARAM
Unexecuted instantiation: d2i_PBMAC1PARAM
Unexecuted instantiation: d2i_SCRYPT_PARAMS
Unexecuted instantiation: d2i_NETSCAPE_SPKAC
Unexecuted instantiation: d2i_NETSCAPE_SPKI
Unexecuted instantiation: d2i_X509_VAL
Unexecuted instantiation: d2i_OCSP_SIGNATURE
Unexecuted instantiation: d2i_OCSP_CERTID
Unexecuted instantiation: d2i_OCSP_ONEREQ
Unexecuted instantiation: d2i_OCSP_REQINFO
Unexecuted instantiation: d2i_OCSP_REQUEST
Unexecuted instantiation: d2i_OCSP_RESPBYTES
Unexecuted instantiation: d2i_OCSP_RESPONSE
Unexecuted instantiation: d2i_OCSP_RESPID
Unexecuted instantiation: d2i_OCSP_REVOKEDINFO
Unexecuted instantiation: d2i_OCSP_CERTSTATUS
Unexecuted instantiation: d2i_OCSP_SINGLERESP
Unexecuted instantiation: d2i_OCSP_RESPDATA
Unexecuted instantiation: d2i_OCSP_BASICRESP
Unexecuted instantiation: d2i_OCSP_CRLID
Unexecuted instantiation: d2i_OCSP_SERVICELOC
Unexecuted instantiation: d2i_PKCS12
Unexecuted instantiation: d2i_PKCS12_MAC_DATA
Unexecuted instantiation: d2i_PKCS12_BAGS
Unexecuted instantiation: d2i_PKCS12_SAFEBAG
Unexecuted instantiation: d2i_IPAddressRange
Unexecuted instantiation: d2i_IPAddressOrRange
Unexecuted instantiation: d2i_IPAddressChoice
Unexecuted instantiation: d2i_IPAddressFamily
Unexecuted instantiation: d2i_AUTHORITY_KEYID
Unexecuted instantiation: d2i_ASRange
Unexecuted instantiation: d2i_ASIdOrRange
Unexecuted instantiation: d2i_ASIdentifierChoice
Unexecuted instantiation: d2i_ASIdentifiers
Unexecuted instantiation: d2i_BASIC_CONSTRAINTS
Unexecuted instantiation: d2i_CERTIFICATEPOLICIES
Unexecuted instantiation: d2i_POLICYINFO
Unexecuted instantiation: d2i_POLICYQUALINFO
Unexecuted instantiation: d2i_USERNOTICE
Unexecuted instantiation: d2i_NOTICEREF
Unexecuted instantiation: d2i_DIST_POINT_NAME
Unexecuted instantiation: d2i_DIST_POINT
Unexecuted instantiation: d2i_CRL_DIST_POINTS
Unexecuted instantiation: d2i_ISSUING_DIST_POINT
Unexecuted instantiation: d2i_OSSL_AA_DIST_POINT
Unexecuted instantiation: d2i_OTHERNAME
Unexecuted instantiation: d2i_EDIPARTYNAME
Unexecuted instantiation: d2i_GENERAL_NAME
Unexecuted instantiation: d2i_GENERAL_NAMES
Unexecuted instantiation: d2i_ACCESS_DESCRIPTION
Unexecuted instantiation: d2i_AUTHORITY_INFO_ACCESS
Unexecuted instantiation: d2i_PROXY_POLICY
Unexecuted instantiation: d2i_PROXY_CERT_INFO_EXTENSION
Unexecuted instantiation: d2i_PKEY_USAGE_PERIOD
Unexecuted instantiation: d2i_OSSL_ROLE_SPEC_CERT_ID
Unexecuted instantiation: d2i_OSSL_ROLE_SPEC_CERT_ID_SYNTAX
Unexecuted instantiation: d2i_OSSL_ATTRIBUTES_SYNTAX
Unexecuted instantiation: d2i_SXNETID
Unexecuted instantiation: d2i_SXNET
Unexecuted instantiation: d2i_OSSL_DAY_TIME
Unexecuted instantiation: d2i_OSSL_DAY_TIME_BAND
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_DAY
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_WEEKS
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_MONTH
Unexecuted instantiation: d2i_OSSL_NAMED_DAY
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_X_DAY_OF
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_ABSOLUTE
Unexecuted instantiation: d2i_OSSL_TIME_SPEC_TIME
Unexecuted instantiation: d2i_OSSL_TIME_SPEC
Unexecuted instantiation: d2i_OSSL_TIME_PERIOD
Unexecuted instantiation: d2i_OSSL_USER_NOTICE_SYNTAX
Unexecuted instantiation: d2i_X509_ACERT
Unexecuted instantiation: d2i_OSSL_ALLOWED_ATTRIBUTES_CHOICE
Unexecuted instantiation: d2i_OSSL_ALLOWED_ATTRIBUTES_ITEM
Unexecuted instantiation: d2i_OSSL_ALLOWED_ATTRIBUTES_SYNTAX
Unexecuted instantiation: d2i_OSSL_TARGET
Unexecuted instantiation: d2i_OSSL_TARGETS
Unexecuted instantiation: d2i_OSSL_TARGETING_INFORMATION
Unexecuted instantiation: d2i_NAMING_AUTHORITY
Unexecuted instantiation: d2i_PROFESSION_INFO
Unexecuted instantiation: d2i_ADMISSIONS
Unexecuted instantiation: d2i_ADMISSION_SYNTAX
Unexecuted instantiation: d2i_OSSL_HASH
Unexecuted instantiation: d2i_OSSL_INFO_SYNTAX
Unexecuted instantiation: d2i_OSSL_INFO_SYNTAX_POINTER
Unexecuted instantiation: d2i_OSSL_PRIVILEGE_POLICY_ID
Unexecuted instantiation: d2i_OSSL_ATTRIBUTE_DESCRIPTOR
Unexecuted instantiation: d2i_OSSL_ATAV
Unexecuted instantiation: d2i_OSSL_ATTRIBUTE_TYPE_MAPPING
Unexecuted instantiation: d2i_OSSL_ATTRIBUTE_VALUE_MAPPING
Unexecuted instantiation: d2i_OSSL_ATTRIBUTE_MAPPING
Unexecuted instantiation: d2i_OSSL_ATTRIBUTE_MAPPINGS
Unexecuted instantiation: d2i_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX
Unexecuted instantiation: d2i_OSSL_BASIC_ATTR_CONSTRAINTS
Unexecuted instantiation: d2i_EXTENDED_KEY_USAGE
Unexecuted instantiation: d2i_ISSUER_SIGN_TOOL
817
    int i2d_##fname(const stname *a, unsigned char **out)                                  \
818
0
    {                                                                                      \
819
0
        return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));          \
820
0
    }
Unexecuted instantiation: i2d_X509_ATTRIBUTE
Unexecuted instantiation: i2d_X509_NAME_ENTRY
Unexecuted instantiation: i2d_X509_NAME
Unexecuted instantiation: i2d_PKCS8_PRIV_KEY_INFO
Unexecuted instantiation: i2d_ASN1_OCTET_STRING
Unexecuted instantiation: i2d_ASN1_INTEGER
Unexecuted instantiation: i2d_ASN1_ENUMERATED
Unexecuted instantiation: i2d_ASN1_BIT_STRING
Unexecuted instantiation: i2d_ASN1_UTF8STRING
Unexecuted instantiation: i2d_ASN1_PRINTABLESTRING
Unexecuted instantiation: i2d_ASN1_T61STRING
Unexecuted instantiation: i2d_ASN1_IA5STRING
Unexecuted instantiation: i2d_ASN1_GENERALSTRING
Unexecuted instantiation: i2d_ASN1_UTCTIME
Unexecuted instantiation: i2d_ASN1_GENERALIZEDTIME
Unexecuted instantiation: i2d_ASN1_VISIBLESTRING
Unexecuted instantiation: i2d_ASN1_UNIVERSALSTRING
Unexecuted instantiation: i2d_ASN1_BMPSTRING
Unexecuted instantiation: i2d_ASN1_NULL
Unexecuted instantiation: i2d_ASN1_TYPE
Unexecuted instantiation: i2d_ASN1_PRINTABLE
Unexecuted instantiation: i2d_DISPLAYTEXT
Unexecuted instantiation: i2d_DIRECTORYSTRING
Unexecuted instantiation: i2d_ASN1_SEQUENCE_ANY
Unexecuted instantiation: i2d_ASN1_SET_ANY
Unexecuted instantiation: i2d_X509_ALGOR
Unexecuted instantiation: i2d_X509_ALGORS
Unexecuted instantiation: i2d_X509_SIG
Unexecuted instantiation: i2d_DHparams
Unexecuted instantiation: i2d_int_dhx
Unexecuted instantiation: i2d_DSAPrivateKey
Unexecuted instantiation: i2d_DSAparams
Unexecuted instantiation: i2d_DSAPublicKey
Unexecuted instantiation: i2d_ECPKPARAMETERS
Unexecuted instantiation: i2d_EC_PRIVATEKEY
Unexecuted instantiation: i2d_PKCS7_SIGNED
Unexecuted instantiation: i2d_PKCS7_SIGNER_INFO
Unexecuted instantiation: i2d_PKCS7_ISSUER_AND_SERIAL
Unexecuted instantiation: i2d_PKCS7_ENVELOPE
Unexecuted instantiation: i2d_PKCS7_RECIP_INFO
Unexecuted instantiation: i2d_PKCS7_ENC_CONTENT
Unexecuted instantiation: i2d_PKCS7_SIGN_ENVELOPE
Unexecuted instantiation: i2d_PKCS7_ENCRYPT
Unexecuted instantiation: i2d_PKCS7_DIGEST
Unexecuted instantiation: i2d_RSA_PSS_PARAMS
Unexecuted instantiation: i2d_RSA_OAEP_PARAMS
Unexecuted instantiation: i2d_RSAPrivateKey
Unexecuted instantiation: i2d_RSAPublicKey
Unexecuted instantiation: i2d_SM2_Ciphertext
Unexecuted instantiation: i2d_X509_REVOKED
Unexecuted instantiation: i2d_X509_CRL_INFO
Unexecuted instantiation: i2d_X509_CRL
Unexecuted instantiation: i2d_X509_EXTENSION
Unexecuted instantiation: i2d_X509_EXTENSIONS
Unexecuted instantiation: i2d_X509_PUBKEY
Unexecuted instantiation: i2d_X509_REQ_INFO
Unexecuted instantiation: i2d_X509_REQ
Unexecuted instantiation: i2d_X509_CINF
Unexecuted instantiation: i2d_X509
Unexecuted instantiation: i2d_X509_CERT_AUX
Unexecuted instantiation: i2d_ASN1_TIME
Unexecuted instantiation: i2d_NETSCAPE_CERT_SEQUENCE
Unexecuted instantiation: i2d_PBEPARAM
Unexecuted instantiation: i2d_PBE2PARAM
Unexecuted instantiation: i2d_PBKDF2PARAM
Unexecuted instantiation: i2d_PBMAC1PARAM
Unexecuted instantiation: i2d_SCRYPT_PARAMS
Unexecuted instantiation: i2d_NETSCAPE_SPKAC
Unexecuted instantiation: i2d_NETSCAPE_SPKI
Unexecuted instantiation: i2d_X509_VAL
Unexecuted instantiation: i2d_OCSP_SIGNATURE
Unexecuted instantiation: i2d_OCSP_CERTID
Unexecuted instantiation: i2d_OCSP_ONEREQ
Unexecuted instantiation: i2d_OCSP_REQINFO
Unexecuted instantiation: i2d_OCSP_REQUEST
Unexecuted instantiation: i2d_OCSP_RESPBYTES
Unexecuted instantiation: i2d_OCSP_RESPONSE
Unexecuted instantiation: i2d_OCSP_RESPID
Unexecuted instantiation: i2d_OCSP_REVOKEDINFO
Unexecuted instantiation: i2d_OCSP_CERTSTATUS
Unexecuted instantiation: i2d_OCSP_SINGLERESP
Unexecuted instantiation: i2d_OCSP_RESPDATA
Unexecuted instantiation: i2d_OCSP_BASICRESP
Unexecuted instantiation: i2d_OCSP_CRLID
Unexecuted instantiation: i2d_OCSP_SERVICELOC
Unexecuted instantiation: i2d_PKCS12
Unexecuted instantiation: i2d_PKCS12_MAC_DATA
Unexecuted instantiation: i2d_PKCS12_BAGS
Unexecuted instantiation: i2d_PKCS12_SAFEBAG
Unexecuted instantiation: i2d_IPAddressRange
Unexecuted instantiation: i2d_IPAddressOrRange
Unexecuted instantiation: i2d_IPAddressChoice
Unexecuted instantiation: i2d_IPAddressFamily
Unexecuted instantiation: i2d_AUTHORITY_KEYID
Unexecuted instantiation: i2d_ASRange
Unexecuted instantiation: i2d_ASIdOrRange
Unexecuted instantiation: i2d_ASIdentifierChoice
Unexecuted instantiation: i2d_ASIdentifiers
Unexecuted instantiation: i2d_BASIC_CONSTRAINTS
Unexecuted instantiation: i2d_CERTIFICATEPOLICIES
Unexecuted instantiation: i2d_POLICYINFO
Unexecuted instantiation: i2d_POLICYQUALINFO
Unexecuted instantiation: i2d_USERNOTICE
Unexecuted instantiation: i2d_NOTICEREF
Unexecuted instantiation: i2d_DIST_POINT_NAME
Unexecuted instantiation: i2d_DIST_POINT
Unexecuted instantiation: i2d_CRL_DIST_POINTS
Unexecuted instantiation: i2d_ISSUING_DIST_POINT
Unexecuted instantiation: i2d_OSSL_AA_DIST_POINT
Unexecuted instantiation: i2d_OTHERNAME
Unexecuted instantiation: i2d_EDIPARTYNAME
Unexecuted instantiation: i2d_GENERAL_NAME
Unexecuted instantiation: i2d_GENERAL_NAMES
Unexecuted instantiation: i2d_ACCESS_DESCRIPTION
Unexecuted instantiation: i2d_AUTHORITY_INFO_ACCESS
Unexecuted instantiation: i2d_PROXY_POLICY
Unexecuted instantiation: i2d_PROXY_CERT_INFO_EXTENSION
Unexecuted instantiation: i2d_PKEY_USAGE_PERIOD
Unexecuted instantiation: i2d_OSSL_ROLE_SPEC_CERT_ID
Unexecuted instantiation: i2d_OSSL_ROLE_SPEC_CERT_ID_SYNTAX
Unexecuted instantiation: i2d_OSSL_ATTRIBUTES_SYNTAX
Unexecuted instantiation: i2d_SXNETID
Unexecuted instantiation: i2d_SXNET
Unexecuted instantiation: i2d_OSSL_DAY_TIME
Unexecuted instantiation: i2d_OSSL_DAY_TIME_BAND
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_DAY
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_WEEKS
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_MONTH
Unexecuted instantiation: i2d_OSSL_NAMED_DAY
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_X_DAY_OF
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_ABSOLUTE
Unexecuted instantiation: i2d_OSSL_TIME_SPEC_TIME
Unexecuted instantiation: i2d_OSSL_TIME_SPEC
Unexecuted instantiation: i2d_OSSL_TIME_PERIOD
Unexecuted instantiation: i2d_OSSL_USER_NOTICE_SYNTAX
Unexecuted instantiation: i2d_X509_ACERT
Unexecuted instantiation: i2d_OSSL_ALLOWED_ATTRIBUTES_CHOICE
Unexecuted instantiation: i2d_OSSL_ALLOWED_ATTRIBUTES_ITEM
Unexecuted instantiation: i2d_OSSL_ALLOWED_ATTRIBUTES_SYNTAX
Unexecuted instantiation: i2d_OSSL_TARGET
Unexecuted instantiation: i2d_OSSL_TARGETS
Unexecuted instantiation: i2d_OSSL_TARGETING_INFORMATION
Unexecuted instantiation: i2d_NAMING_AUTHORITY
Unexecuted instantiation: i2d_PROFESSION_INFO
Unexecuted instantiation: i2d_ADMISSIONS
Unexecuted instantiation: i2d_ADMISSION_SYNTAX
Unexecuted instantiation: i2d_OSSL_HASH
Unexecuted instantiation: i2d_OSSL_INFO_SYNTAX
Unexecuted instantiation: i2d_OSSL_INFO_SYNTAX_POINTER
Unexecuted instantiation: i2d_OSSL_PRIVILEGE_POLICY_ID
Unexecuted instantiation: i2d_OSSL_ATTRIBUTE_DESCRIPTOR
Unexecuted instantiation: i2d_OSSL_ATAV
Unexecuted instantiation: i2d_OSSL_ATTRIBUTE_TYPE_MAPPING
Unexecuted instantiation: i2d_OSSL_ATTRIBUTE_VALUE_MAPPING
Unexecuted instantiation: i2d_OSSL_ATTRIBUTE_MAPPING
Unexecuted instantiation: i2d_OSSL_ATTRIBUTE_MAPPINGS
Unexecuted instantiation: i2d_OSSL_AUTHORITY_ATTRIBUTE_ID_SYNTAX
Unexecuted instantiation: i2d_OSSL_BASIC_ATTR_CONSTRAINTS
Unexecuted instantiation: i2d_EXTENDED_KEY_USAGE
Unexecuted instantiation: i2d_ISSUER_SIGN_TOOL
821
822
#define IMPLEMENT_ASN1_NDEF_FUNCTION(stname)                                           \
823
    int i2d_##stname##_NDEF(const stname *a, unsigned char **out)                      \
824
0
    {                                                                                  \
825
0
        return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname)); \
826
0
    }
827
828
#define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname)            \
829
    static stname *d2i_##stname(stname **a,                       \
830
        const unsigned char **in, long len)                       \
831
    {                                                             \
832
        return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
833
            ASN1_ITEM_rptr(stname));                              \
834
    }                                                             \
835
    static int i2d_##stname(const stname *a, unsigned char **out) \
836
    {                                                             \
837
        return ASN1_item_i2d((const ASN1_VALUE *)a, out,          \
838
            ASN1_ITEM_rptr(stname));                              \
839
    }
840
841
#define IMPLEMENT_ASN1_DUP_FUNCTION(stname)              \
842
    stname *stname##_dup(const stname *x)                \
843
0
    {                                                    \
844
0
        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
845
0
    }
Unexecuted instantiation: X509_ATTRIBUTE_dup
Unexecuted instantiation: X509_NAME_ENTRY_dup
Unexecuted instantiation: X509_NAME_dup
Unexecuted instantiation: X509_ALGOR_dup
Unexecuted instantiation: PKCS7_dup
Unexecuted instantiation: RSA_PSS_PARAMS_dup
Unexecuted instantiation: X509_REVOKED_dup
Unexecuted instantiation: X509_CRL_dup
Unexecuted instantiation: X509_EXTENSION_dup
Unexecuted instantiation: X509_REQ_dup
Unexecuted instantiation: X509_dup
Unexecuted instantiation: ASN1_GENERALIZEDTIME_dup
Unexecuted instantiation: ASN1_TIME_dup
Unexecuted instantiation: ASN1_UTCTIME_dup
Unexecuted instantiation: OCSP_CERTID_dup
Unexecuted instantiation: DIST_POINT_NAME_dup
Unexecuted instantiation: X509_ACERT_dup
846
847
#define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
848
    IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
849
850
#define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
851
    int fname##_print_ctx(BIO *out, const stname *x, int indent,   \
852
        const ASN1_PCTX *pctx)                                     \
853
0
    {                                                              \
854
0
        return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \
855
0
            ASN1_ITEM_rptr(itname), pctx);                         \
856
0
    }
857
858
/* external definitions for primitive types */
859
860
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
861
DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
862
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
863
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
864
DECLARE_ASN1_ITEM(CBIGNUM)
865
DECLARE_ASN1_ITEM(BIGNUM)
866
DECLARE_ASN1_ITEM(INT32)
867
DECLARE_ASN1_ITEM(ZINT32)
868
DECLARE_ASN1_ITEM(UINT32)
869
DECLARE_ASN1_ITEM(ZUINT32)
870
DECLARE_ASN1_ITEM(INT64)
871
DECLARE_ASN1_ITEM(ZINT64)
872
DECLARE_ASN1_ITEM(UINT64)
873
DECLARE_ASN1_ITEM(ZUINT64)
874
875
#ifndef OPENSSL_NO_DEPRECATED_3_0
876
/*
877
 * LONG and ZLONG are strongly discouraged for use as stored data, as the
878
 * underlying C type (long) differs in size depending on the architecture.
879
 * They are designed with 32-bit longs in mind.
880
 */
881
DECLARE_ASN1_ITEM(LONG)
882
DECLARE_ASN1_ITEM(ZLONG)
883
#endif
884
885
/* clang-format off */
886
SKM_DEFINE_STACK_OF_INTERNAL(ASN1_VALUE, ASN1_VALUE, ASN1_VALUE)
887
0
#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
888
0
#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
889
#define sk_ASN1_VALUE_new(cmp) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new(ossl_check_ASN1_VALUE_compfunc_type(cmp)))
890
0
#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
891
#define sk_ASN1_VALUE_new_reserve(cmp, n) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_VALUE_compfunc_type(cmp), (n)))
892
#define sk_ASN1_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_VALUE_sk_type(sk), (n))
893
0
#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
894
#define sk_ASN1_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_VALUE_sk_type(sk))
895
#define sk_ASN1_VALUE_delete(sk, i) ((ASN1_VALUE *)OPENSSL_sk_delete(ossl_check_ASN1_VALUE_sk_type(sk), (i)))
896
#define sk_ASN1_VALUE_delete_ptr(sk, ptr) ((ASN1_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)))
897
0
#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
898
#define sk_ASN1_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
899
0
#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
900
#define sk_ASN1_VALUE_shift(sk) ((ASN1_VALUE *)OPENSSL_sk_shift(ossl_check_ASN1_VALUE_sk_type(sk)))
901
#define sk_ASN1_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_freefunc_type(freefunc))
902
#define sk_ASN1_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), (idx))
903
#define sk_ASN1_VALUE_set(sk, idx, ptr) ((ASN1_VALUE *)OPENSSL_sk_set(ossl_check_ASN1_VALUE_sk_type(sk), (idx), ossl_check_ASN1_VALUE_type(ptr)))
904
#define sk_ASN1_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
905
#define sk_ASN1_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
906
#define sk_ASN1_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), pnum)
907
#define sk_ASN1_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_VALUE_sk_type(sk))
908
#define sk_ASN1_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_VALUE_sk_type(sk))
909
#define sk_ASN1_VALUE_dup(sk) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_VALUE_sk_type(sk)))
910
#define sk_ASN1_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_copyfunc_type(copyfunc), ossl_check_ASN1_VALUE_freefunc_type(freefunc)))
911
#define sk_ASN1_VALUE_set_cmp_func(sk, cmp) ((sk_ASN1_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_compfunc_type(cmp)))
912
913
/* clang-format on */
914
915
/* Functions used internally by the ASN1 code */
916
917
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
918
void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
919
920
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
921
    const ASN1_ITEM *it, int tag, int aclass, char opt,
922
    ASN1_TLC *ctx);
923
924
int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
925
    const ASN1_ITEM *it, int tag, int aclass);
926
927
/* Legacy compatibility */
928
#define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name)
929
#define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
930
    IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)
931
932
#ifdef __cplusplus
933
}
934
#endif
935
#endif