Coverage Report

Created: 2024-05-18 12:36

/src/openssl/include/openssl/asn1t.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright 2000-2016 The OpenSSL Project Authors. All Rights Reserved.
3
 *
4
 * Licensed under the Apache License 2.0 (the "License").  You may not use
5
 * this file except in compliance with the License.  You can obtain a copy
6
 * in the file LICENSE in the source distribution or at
7
 * https://www.openssl.org/source/license.html
8
 */
9
10
#ifndef OPENSSL_ASN1T_H
11
# define OPENSSL_ASN1T_H
12
# pragma once
13
14
# include <openssl/macros.h>
15
# ifndef OPENSSL_NO_DEPRECATED_3_0
16
#  define HEADER_ASN1T_H
17
# endif
18
19
# include <stddef.h>
20
# include <openssl/e_os2.h>
21
# include <openssl/asn1.h>
22
23
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
24
#  undef OPENSSL_EXTERN
25
#  define OPENSSL_EXTERN OPENSSL_EXPORT
26
# endif
27
28
/* ASN1 template defines, structures and functions */
29
30
#ifdef  __cplusplus
31
extern "C" {
32
#endif
33
34
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
35
50.7k
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
36
37
/* Macros for start and end of ASN1_ITEM definition */
38
39
# define ASN1_ITEM_start(itname) \
40
        const ASN1_ITEM * itname##_it(void) \
41
38.6M
        { \
42
38.6M
                static const ASN1_ITEM local_it = {
43
44
# define static_ASN1_ITEM_start(itname) \
45
729k
        static ASN1_ITEM_start(itname)
46
47
# define ASN1_ITEM_end(itname) \
48
38.6M
                }; \
49
38.6M
        return &local_it; \
50
38.6M
        }
51
52
/* Macros to aid ASN1 template writing */
53
54
# define ASN1_ITEM_TEMPLATE(tname) \
55
        static const ASN1_TEMPLATE tname##_item_tt
56
57
# define ASN1_ITEM_TEMPLATE_END(tname) \
58
        ;\
59
450k
        ASN1_ITEM_start(tname) \
60
450k
                ASN1_ITYPE_PRIMITIVE,\
61
450k
                -1,\
62
450k
                &tname##_item_tt,\
63
450k
                0,\
64
450k
                NULL,\
65
450k
                0,\
66
450k
                #tname \
67
450k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_EXTENSIONS_it
Unexecuted instantiation: ASN1_SEQUENCE_ANY_it
Unexecuted instantiation: ASN1_SET_ANY_it
Unexecuted instantiation: X509_ALGORS_it
Unexecuted instantiation: PKCS7_ATTR_SIGN_it
Unexecuted instantiation: PKCS7_ATTR_VERIFY_it
CERTIFICATEPOLICIES_it
Line
Count
Source
59
5.11k
        ASN1_ITEM_start(tname) \
60
5.11k
                ASN1_ITYPE_PRIMITIVE,\
61
5.11k
                -1,\
62
5.11k
                &tname##_item_tt,\
63
5.11k
                0,\
64
5.11k
                NULL,\
65
5.11k
                0,\
66
5.11k
                #tname \
67
5.11k
        ASN1_ITEM_end(tname)
CRL_DIST_POINTS_it
Line
Count
Source
59
147k
        ASN1_ITEM_start(tname) \
60
147k
                ASN1_ITYPE_PRIMITIVE,\
61
147k
                -1,\
62
147k
                &tname##_item_tt,\
63
147k
                0,\
64
147k
                NULL,\
65
147k
                0,\
66
147k
                #tname \
67
147k
        ASN1_ITEM_end(tname)
GENERAL_NAMES_it
Line
Count
Source
59
150k
        ASN1_ITEM_start(tname) \
60
150k
                ASN1_ITYPE_PRIMITIVE,\
61
150k
                -1,\
62
150k
                &tname##_item_tt,\
63
150k
                0,\
64
150k
                NULL,\
65
150k
                0,\
66
150k
                #tname \
67
150k
        ASN1_ITEM_end(tname)
AUTHORITY_INFO_ACCESS_it
Line
Count
Source
59
4.20k
        ASN1_ITEM_start(tname) \
60
4.20k
                ASN1_ITYPE_PRIMITIVE,\
61
4.20k
                -1,\
62
4.20k
                &tname##_item_tt,\
63
4.20k
                0,\
64
4.20k
                NULL,\
65
4.20k
                0,\
66
4.20k
                #tname \
67
4.20k
        ASN1_ITEM_end(tname)
POLICY_MAPPINGS_it
Line
Count
Source
59
1.26k
        ASN1_ITEM_start(tname) \
60
1.26k
                ASN1_ITYPE_PRIMITIVE,\
61
1.26k
                -1,\
62
1.26k
                &tname##_item_tt,\
63
1.26k
                0,\
64
1.26k
                NULL,\
65
1.26k
                0,\
66
1.26k
                #tname \
67
1.26k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: CMS_Attributes_Sign_it
Unexecuted instantiation: CMS_Attributes_Verify_it
Unexecuted instantiation: PKCS12_SAFEBAGS_it
Unexecuted instantiation: PKCS12_AUTHSAFES_it
EXTENDED_KEY_USAGE_it
Line
Count
Source
59
142k
        ASN1_ITEM_start(tname) \
60
142k
                ASN1_ITYPE_PRIMITIVE,\
61
142k
                -1,\
62
142k
                &tname##_item_tt,\
63
142k
                0,\
64
142k
                NULL,\
65
142k
                0,\
66
142k
                #tname \
67
142k
        ASN1_ITEM_end(tname)
68
# define static_ASN1_ITEM_TEMPLATE_END(tname) \
69
        ;\
70
692k
        static_ASN1_ITEM_start(tname) \
71
692k
                ASN1_ITYPE_PRIMITIVE,\
72
692k
                -1,\
73
692k
                &tname##_item_tt,\
74
692k
                0,\
75
692k
                NULL,\
76
692k
                0,\
77
692k
                #tname \
78
692k
        ASN1_ITEM_end(tname)
x_name.c:X509_NAME_INTERNAL_it
Line
Count
Source
70
193k
        static_ASN1_ITEM_start(tname) \
71
193k
                ASN1_ITYPE_PRIMITIVE,\
72
193k
                -1,\
73
193k
                &tname##_item_tt,\
74
193k
                0,\
75
193k
                NULL,\
76
193k
                0,\
77
193k
                #tname \
78
193k
        ASN1_ITEM_end(tname)
x_name.c:X509_NAME_ENTRIES_it
Line
Count
Source
70
490k
        static_ASN1_ITEM_start(tname) \
71
490k
                ASN1_ITYPE_PRIMITIVE,\
72
490k
                -1,\
73
490k
                &tname##_item_tt,\
74
490k
                0,\
75
490k
                NULL,\
76
490k
                0,\
77
490k
                #tname \
78
490k
        ASN1_ITEM_end(tname)
v3_addr.c:IPAddrBlocks_it
Line
Count
Source
70
7.39k
        static_ASN1_ITEM_start(tname) \
71
7.39k
                ASN1_ITYPE_PRIMITIVE,\
72
7.39k
                -1,\
73
7.39k
                &tname##_item_tt,\
74
7.39k
                0,\
75
7.39k
                NULL,\
76
7.39k
                0,\
77
7.39k
                #tname \
78
7.39k
        ASN1_ITEM_end(tname)
v3_tlsf.c:TLS_FEATURE_it
Line
Count
Source
70
1.05k
        static_ASN1_ITEM_start(tname) \
71
1.05k
                ASN1_ITYPE_PRIMITIVE,\
72
1.05k
                -1,\
73
1.05k
                &tname##_item_tt,\
74
1.05k
                0,\
75
1.05k
                NULL,\
76
1.05k
                0,\
77
1.05k
                #tname \
78
1.05k
        ASN1_ITEM_end(tname)
79
80
/* This is a ASN1 type which just embeds a template */
81
82
/*-
83
 * This pair helps declare a SEQUENCE. We can do:
84
 *
85
 *      ASN1_SEQUENCE(stname) = {
86
 *              ... SEQUENCE components ...
87
 *      } ASN1_SEQUENCE_END(stname)
88
 *
89
 *      This will produce an ASN1_ITEM called stname_it
90
 *      for a structure called stname.
91
 *
92
 *      If you want the same structure but a different
93
 *      name then use:
94
 *
95
 *      ASN1_SEQUENCE(itname) = {
96
 *              ... SEQUENCE components ...
97
 *      } ASN1_SEQUENCE_END_name(stname, itname)
98
 *
99
 *      This will create an item called itname_it using
100
 *      a structure called stname.
101
 */
102
103
# define ASN1_SEQUENCE(tname) \
104
        static const ASN1_TEMPLATE tname##_seq_tt[]
105
106
# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
107
108
# define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname)
109
110
# define ASN1_SEQUENCE_END_name(stname, tname) \
111
        ;\
112
7.31M
        ASN1_ITEM_start(tname) \
113
7.31M
                ASN1_ITYPE_SEQUENCE,\
114
7.31M
                V_ASN1_SEQUENCE,\
115
7.31M
                tname##_seq_tt,\
116
7.31M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
7.31M
                NULL,\
118
7.31M
                sizeof(stname),\
119
7.31M
                #tname \
120
7.31M
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_REVOKED_it
X509_EXTENSION_it
Line
Count
Source
112
2.18M
        ASN1_ITEM_start(tname) \
113
2.18M
                ASN1_ITYPE_SEQUENCE,\
114
2.18M
                V_ASN1_SEQUENCE,\
115
2.18M
                tname##_seq_tt,\
116
2.18M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
2.18M
                NULL,\
118
2.18M
                sizeof(stname),\
119
2.18M
                #tname \
120
2.18M
        ASN1_ITEM_end(tname)
X509_NAME_ENTRY_it
Line
Count
Source
112
2.33M
        ASN1_ITEM_start(tname) \
113
2.33M
                ASN1_ITYPE_SEQUENCE,\
114
2.33M
                V_ASN1_SEQUENCE,\
115
2.33M
                tname##_seq_tt,\
116
2.33M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
2.33M
                NULL,\
118
2.33M
                sizeof(stname),\
119
2.33M
                #tname \
120
2.33M
        ASN1_ITEM_end(tname)
X509_CERT_AUX_it
Line
Count
Source
112
139k
        ASN1_ITEM_start(tname) \
113
139k
                ASN1_ITYPE_SEQUENCE,\
114
139k
                V_ASN1_SEQUENCE,\
115
139k
                tname##_seq_tt,\
116
139k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
139k
                NULL,\
118
139k
                sizeof(stname),\
119
139k
                #tname \
120
139k
        ASN1_ITEM_end(tname)
X509_ALGOR_it
Line
Count
Source
112
661k
        ASN1_ITEM_start(tname) \
113
661k
                ASN1_ITYPE_SEQUENCE,\
114
661k
                V_ASN1_SEQUENCE,\
115
661k
                tname##_seq_tt,\
116
661k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
661k
                NULL,\
118
661k
                sizeof(stname),\
119
661k
                #tname \
120
661k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_SIG_it
Unexecuted instantiation: NETSCAPE_SPKAC_it
Unexecuted instantiation: NETSCAPE_SPKI_it
X509_VAL_it
Line
Count
Source
112
183k
        ASN1_ITEM_start(tname) \
113
183k
                ASN1_ITYPE_SEQUENCE,\
114
183k
                V_ASN1_SEQUENCE,\
115
183k
                tname##_seq_tt,\
116
183k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
183k
                NULL,\
118
183k
                sizeof(stname),\
119
183k
                #tname \
120
183k
        ASN1_ITEM_end(tname)
ECPARAMETERS_it
Line
Count
Source
112
11.7k
        ASN1_ITEM_start(tname) \
113
11.7k
                ASN1_ITYPE_SEQUENCE,\
114
11.7k
                V_ASN1_SEQUENCE,\
115
11.7k
                tname##_seq_tt,\
116
11.7k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
11.7k
                NULL,\
118
11.7k
                sizeof(stname),\
119
11.7k
                #tname \
120
11.7k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS7_ISSUER_AND_SERIAL_it
Unexecuted instantiation: RSA_PRIME_INFO_it
IPAddressRange_it
Line
Count
Source
112
4.46k
        ASN1_ITEM_start(tname) \
113
4.46k
                ASN1_ITYPE_SEQUENCE,\
114
4.46k
                V_ASN1_SEQUENCE,\
115
4.46k
                tname##_seq_tt,\
116
4.46k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
4.46k
                NULL,\
118
4.46k
                sizeof(stname),\
119
4.46k
                #tname \
120
4.46k
        ASN1_ITEM_end(tname)
IPAddressFamily_it
Line
Count
Source
112
15.4k
        ASN1_ITEM_start(tname) \
113
15.4k
                ASN1_ITYPE_SEQUENCE,\
114
15.4k
                V_ASN1_SEQUENCE,\
115
15.4k
                tname##_seq_tt,\
116
15.4k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
15.4k
                NULL,\
118
15.4k
                sizeof(stname),\
119
15.4k
                #tname \
120
15.4k
        ASN1_ITEM_end(tname)
AUTHORITY_KEYID_it
Line
Count
Source
112
151k
        ASN1_ITEM_start(tname) \
113
151k
                ASN1_ITYPE_SEQUENCE,\
114
151k
                V_ASN1_SEQUENCE,\
115
151k
                tname##_seq_tt,\
116
151k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
151k
                NULL,\
118
151k
                sizeof(stname),\
119
151k
                #tname \
120
151k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ASRange_it
ASIdentifiers_it
Line
Count
Source
112
139k
        ASN1_ITEM_start(tname) \
113
139k
                ASN1_ITYPE_SEQUENCE,\
114
139k
                V_ASN1_SEQUENCE,\
115
139k
                tname##_seq_tt,\
116
139k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
139k
                NULL,\
118
139k
                sizeof(stname),\
119
139k
                #tname \
120
139k
        ASN1_ITEM_end(tname)
POLICYINFO_it
Line
Count
Source
112
13.3k
        ASN1_ITEM_start(tname) \
113
13.3k
                ASN1_ITYPE_SEQUENCE,\
114
13.3k
                V_ASN1_SEQUENCE,\
115
13.3k
                tname##_seq_tt,\
116
13.3k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
13.3k
                NULL,\
118
13.3k
                sizeof(stname),\
119
13.3k
                #tname \
120
13.3k
        ASN1_ITEM_end(tname)
POLICYQUALINFO_it
Line
Count
Source
112
30.2k
        ASN1_ITEM_start(tname) \
113
30.2k
                ASN1_ITYPE_SEQUENCE,\
114
30.2k
                V_ASN1_SEQUENCE,\
115
30.2k
                tname##_seq_tt,\
116
30.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
30.2k
                NULL,\
118
30.2k
                sizeof(stname),\
119
30.2k
                #tname \
120
30.2k
        ASN1_ITEM_end(tname)
USERNOTICE_it
Line
Count
Source
112
1.67k
        ASN1_ITEM_start(tname) \
113
1.67k
                ASN1_ITYPE_SEQUENCE,\
114
1.67k
                V_ASN1_SEQUENCE,\
115
1.67k
                tname##_seq_tt,\
116
1.67k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
1.67k
                NULL,\
118
1.67k
                sizeof(stname),\
119
1.67k
                #tname \
120
1.67k
        ASN1_ITEM_end(tname)
NOTICEREF_it
Line
Count
Source
112
3.76k
        ASN1_ITEM_start(tname) \
113
3.76k
                ASN1_ITYPE_SEQUENCE,\
114
3.76k
                V_ASN1_SEQUENCE,\
115
3.76k
                tname##_seq_tt,\
116
3.76k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.76k
                NULL,\
118
3.76k
                sizeof(stname),\
119
3.76k
                #tname \
120
3.76k
        ASN1_ITEM_end(tname)
DIST_POINT_it
Line
Count
Source
112
15.1k
        ASN1_ITEM_start(tname) \
113
15.1k
                ASN1_ITYPE_SEQUENCE,\
114
15.1k
                V_ASN1_SEQUENCE,\
115
15.1k
                tname##_seq_tt,\
116
15.1k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
15.1k
                NULL,\
118
15.1k
                sizeof(stname),\
119
15.1k
                #tname \
120
15.1k
        ASN1_ITEM_end(tname)
ISSUING_DIST_POINT_it
Line
Count
Source
112
4.02k
        ASN1_ITEM_start(tname) \
113
4.02k
                ASN1_ITYPE_SEQUENCE,\
114
4.02k
                V_ASN1_SEQUENCE,\
115
4.02k
                tname##_seq_tt,\
116
4.02k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
4.02k
                NULL,\
118
4.02k
                sizeof(stname),\
119
4.02k
                #tname \
120
4.02k
        ASN1_ITEM_end(tname)
OTHERNAME_it
Line
Count
Source
112
260k
        ASN1_ITEM_start(tname) \
113
260k
                ASN1_ITYPE_SEQUENCE,\
114
260k
                V_ASN1_SEQUENCE,\
115
260k
                tname##_seq_tt,\
116
260k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
260k
                NULL,\
118
260k
                sizeof(stname),\
119
260k
                #tname \
120
260k
        ASN1_ITEM_end(tname)
EDIPARTYNAME_it
Line
Count
Source
112
163k
        ASN1_ITEM_start(tname) \
113
163k
                ASN1_ITYPE_SEQUENCE,\
114
163k
                V_ASN1_SEQUENCE,\
115
163k
                tname##_seq_tt,\
116
163k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
163k
                NULL,\
118
163k
                sizeof(stname),\
119
163k
                #tname \
120
163k
        ASN1_ITEM_end(tname)
ACCESS_DESCRIPTION_it
Line
Count
Source
112
73.1k
        ASN1_ITEM_start(tname) \
113
73.1k
                ASN1_ITYPE_SEQUENCE,\
114
73.1k
                V_ASN1_SEQUENCE,\
115
73.1k
                tname##_seq_tt,\
116
73.1k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
73.1k
                NULL,\
118
73.1k
                sizeof(stname),\
119
73.1k
                #tname \
120
73.1k
        ASN1_ITEM_end(tname)
GENERAL_SUBTREE_it
Line
Count
Source
112
13.2k
        ASN1_ITEM_start(tname) \
113
13.2k
                ASN1_ITYPE_SEQUENCE,\
114
13.2k
                V_ASN1_SEQUENCE,\
115
13.2k
                tname##_seq_tt,\
116
13.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
13.2k
                NULL,\
118
13.2k
                sizeof(stname),\
119
13.2k
                #tname \
120
13.2k
        ASN1_ITEM_end(tname)
NAME_CONSTRAINTS_it
Line
Count
Source
112
141k
        ASN1_ITEM_start(tname) \
113
141k
                ASN1_ITYPE_SEQUENCE,\
114
141k
                V_ASN1_SEQUENCE,\
115
141k
                tname##_seq_tt,\
116
141k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
141k
                NULL,\
118
141k
                sizeof(stname),\
119
141k
                #tname \
120
141k
        ASN1_ITEM_end(tname)
PROXY_POLICY_it
Line
Count
Source
112
248
        ASN1_ITEM_start(tname) \
113
248
                ASN1_ITYPE_SEQUENCE,\
114
248
                V_ASN1_SEQUENCE,\
115
248
                tname##_seq_tt,\
116
248
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
248
                NULL,\
118
248
                sizeof(stname),\
119
248
                #tname \
120
248
        ASN1_ITEM_end(tname)
PROXY_CERT_INFO_EXTENSION_it
Line
Count
Source
112
152
        ASN1_ITEM_start(tname) \
113
152
                ASN1_ITYPE_SEQUENCE,\
114
152
                V_ASN1_SEQUENCE,\
115
152
                tname##_seq_tt,\
116
152
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
152
                NULL,\
118
152
                sizeof(stname),\
119
152
                #tname \
120
152
        ASN1_ITEM_end(tname)
POLICY_CONSTRAINTS_it
Line
Count
Source
112
3.31k
        ASN1_ITEM_start(tname) \
113
3.31k
                ASN1_ITYPE_SEQUENCE,\
114
3.31k
                V_ASN1_SEQUENCE,\
115
3.31k
                tname##_seq_tt,\
116
3.31k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.31k
                NULL,\
118
3.31k
                sizeof(stname),\
119
3.31k
                #tname \
120
3.31k
        ASN1_ITEM_end(tname)
PKEY_USAGE_PERIOD_it
Line
Count
Source
112
2.28k
        ASN1_ITEM_start(tname) \
113
2.28k
                ASN1_ITYPE_SEQUENCE,\
114
2.28k
                V_ASN1_SEQUENCE,\
115
2.28k
                tname##_seq_tt,\
116
2.28k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
2.28k
                NULL,\
118
2.28k
                sizeof(stname),\
119
2.28k
                #tname \
120
2.28k
        ASN1_ITEM_end(tname)
POLICY_MAPPING_it
Line
Count
Source
112
2.50k
        ASN1_ITEM_start(tname) \
113
2.50k
                ASN1_ITYPE_SEQUENCE,\
114
2.50k
                V_ASN1_SEQUENCE,\
115
2.50k
                tname##_seq_tt,\
116
2.50k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
2.50k
                NULL,\
118
2.50k
                sizeof(stname),\
119
2.50k
                #tname \
120
2.50k
        ASN1_ITEM_end(tname)
SXNETID_it
Line
Count
Source
112
24.0k
        ASN1_ITEM_start(tname) \
113
24.0k
                ASN1_ITYPE_SEQUENCE,\
114
24.0k
                V_ASN1_SEQUENCE,\
115
24.0k
                tname##_seq_tt,\
116
24.0k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
24.0k
                NULL,\
118
24.0k
                sizeof(stname),\
119
24.0k
                #tname \
120
24.0k
        ASN1_ITEM_end(tname)
SXNET_it
Line
Count
Source
112
38.2k
        ASN1_ITEM_start(tname) \
113
38.2k
                ASN1_ITYPE_SEQUENCE,\
114
38.2k
                V_ASN1_SEQUENCE,\
115
38.2k
                tname##_seq_tt,\
116
38.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
38.2k
                NULL,\
118
38.2k
                sizeof(stname),\
119
38.2k
                #tname \
120
38.2k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_ATTRIBUTE_it
Unexecuted instantiation: CMS_IssuerAndSerialNumber_it
Unexecuted instantiation: CMS_KeyTransRecipientInfo_it
Unexecuted instantiation: CMS_OtherKeyAttribute_it
Unexecuted instantiation: CMS_RecipientKeyIdentifier_it
Unexecuted instantiation: CMS_OriginatorPublicKey_it
Unexecuted instantiation: CMS_KEKRecipientInfo_it
Unexecuted instantiation: CMS_PasswordRecipientInfo_it
Unexecuted instantiation: CMS_ReceiptRequest_it
Unexecuted instantiation: CMS_Receipt_it
Unexecuted instantiation: OCSP_SIGNATURE_it
Unexecuted instantiation: OCSP_CERTID_it
Unexecuted instantiation: OCSP_ONEREQ_it
Unexecuted instantiation: OCSP_REQINFO_it
Unexecuted instantiation: OCSP_REQUEST_it
Unexecuted instantiation: OCSP_RESPBYTES_it
Unexecuted instantiation: OCSP_RESPONSE_it
Unexecuted instantiation: OCSP_REVOKEDINFO_it
Unexecuted instantiation: OCSP_SINGLERESP_it
Unexecuted instantiation: OCSP_RESPDATA_it
Unexecuted instantiation: OCSP_BASICRESP_it
OCSP_CRLID_it
Line
Count
Source
112
48.4k
        ASN1_ITEM_start(tname) \
113
48.4k
                ASN1_ITYPE_SEQUENCE,\
114
48.4k
                V_ASN1_SEQUENCE,\
115
48.4k
                tname##_seq_tt,\
116
48.4k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
48.4k
                NULL,\
118
48.4k
                sizeof(stname),\
119
48.4k
                #tname \
120
48.4k
        ASN1_ITEM_end(tname)
OCSP_SERVICELOC_it
Line
Count
Source
112
109k
        ASN1_ITEM_start(tname) \
113
109k
                ASN1_ITYPE_SEQUENCE,\
114
109k
                V_ASN1_SEQUENCE,\
115
109k
                tname##_seq_tt,\
116
109k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
109k
                NULL,\
118
109k
                sizeof(stname),\
119
109k
                #tname \
120
109k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS12_it
Unexecuted instantiation: PKCS12_MAC_DATA_it
Unexecuted instantiation: PKCS12_BAGS_it
Unexecuted instantiation: PKCS12_SAFEBAG_it
Unexecuted instantiation: SM2_Ciphertext_it
NAMING_AUTHORITY_it
Line
Count
Source
112
47.1k
        ASN1_ITEM_start(tname) \
113
47.1k
                ASN1_ITYPE_SEQUENCE,\
114
47.1k
                V_ASN1_SEQUENCE,\
115
47.1k
                tname##_seq_tt,\
116
47.1k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
47.1k
                NULL,\
118
47.1k
                sizeof(stname),\
119
47.1k
                #tname \
120
47.1k
        ASN1_ITEM_end(tname)
PROFESSION_INFO_it
Line
Count
Source
112
11.9k
        ASN1_ITEM_start(tname) \
113
11.9k
                ASN1_ITYPE_SEQUENCE,\
114
11.9k
                V_ASN1_SEQUENCE,\
115
11.9k
                tname##_seq_tt,\
116
11.9k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
11.9k
                NULL,\
118
11.9k
                sizeof(stname),\
119
11.9k
                #tname \
120
11.9k
        ASN1_ITEM_end(tname)
ADMISSIONS_it
Line
Count
Source
112
220k
        ASN1_ITEM_start(tname) \
113
220k
                ASN1_ITYPE_SEQUENCE,\
114
220k
                V_ASN1_SEQUENCE,\
115
220k
                tname##_seq_tt,\
116
220k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
220k
                NULL,\
118
220k
                sizeof(stname),\
119
220k
                #tname \
120
220k
        ASN1_ITEM_end(tname)
ADMISSION_SYNTAX_it
Line
Count
Source
112
250k
        ASN1_ITEM_start(tname) \
113
250k
                ASN1_ITYPE_SEQUENCE,\
114
250k
                V_ASN1_SEQUENCE,\
115
250k
                tname##_seq_tt,\
116
250k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
250k
                NULL,\
118
250k
                sizeof(stname),\
119
250k
                #tname \
120
250k
        ASN1_ITEM_end(tname)
BASIC_CONSTRAINTS_it
Line
Count
Source
112
9.74k
        ASN1_ITEM_start(tname) \
113
9.74k
                ASN1_ITYPE_SEQUENCE,\
114
9.74k
                V_ASN1_SEQUENCE,\
115
9.74k
                tname##_seq_tt,\
116
9.74k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
9.74k
                NULL,\
118
9.74k
                sizeof(stname),\
119
9.74k
                #tname \
120
9.74k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PBEPARAM_it
Unexecuted instantiation: PBE2PARAM_it
Unexecuted instantiation: PBKDF2PARAM_it
Unexecuted instantiation: SCRYPT_PARAMS_it
121
122
# define static_ASN1_SEQUENCE_END_name(stname, tname) \
123
        ;\
124
35.8k
        static_ASN1_ITEM_start(tname) \
125
35.8k
                ASN1_ITYPE_SEQUENCE,\
126
35.8k
                V_ASN1_SEQUENCE,\
127
35.8k
                tname##_seq_tt,\
128
35.8k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
35.8k
                NULL,\
130
35.8k
                sizeof(stname),\
131
35.8k
                #stname \
132
35.8k
        ASN1_ITEM_end(tname)
dh_asn1.c:DHxparams_it
Line
Count
Source
124
1.12k
        static_ASN1_ITEM_start(tname) \
125
1.12k
                ASN1_ITYPE_SEQUENCE,\
126
1.12k
                V_ASN1_SEQUENCE,\
127
1.12k
                tname##_seq_tt,\
128
1.12k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
1.12k
                NULL,\
130
1.12k
                sizeof(stname),\
131
1.12k
                #stname \
132
1.12k
        ASN1_ITEM_end(tname)
dh_asn1.c:DHvparams_it
Line
Count
Source
124
3.56k
        static_ASN1_ITEM_start(tname) \
125
3.56k
                ASN1_ITYPE_SEQUENCE,\
126
3.56k
                V_ASN1_SEQUENCE,\
127
3.56k
                tname##_seq_tt,\
128
3.56k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
3.56k
                NULL,\
130
3.56k
                sizeof(stname),\
131
3.56k
                #stname \
132
3.56k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ec_asn1.c:X9_62_PENTANOMIAL_it
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_it
Line
Count
Source
124
533
        static_ASN1_ITEM_start(tname) \
125
533
                ASN1_ITYPE_SEQUENCE,\
126
533
                V_ASN1_SEQUENCE,\
127
533
                tname##_seq_tt,\
128
533
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
533
                NULL,\
130
533
                sizeof(stname),\
131
533
                #stname \
132
533
        ASN1_ITEM_end(tname)
ec_asn1.c:X9_62_FIELDID_it
Line
Count
Source
124
16.6k
        static_ASN1_ITEM_start(tname) \
125
16.6k
                ASN1_ITYPE_SEQUENCE,\
126
16.6k
                V_ASN1_SEQUENCE,\
127
16.6k
                tname##_seq_tt,\
128
16.6k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
16.6k
                NULL,\
130
16.6k
                sizeof(stname),\
131
16.6k
                #stname \
132
16.6k
        ASN1_ITEM_end(tname)
ec_asn1.c:X9_62_CURVE_it
Line
Count
Source
124
13.9k
        static_ASN1_ITEM_start(tname) \
125
13.9k
                ASN1_ITYPE_SEQUENCE,\
126
13.9k
                V_ASN1_SEQUENCE,\
127
13.9k
                tname##_seq_tt,\
128
13.9k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
13.9k
                NULL,\
130
13.9k
                sizeof(stname),\
131
13.9k
                #stname \
132
13.9k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ec_asn1.c:EC_PRIVATEKEY_it
Unexecuted instantiation: evp_asn1.c:asn1_int_oct_it
Unexecuted instantiation: cms_asn1.c:CMS_OtherCertificateFormat_it
Unexecuted instantiation: cms_asn1.c:CMS_OtherRevocationInfoFormat_it
Unexecuted instantiation: cms_asn1.c:CMS_KEKIdentifier_it
Unexecuted instantiation: cms_asn1.c:CMS_OtherRecipientInfo_it
Unexecuted instantiation: cms_asn1.c:CMS_OriginatorInfo_it
Unexecuted instantiation: cms_asn1.c:CMS_SharedInfo_it
Unexecuted instantiation: ess_asn1.c:ESS_ISSUER_SERIAL_it
Unexecuted instantiation: ess_asn1.c:ESS_CERT_ID_it
Unexecuted instantiation: ess_asn1.c:ESS_SIGNING_CERT_it
Unexecuted instantiation: ess_asn1.c:ESS_CERT_ID_V2_it
Unexecuted instantiation: ess_asn1.c:ESS_SIGNING_CERT_V2_it
133
134
# define ASN1_NDEF_SEQUENCE(tname) \
135
        ASN1_SEQUENCE(tname)
136
137
# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
138
        ASN1_SEQUENCE_cb(tname, cb)
139
140
# define ASN1_SEQUENCE_cb(tname, cb) \
141
        static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
142
        ASN1_SEQUENCE(tname)
143
144
# define ASN1_SEQUENCE_const_cb(tname, const_cb) \
145
        static const ASN1_AUX tname##_aux = \
146
            {NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb}; \
147
        ASN1_SEQUENCE(tname)
148
149
# define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb) \
150
        static const ASN1_AUX tname##_aux = \
151
            {NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb}; \
152
        ASN1_SEQUENCE(tname)
153
154
# define ASN1_SEQUENCE_ref(tname, cb) \
155
        static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL}; \
156
        ASN1_SEQUENCE(tname)
157
158
# define ASN1_SEQUENCE_enc(tname, enc, cb) \
159
        static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL}; \
160
        ASN1_SEQUENCE(tname)
161
162
# define ASN1_NDEF_SEQUENCE_END(tname) \
163
        ;\
164
0
        ASN1_ITEM_start(tname) \
165
0
                ASN1_ITYPE_NDEF_SEQUENCE,\
166
0
                V_ASN1_SEQUENCE,\
167
0
                tname##_seq_tt,\
168
0
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
169
0
                NULL,\
170
0
                sizeof(tname),\
171
0
                #tname \
172
0
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS7_SIGNED_it
Unexecuted instantiation: PKCS7_ENVELOPE_it
Unexecuted instantiation: PKCS7_ENC_CONTENT_it
Unexecuted instantiation: PKCS7_SIGN_ENVELOPE_it
Unexecuted instantiation: PKCS7_ENCRYPT_it
Unexecuted instantiation: PKCS7_DIGEST_it
Unexecuted instantiation: CMS_SignedData_it
Unexecuted instantiation: CMS_EnvelopedData_it
Unexecuted instantiation: CMS_DigestedData_it
Unexecuted instantiation: CMS_EncryptedData_it
Unexecuted instantiation: CMS_CompressedData_it
173
# define static_ASN1_NDEF_SEQUENCE_END(tname) \
174
        ;\
175
0
        static_ASN1_ITEM_start(tname) \
176
0
                ASN1_ITYPE_NDEF_SEQUENCE,\
177
0
                V_ASN1_SEQUENCE,\
178
0
                tname##_seq_tt,\
179
0
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
180
0
                NULL,\
181
0
                sizeof(tname),\
182
0
                #tname \
183
0
        ASN1_ITEM_end(tname)
Unexecuted instantiation: cms_asn1.c:CMS_EncapsulatedContentInfo_it
Unexecuted instantiation: cms_asn1.c:CMS_EncryptedContentInfo_it
Unexecuted instantiation: cms_asn1.c:CMS_AuthenticatedData_it
184
185
186
# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
187
188
# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
189
# define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname)
190
191
# define ASN1_SEQUENCE_END_ref(stname, tname) \
192
        ;\
193
3.84M
        ASN1_ITEM_start(tname) \
194
3.84M
                ASN1_ITYPE_SEQUENCE,\
195
3.84M
                V_ASN1_SEQUENCE,\
196
3.84M
                tname##_seq_tt,\
197
3.84M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
3.84M
                &tname##_aux,\
199
3.84M
                sizeof(stname),\
200
3.84M
                #tname \
201
3.84M
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_CRL_INFO_it
Unexecuted instantiation: X509_CRL_it
X509_PUBKEY_it
Line
Count
Source
193
182k
        ASN1_ITEM_start(tname) \
194
182k
                ASN1_ITYPE_SEQUENCE,\
195
182k
                V_ASN1_SEQUENCE,\
196
182k
                tname##_seq_tt,\
197
182k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
182k
                &tname##_aux,\
199
182k
                sizeof(stname),\
200
182k
                #tname \
201
182k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_REQ_INFO_it
Unexecuted instantiation: X509_REQ_it
X509_CINF_it
Line
Count
Source
193
308k
        ASN1_ITEM_start(tname) \
194
308k
                ASN1_ITYPE_SEQUENCE,\
195
308k
                V_ASN1_SEQUENCE,\
196
308k
                tname##_seq_tt,\
197
308k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
308k
                &tname##_aux,\
199
308k
                sizeof(stname),\
200
308k
                #tname \
201
308k
        ASN1_ITEM_end(tname)
X509_it
Line
Count
Source
193
3.33M
        ASN1_ITEM_start(tname) \
194
3.33M
                ASN1_ITYPE_SEQUENCE,\
195
3.33M
                V_ASN1_SEQUENCE,\
196
3.33M
                tname##_seq_tt,\
197
3.33M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
3.33M
                &tname##_aux,\
199
3.33M
                sizeof(stname),\
200
3.33M
                #tname \
201
3.33M
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_it
DHparams_it
Line
Count
Source
193
57
        ASN1_ITEM_start(tname) \
194
57
                ASN1_ITYPE_SEQUENCE,\
195
57
                V_ASN1_SEQUENCE,\
196
57
                tname##_seq_tt,\
197
57
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
57
                &tname##_aux,\
199
57
                sizeof(stname),\
200
57
                #tname \
201
57
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS7_SIGNER_INFO_it
Unexecuted instantiation: PKCS7_RECIP_INFO_it
Unexecuted instantiation: RSAPrivateKey_it
RSAPublicKey_it
Line
Count
Source
193
9.94k
        ASN1_ITEM_start(tname) \
194
9.94k
                ASN1_ITYPE_SEQUENCE,\
195
9.94k
                V_ASN1_SEQUENCE,\
196
9.94k
                tname##_seq_tt,\
197
9.94k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
9.94k
                &tname##_aux,\
199
9.94k
                sizeof(stname),\
200
9.94k
                #tname \
201
9.94k
        ASN1_ITEM_end(tname)
RSA_PSS_PARAMS_it
Line
Count
Source
193
12.5k
        ASN1_ITEM_start(tname) \
194
12.5k
                ASN1_ITYPE_SEQUENCE,\
195
12.5k
                V_ASN1_SEQUENCE,\
196
12.5k
                tname##_seq_tt,\
197
12.5k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
12.5k
                &tname##_aux,\
199
12.5k
                sizeof(stname),\
200
12.5k
                #tname \
201
12.5k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: RSA_OAEP_PARAMS_it
Unexecuted instantiation: CMS_SignerInfo_it
Unexecuted instantiation: CMS_RecipientEncryptedKey_it
Unexecuted instantiation: CMS_KeyAgreeRecipientInfo_it
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_it
202
# define static_ASN1_SEQUENCE_END_ref(stname, tname) \
203
        ;\
204
481
        static_ASN1_ITEM_start(tname) \
205
481
                ASN1_ITYPE_SEQUENCE,\
206
481
                V_ASN1_SEQUENCE,\
207
481
                tname##_seq_tt,\
208
481
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
209
481
                &tname##_aux,\
210
481
                sizeof(stname),\
211
481
                #stname \
212
481
        ASN1_ITEM_end(tname)
Unexecuted instantiation: dsa_asn1.c:DSAPrivateKey_it
dsa_asn1.c:DSAparams_it
Line
Count
Source
204
481
        static_ASN1_ITEM_start(tname) \
205
481
                ASN1_ITYPE_SEQUENCE,\
206
481
                V_ASN1_SEQUENCE,\
207
481
                tname##_seq_tt,\
208
481
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
209
481
                &tname##_aux,\
210
481
                sizeof(stname),\
211
481
                #stname \
212
481
        ASN1_ITEM_end(tname)
Unexecuted instantiation: dsa_asn1.c:DSAPublicKey_it
213
214
# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
215
        ;\
216
0
        ASN1_ITEM_start(tname) \
217
0
                ASN1_ITYPE_NDEF_SEQUENCE,\
218
0
                V_ASN1_SEQUENCE,\
219
0
                tname##_seq_tt,\
220
0
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
221
0
                &tname##_aux,\
222
0
                sizeof(stname),\
223
0
                #stname \
224
0
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS7_it
Unexecuted instantiation: CMS_ContentInfo_it
225
226
/*-
227
 * This pair helps declare a CHOICE type. We can do:
228
 *
229
 *      ASN1_CHOICE(chname) = {
230
 *              ... CHOICE options ...
231
 *      ASN1_CHOICE_END(chname)
232
 *
233
 *      This will produce an ASN1_ITEM called chname_it
234
 *      for a structure called chname. The structure
235
 *      definition must look like this:
236
 *      typedef struct {
237
 *              int type;
238
 *              union {
239
 *                      ASN1_SOMETHING *opt1;
240
 *                      ASN1_SOMEOTHER *opt2;
241
 *              } value;
242
 *      } chname;
243
 *
244
 *      the name of the selector must be 'type'.
245
 *      to use an alternative selector name use the
246
 *      ASN1_CHOICE_END_selector() version.
247
 */
248
249
# define ASN1_CHOICE(tname) \
250
        static const ASN1_TEMPLATE tname##_ch_tt[]
251
252
# define ASN1_CHOICE_cb(tname, cb) \
253
        static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
254
        ASN1_CHOICE(tname)
255
256
# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
257
258
# define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname)
259
260
# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
261
262
# define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type)
263
264
# define ASN1_CHOICE_END_selector(stname, tname, selname) \
265
        ;\
266
1.02M
        ASN1_ITEM_start(tname) \
267
1.02M
                ASN1_ITYPE_CHOICE,\
268
1.02M
                offsetof(stname,selname) ,\
269
1.02M
                tname##_ch_tt,\
270
1.02M
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
1.02M
                NULL,\
272
1.02M
                sizeof(stname),\
273
1.02M
                #stname \
274
1.02M
        ASN1_ITEM_end(tname)
ECPKPARAMETERS_it
Line
Count
Source
266
11.7k
        ASN1_ITEM_start(tname) \
267
11.7k
                ASN1_ITYPE_CHOICE,\
268
11.7k
                offsetof(stname,selname) ,\
269
11.7k
                tname##_ch_tt,\
270
11.7k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
11.7k
                NULL,\
272
11.7k
                sizeof(stname),\
273
11.7k
                #stname \
274
11.7k
        ASN1_ITEM_end(tname)
IPAddressOrRange_it
Line
Count
Source
266
24.7k
        ASN1_ITEM_start(tname) \
267
24.7k
                ASN1_ITYPE_CHOICE,\
268
24.7k
                offsetof(stname,selname) ,\
269
24.7k
                tname##_ch_tt,\
270
24.7k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
24.7k
                NULL,\
272
24.7k
                sizeof(stname),\
273
24.7k
                #stname \
274
24.7k
        ASN1_ITEM_end(tname)
IPAddressChoice_it
Line
Count
Source
266
22.8k
        ASN1_ITEM_start(tname) \
267
22.8k
                ASN1_ITYPE_CHOICE,\
268
22.8k
                offsetof(stname,selname) ,\
269
22.8k
                tname##_ch_tt,\
270
22.8k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
22.8k
                NULL,\
272
22.8k
                sizeof(stname),\
273
22.8k
                #stname \
274
22.8k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ASIdOrRange_it
ASIdentifierChoice_it
Line
Count
Source
266
917
        ASN1_ITEM_start(tname) \
267
917
                ASN1_ITYPE_CHOICE,\
268
917
                offsetof(stname,selname) ,\
269
917
                tname##_ch_tt,\
270
917
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
917
                NULL,\
272
917
                sizeof(stname),\
273
917
                #stname \
274
917
        ASN1_ITEM_end(tname)
GENERAL_NAME_it
Line
Count
Source
266
962k
        ASN1_ITEM_start(tname) \
267
962k
                ASN1_ITYPE_CHOICE,\
268
962k
                offsetof(stname,selname) ,\
269
962k
                tname##_ch_tt,\
270
962k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
962k
                NULL,\
272
962k
                sizeof(stname),\
273
962k
                #stname \
274
962k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: CMS_CertificateChoices_it
Unexecuted instantiation: CMS_RevocationInfoChoice_it
Unexecuted instantiation: OCSP_RESPID_it
Unexecuted instantiation: OCSP_CERTSTATUS_it
275
276
# define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
277
        ;\
278
0
        static_ASN1_ITEM_start(tname) \
279
0
                ASN1_ITYPE_CHOICE,\
280
0
                offsetof(stname,selname) ,\
281
0
                tname##_ch_tt,\
282
0
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
283
0
                NULL,\
284
0
                sizeof(stname),\
285
0
                #stname \
286
0
        ASN1_ITEM_end(tname)
Unexecuted instantiation: cms_asn1.c:CMS_SignerIdentifier_it
Unexecuted instantiation: cms_asn1.c:CMS_KeyAgreeRecipientIdentifier_it
Unexecuted instantiation: cms_asn1.c:CMS_OriginatorIdentifierOrKey_it
Unexecuted instantiation: cms_asn1.c:CMS_ReceiptsFrom_it
287
288
# define ASN1_CHOICE_END_cb(stname, tname, selname) \
289
        ;\
290
37.6k
        ASN1_ITEM_start(tname) \
291
37.6k
                ASN1_ITYPE_CHOICE,\
292
37.6k
                offsetof(stname,selname) ,\
293
37.6k
                tname##_ch_tt,\
294
37.6k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
295
37.6k
                &tname##_aux,\
296
37.6k
                sizeof(stname),\
297
37.6k
                #stname \
298
37.6k
        ASN1_ITEM_end(tname)
DIST_POINT_NAME_it
Line
Count
Source
290
37.6k
        ASN1_ITEM_start(tname) \
291
37.6k
                ASN1_ITYPE_CHOICE,\
292
37.6k
                offsetof(stname,selname) ,\
293
37.6k
                tname##_ch_tt,\
294
37.6k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
295
37.6k
                &tname##_aux,\
296
37.6k
                sizeof(stname),\
297
37.6k
                #stname \
298
37.6k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: CMS_RecipientInfo_it
299
300
/* This helps with the template wrapper form of ASN1_ITEM */
301
302
# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
303
        (flags), (tag), 0,\
304
        #name, ASN1_ITEM_ref(type) }
305
306
/* These help with SEQUENCE or CHOICE components */
307
308
/* used to declare other types */
309
310
# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
311
        (flags), (tag), offsetof(stname, field),\
312
        #field, ASN1_ITEM_ref(type) }
313
314
/* implicit and explicit helper macros */
315
316
# define ASN1_IMP_EX(stname, field, type, tag, ex) \
317
         ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type)
318
319
# define ASN1_EXP_EX(stname, field, type, tag, ex) \
320
         ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type)
321
322
/* Any defined by macros: the field used is in the table itself */
323
324
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
325
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
326
327
/* Plain simple type */
328
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
329
/* Embedded simple type */
330
# define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED,0, stname, field, type)
331
332
/* OPTIONAL simple type */
333
# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
334
# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type)
335
336
/* IMPLICIT tagged simple type */
337
# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
338
# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
339
340
/* IMPLICIT tagged OPTIONAL simple type */
341
# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
342
# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
343
344
/* Same as above but EXPLICIT */
345
346
# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
347
# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
348
# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
349
# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
350
351
/* SEQUENCE OF type */
352
# define ASN1_SEQUENCE_OF(stname, field, type) \
353
                ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
354
355
/* OPTIONAL SEQUENCE OF */
356
# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
357
                ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
358
359
/* Same as above but for SET OF */
360
361
# define ASN1_SET_OF(stname, field, type) \
362
                ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
363
364
# define ASN1_SET_OF_OPT(stname, field, type) \
365
                ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
366
367
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
368
369
# define ASN1_IMP_SET_OF(stname, field, type, tag) \
370
                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
371
372
# define ASN1_EXP_SET_OF(stname, field, type, tag) \
373
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
374
375
# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
376
                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
377
378
# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
379
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
380
381
# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
382
                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
383
384
# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
385
                        ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
386
387
# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
388
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
389
390
# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
391
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
392
393
/* EXPLICIT using indefinite length constructed form */
394
# define ASN1_NDEF_EXP(stname, field, type, tag) \
395
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
396
397
/* EXPLICIT OPTIONAL using indefinite length constructed form */
398
# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
399
                        ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
400
401
/* Macros for the ASN1_ADB structure */
402
403
# define ASN1_ADB(name) \
404
        static const ASN1_ADB_TABLE name##_adbtbl[]
405
406
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
407
        ;\
408
        static const ASN1_ITEM *name##_adb(void) \
409
68.6k
        { \
410
68.6k
        static const ASN1_ADB internal_adb = \
411
68.6k
                {\
412
68.6k
                flags,\
413
68.6k
                offsetof(name, field),\
414
68.6k
                adb_cb,\
415
68.6k
                name##_adbtbl,\
416
68.6k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
68.6k
                def,\
418
68.6k
                none\
419
68.6k
                }; \
420
68.6k
                return (const ASN1_ITEM *) &internal_adb; \
421
68.6k
        } \
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_adb
Line
Count
Source
409
866
        { \
410
866
        static const ASN1_ADB internal_adb = \
411
866
                {\
412
866
                flags,\
413
866
                offsetof(name, field),\
414
866
                adb_cb,\
415
866
                name##_adbtbl,\
416
866
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
866
                def,\
418
866
                none\
419
866
                }; \
420
866
                return (const ASN1_ITEM *) &internal_adb; \
421
866
        } \
ec_asn1.c:X9_62_FIELDID_adb
Line
Count
Source
409
20.7k
        { \
410
20.7k
        static const ASN1_ADB internal_adb = \
411
20.7k
                {\
412
20.7k
                flags,\
413
20.7k
                offsetof(name, field),\
414
20.7k
                adb_cb,\
415
20.7k
                name##_adbtbl,\
416
20.7k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
20.7k
                def,\
418
20.7k
                none\
419
20.7k
                }; \
420
20.7k
                return (const ASN1_ITEM *) &internal_adb; \
421
20.7k
        } \
Unexecuted instantiation: pk7_asn1.c:PKCS7_adb
v3_cpols.c:POLICYQUALINFO_adb
Line
Count
Source
409
46.9k
        { \
410
46.9k
        static const ASN1_ADB internal_adb = \
411
46.9k
                {\
412
46.9k
                flags,\
413
46.9k
                offsetof(name, field),\
414
46.9k
                adb_cb,\
415
46.9k
                name##_adbtbl,\
416
46.9k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
46.9k
                def,\
418
46.9k
                none\
419
46.9k
                }; \
420
46.9k
                return (const ASN1_ITEM *) &internal_adb; \
421
46.9k
        } \
Unexecuted instantiation: cms_asn1.c:CMS_ContentInfo_adb
Unexecuted instantiation: p12_asn.c:PKCS12_BAGS_adb
Unexecuted instantiation: p12_asn.c:PKCS12_SAFEBAG_adb
422
        void dummy_function(void)
423
424
# define ADB_ENTRY(val, template) {val, template}
425
426
# define ASN1_ADB_TEMPLATE(name) \
427
        static const ASN1_TEMPLATE name##_tt
428
429
/*
430
 * This is the ASN1 template structure that defines a wrapper round the
431
 * actual type. It determines the actual position of the field in the value
432
 * structure, various flags such as OPTIONAL and the field name.
433
 */
434
435
struct ASN1_TEMPLATE_st {
436
    unsigned long flags;        /* Various flags */
437
    long tag;                   /* tag, not used if no tagging */
438
    unsigned long offset;       /* Offset of this field in structure */
439
    const char *field_name;     /* Field name */
440
    ASN1_ITEM_EXP *item;        /* Relevant ASN1_ITEM or ASN1_ADB */
441
};
442
443
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
444
445
# define ASN1_TEMPLATE_item(t) (t->item_ptr)
446
# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
447
448
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
449
typedef struct ASN1_ADB_st ASN1_ADB;
450
451
struct ASN1_ADB_st {
452
    unsigned long flags;        /* Various flags */
453
    unsigned long offset;       /* Offset of selector field */
454
    int (*adb_cb)(long *psel);  /* Application callback */
455
    const ASN1_ADB_TABLE *tbl;  /* Table of possible types */
456
    long tblcount;              /* Number of entries in tbl */
457
    const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
458
    const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
459
};
460
461
struct ASN1_ADB_TABLE_st {
462
    long value;                 /* NID for an object or value for an int */
463
    const ASN1_TEMPLATE tt;     /* item for this value */
464
};
465
466
/* template flags */
467
468
/* Field is optional */
469
11.2M
# define ASN1_TFLG_OPTIONAL      (0x1)
470
471
/* Field is a SET OF */
472
895k
# define ASN1_TFLG_SET_OF        (0x1 << 1)
473
474
/* Field is a SEQUENCE OF */
475
245k
# define ASN1_TFLG_SEQUENCE_OF   (0x2 << 1)
476
477
/*
478
 * Special case: this refers to a SET OF that will be sorted into DER order
479
 * when encoded *and* the corresponding STACK will be modified to match the
480
 * new order.
481
 */
482
# define ASN1_TFLG_SET_ORDER     (0x3 << 1)
483
484
/* Mask for SET OF or SEQUENCE OF */
485
27.4M
# define ASN1_TFLG_SK_MASK       (0x3 << 1)
486
487
/*
488
 * These flags mean the tag should be taken from the tag field. If EXPLICIT
489
 * then the underlying type is used for the inner tag.
490
 */
491
492
/* IMPLICIT tagging */
493
7.14M
# define ASN1_TFLG_IMPTAG        (0x1 << 3)
494
495
/* EXPLICIT tagging, inner tag from underlying type */
496
10.9M
# define ASN1_TFLG_EXPTAG        (0x2 << 3)
497
498
3.53M
# define ASN1_TFLG_TAG_MASK      (0x3 << 3)
499
500
/* context specific IMPLICIT */
501
# define ASN1_TFLG_IMPLICIT      (ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT)
502
503
/* context specific EXPLICIT */
504
# define ASN1_TFLG_EXPLICIT      (ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT)
505
506
/*
507
 * If tagging is in force these determine the type of tag to use. Otherwise
508
 * the tag is determined by the underlying type. These values reflect the
509
 * actual octet format.
510
 */
511
512
/* Universal tag */
513
# define ASN1_TFLG_UNIVERSAL     (0x0<<6)
514
/* Application tag */
515
# define ASN1_TFLG_APPLICATION   (0x1<<6)
516
/* Context specific tag */
517
# define ASN1_TFLG_CONTEXT       (0x2<<6)
518
/* Private tag */
519
# define ASN1_TFLG_PRIVATE       (0x3<<6)
520
521
19.1M
# define ASN1_TFLG_TAG_CLASS     (0x3<<6)
522
523
/*
524
 * These are for ANY DEFINED BY type. In this case the 'item' field points to
525
 * an ASN1_ADB structure which contains a table of values to decode the
526
 * relevant type
527
 */
528
529
30.0M
# define ASN1_TFLG_ADB_MASK      (0x3<<8)
530
531
32.4k
# define ASN1_TFLG_ADB_OID       (0x1<<8)
532
533
# define ASN1_TFLG_ADB_INT       (0x1<<9)
534
535
/*
536
 * This flag when present in a SEQUENCE OF, SET OF or EXPLICIT causes
537
 * indefinite length constructed encoding to be used if required.
538
 */
539
540
5.14M
# define ASN1_TFLG_NDEF          (0x1<<11)
541
542
/* Field is embedded and not a pointer */
543
27.4M
# define ASN1_TFLG_EMBED         (0x1 << 12)
544
545
/* This is the actual ASN1 item itself */
546
547
struct ASN1_ITEM_st {
548
    char itype;                 /* The item type, primitive, SEQUENCE, CHOICE
549
                                 * or extern */
550
    long utype;                 /* underlying type */
551
    const ASN1_TEMPLATE *templates; /* If SEQUENCE or CHOICE this contains
552
                                     * the contents */
553
    long tcount;                /* Number of templates if SEQUENCE or CHOICE */
554
    const void *funcs;          /* functions that handle this type */
555
    long size;                  /* Structure size (usually) */
556
    const char *sname;          /* Structure name */
557
};
558
559
/*-
560
 * These are values for the itype field and
561
 * determine how the type is interpreted.
562
 *
563
 * For PRIMITIVE types the underlying type
564
 * determines the behaviour if items is NULL.
565
 *
566
 * Otherwise templates must contain a single
567
 * template and the type is treated in the
568
 * same way as the type specified in the template.
569
 *
570
 * For SEQUENCE types the templates field points
571
 * to the members, the size field is the
572
 * structure size.
573
 *
574
 * For CHOICE types the templates field points
575
 * to each possible member (typically a union)
576
 * and the 'size' field is the offset of the
577
 * selector.
578
 *
579
 * The 'funcs' field is used for application
580
 * specific functions.
581
 *
582
 * The EXTERN type uses a new style d2i/i2d.
583
 * The new style should be used where possible
584
 * because it avoids things like the d2i IMPLICIT
585
 * hack.
586
 *
587
 * MSTRING is a multiple string type, it is used
588
 * for a CHOICE of character strings where the
589
 * actual strings all occupy an ASN1_STRING
590
 * structure. In this case the 'utype' field
591
 * has a special meaning, it is used as a mask
592
 * of acceptable types using the B_ASN1 constants.
593
 *
594
 * NDEF_SEQUENCE is the same as SEQUENCE except
595
 * that it will use indefinite length constructed
596
 * encoding if requested.
597
 *
598
 */
599
600
66.0M
# define ASN1_ITYPE_PRIMITIVE            0x0
601
602
29.5M
# define ASN1_ITYPE_SEQUENCE             0x1
603
604
2.08M
# define ASN1_ITYPE_CHOICE               0x2
605
606
1.28M
# define ASN1_ITYPE_EXTERN               0x4
607
608
35.5M
# define ASN1_ITYPE_MSTRING              0x5
609
610
230k
# define ASN1_ITYPE_NDEF_SEQUENCE        0x6
611
612
/*
613
 * Cache for ASN1 tag and length, so we don't keep re-reading it for things
614
 * like CHOICE
615
 */
616
617
struct ASN1_TLC_st {
618
    char valid;                 /* Values below are valid */
619
    int ret;                    /* return value */
620
    long plen;                  /* length */
621
    int ptag;                   /* class value */
622
    int pclass;                 /* class value */
623
    int hdrlen;                 /* header length */
624
};
625
626
/* Typedefs for ASN1 function pointers */
627
typedef int ASN1_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
628
                        const ASN1_ITEM *it, int tag, int aclass, char opt,
629
                        ASN1_TLC *ctx);
630
631
typedef int ASN1_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
632
                        const ASN1_ITEM *it, int tag, int aclass);
633
typedef int ASN1_ex_new_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
634
typedef void ASN1_ex_free_func(ASN1_VALUE **pval, const ASN1_ITEM *it);
635
636
typedef int ASN1_ex_print_func(BIO *out, const ASN1_VALUE **pval,
637
                               int indent, const char *fname,
638
                               const ASN1_PCTX *pctx);
639
640
typedef int ASN1_primitive_i2c(const ASN1_VALUE **pval, unsigned char *cont,
641
                               int *putype, const ASN1_ITEM *it);
642
typedef int ASN1_primitive_c2i(ASN1_VALUE **pval, const unsigned char *cont,
643
                               int len, int utype, char *free_cont,
644
                               const ASN1_ITEM *it);
645
typedef int ASN1_primitive_print(BIO *out, const ASN1_VALUE **pval,
646
                                 const ASN1_ITEM *it, int indent,
647
                                 const ASN1_PCTX *pctx);
648
649
typedef struct ASN1_EXTERN_FUNCS_st {
650
    void *app_data;
651
    ASN1_ex_new_func *asn1_ex_new;
652
    ASN1_ex_free_func *asn1_ex_free;
653
    ASN1_ex_free_func *asn1_ex_clear;
654
    ASN1_ex_d2i *asn1_ex_d2i;
655
    ASN1_ex_i2d *asn1_ex_i2d;
656
    ASN1_ex_print_func *asn1_ex_print;
657
} ASN1_EXTERN_FUNCS;
658
659
typedef struct ASN1_PRIMITIVE_FUNCS_st {
660
    void *app_data;
661
    unsigned long flags;
662
    ASN1_ex_new_func *prim_new;
663
    ASN1_ex_free_func *prim_free;
664
    ASN1_ex_free_func *prim_clear;
665
    ASN1_primitive_c2i *prim_c2i;
666
    ASN1_primitive_i2c *prim_i2c;
667
    ASN1_primitive_print *prim_print;
668
} ASN1_PRIMITIVE_FUNCS;
669
670
/*
671
 * This is the ASN1_AUX structure: it handles various miscellaneous
672
 * requirements. For example the use of reference counts and an informational
673
 * callback. The "informational callback" is called at various points during
674
 * the ASN1 encoding and decoding. It can be used to provide minor
675
 * customisation of the structures used. This is most useful where the
676
 * supplied routines *almost* do the right thing but need some extra help at
677
 * a few points. If the callback returns zero then it is assumed a fatal
678
 * error has occurred and the main operation should be abandoned. If major
679
 * changes in the default behaviour are required then an external type is
680
 * more appropriate.
681
 * For the operations ASN1_OP_I2D_PRE, ASN1_OP_I2D_POST, ASN1_OP_PRINT_PRE, and
682
 * ASN1_OP_PRINT_POST, meanwhile a variant of the callback with const parameter
683
 * 'in' is provided to make clear statically that its input is not modified. If
684
 * and only if this variant is in use the flag ASN1_AFLG_CONST_CB must be set.
685
 */
686
687
typedef int ASN1_aux_cb(int operation, ASN1_VALUE **in, const ASN1_ITEM *it,
688
                        void *exarg);
689
typedef int ASN1_aux_const_cb(int operation, const ASN1_VALUE **in,
690
                              const ASN1_ITEM *it, void *exarg);
691
692
typedef struct ASN1_AUX_st {
693
    void *app_data;
694
    int flags;
695
    int ref_offset;             /* Offset of reference value */
696
    int ref_lock;               /* Lock type to use */
697
    ASN1_aux_cb *asn1_cb;
698
    int enc_offset;             /* Offset of ASN1_ENCODING structure */
699
    ASN1_aux_const_cb *asn1_const_cb; /* for ASN1_OP_I2D_ and ASN1_OP_PRINT_ */
700
} ASN1_AUX;
701
702
/* For print related callbacks exarg points to this structure */
703
typedef struct ASN1_PRINT_ARG_st {
704
    BIO *out;
705
    int indent;
706
    const ASN1_PCTX *pctx;
707
} ASN1_PRINT_ARG;
708
709
/* For streaming related callbacks exarg points to this structure */
710
typedef struct ASN1_STREAM_ARG_st {
711
    /* BIO to stream through */
712
    BIO *out;
713
    /* BIO with filters appended */
714
    BIO *ndef_bio;
715
    /* Streaming I/O boundary */
716
    unsigned char **boundary;
717
} ASN1_STREAM_ARG;
718
719
/* Flags in ASN1_AUX */
720
721
/* Use a reference count */
722
426k
# define ASN1_AFLG_REFCOUNT      1
723
/* Save the encoding of structure (useful for signatures) */
724
705k
# define ASN1_AFLG_ENCODING      2
725
/* The Sequence length is invalid */
726
183k
# define ASN1_AFLG_BROKEN        4
727
/* Use the new asn1_const_cb */
728
167k
# define ASN1_AFLG_CONST_CB      8
729
730
/* operation values for asn1_cb */
731
732
180k
# define ASN1_OP_NEW_PRE         0
733
289k
# define ASN1_OP_NEW_POST        1
734
176k
# define ASN1_OP_FREE_PRE        2
735
584k
# define ASN1_OP_FREE_POST       3
736
197k
# define ASN1_OP_D2I_PRE         4
737
393k
# define ASN1_OP_D2I_POST        5
738
67.1k
# define ASN1_OP_I2D_PRE         6
739
33.5k
# define ASN1_OP_I2D_POST        7
740
0
# define ASN1_OP_PRINT_PRE       8
741
0
# define ASN1_OP_PRINT_POST      9
742
0
# define ASN1_OP_STREAM_PRE      10
743
0
# define ASN1_OP_STREAM_POST     11
744
0
# define ASN1_OP_DETACHED_PRE    12
745
0
# define ASN1_OP_DETACHED_POST   13
746
747
/* Macro to implement a primitive type */
748
# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
749
# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
750
20.5M
                                ASN1_ITEM_start(itname) \
751
20.5M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
20.5M
                                ASN1_ITEM_end(itname)
ASN1_OCTET_STRING_it
Line
Count
Source
750
3.43M
                                ASN1_ITEM_start(itname) \
751
3.43M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
3.43M
                                ASN1_ITEM_end(itname)
ASN1_INTEGER_it
Line
Count
Source
750
783k
                                ASN1_ITEM_start(itname) \
751
783k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
783k
                                ASN1_ITEM_end(itname)
ASN1_ENUMERATED_it
Line
Count
Source
750
3.61k
                                ASN1_ITEM_start(itname) \
751
3.61k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
3.61k
                                ASN1_ITEM_end(itname)
ASN1_BIT_STRING_it
Line
Count
Source
750
1.15M
                                ASN1_ITEM_start(itname) \
751
1.15M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
1.15M
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_UTF8STRING_it
Unexecuted instantiation: ASN1_PRINTABLESTRING_it
Unexecuted instantiation: ASN1_T61STRING_it
ASN1_IA5STRING_it
Line
Count
Source
750
663k
                                ASN1_ITEM_start(itname) \
751
663k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
663k
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_GENERALSTRING_it
Unexecuted instantiation: ASN1_UTCTIME_it
ASN1_GENERALIZEDTIME_it
Line
Count
Source
750
373k
                                ASN1_ITEM_start(itname) \
751
373k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
373k
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_VISIBLESTRING_it
Unexecuted instantiation: ASN1_UNIVERSALSTRING_it
Unexecuted instantiation: ASN1_BMPSTRING_it
ASN1_NULL_it
Line
Count
Source
750
47.8k
                                ASN1_ITEM_start(itname) \
751
47.8k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
47.8k
                                ASN1_ITEM_end(itname)
ASN1_OBJECT_it
Line
Count
Source
750
7.45M
                                ASN1_ITEM_start(itname) \
751
7.45M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
7.45M
                                ASN1_ITEM_end(itname)
ASN1_ANY_it
Line
Count
Source
750
1.07M
                                ASN1_ITEM_start(itname) \
751
1.07M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
1.07M
                                ASN1_ITEM_end(itname)
ASN1_SEQUENCE_it
Line
Count
Source
750
227k
                                ASN1_ITEM_start(itname) \
751
227k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
227k
                                ASN1_ITEM_end(itname)
ASN1_BOOLEAN_it
Line
Count
Source
750
5.26M
                                ASN1_ITEM_start(itname) \
751
5.26M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
5.26M
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_TBOOLEAN_it
ASN1_FBOOLEAN_it
Line
Count
Source
750
53.5k
                                ASN1_ITEM_start(itname) \
751
53.5k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
53.5k
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_OCTET_STRING_NDEF_it
753
754
/* Macro to implement a multi string type */
755
# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
756
3.99M
                                ASN1_ITEM_start(itname) \
757
3.99M
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
3.99M
                                ASN1_ITEM_end(itname)
ASN1_TIME_it
Line
Count
Source
756
365k
                                ASN1_ITEM_start(itname) \
757
365k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
365k
                                ASN1_ITEM_end(itname)
ASN1_PRINTABLE_it
Line
Count
Source
756
3.24M
                                ASN1_ITEM_start(itname) \
757
3.24M
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
3.24M
                                ASN1_ITEM_end(itname)
DISPLAYTEXT_it
Line
Count
Source
756
3.58k
                                ASN1_ITEM_start(itname) \
757
3.58k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
3.58k
                                ASN1_ITEM_end(itname)
DIRECTORYSTRING_it
Line
Count
Source
756
379k
                                ASN1_ITEM_start(itname) \
757
379k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
379k
                                ASN1_ITEM_end(itname)
759
760
# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
761
650k
        ASN1_ITEM_start(sname) \
762
650k
                ASN1_ITYPE_EXTERN, \
763
650k
                tag, \
764
650k
                NULL, \
765
650k
                0, \
766
650k
                &fptrs, \
767
650k
                0, \
768
650k
                #sname \
769
650k
        ASN1_ITEM_end(sname)
770
771
/* Macro to implement standard functions in terms of ASN1_ITEM structures */
772
773
# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
774
775
# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
776
777
# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
778
                        IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
779
780
# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
781
                IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
782
783
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
784
                IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
785
786
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
787
        pre stname *fname##_new(void) \
788
        { \
789
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
790
        } \
791
        pre void fname##_free(stname *a) \
792
        { \
793
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
794
        }
795
796
# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
797
        stname *fname##_new(void) \
798
418k
        { \
799
418k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
418k
        } \
Unexecuted instantiation: X509_REVOKED_new
Unexecuted instantiation: X509_CRL_INFO_new
Unexecuted instantiation: X509_CRL_new
Unexecuted instantiation: X509_EXTENSION_new
X509_NAME_ENTRY_new
Line
Count
Source
798
355k
        { \
799
355k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
355k
        } \
Unexecuted instantiation: X509_NAME_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: PKCS8_PRIV_KEY_INFO_new
Unexecuted instantiation: ASN1_NULL_new
ASN1_TYPE_new
Line
Count
Source
798
63.1k
        { \
799
63.1k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
63.1k
        } \
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: NETSCAPE_SPKAC_new
Unexecuted instantiation: NETSCAPE_SPKI_new
Unexecuted instantiation: X509_VAL_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_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: 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: 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: 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: SXNETID_new
Unexecuted instantiation: SXNET_new
Unexecuted instantiation: TLS_FEATURE_new
Unexecuted instantiation: X509_ATTRIBUTE_new
Unexecuted instantiation: CMS_ContentInfo_new
Unexecuted instantiation: ESS_ISSUER_SERIAL_new
Unexecuted instantiation: ESS_CERT_ID_new
Unexecuted instantiation: ESS_SIGNING_CERT_new
Unexecuted instantiation: ESS_CERT_ID_V2_new
Unexecuted instantiation: ESS_SIGNING_CERT_V2_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_new
Unexecuted instantiation: PKCS12_MAC_DATA_new
Unexecuted instantiation: PKCS12_BAGS_new
Unexecuted instantiation: PKCS12_SAFEBAG_new
Unexecuted instantiation: SM2_Ciphertext_new
Unexecuted instantiation: NAMING_AUTHORITY_new
Unexecuted instantiation: PROFESSION_INFO_new
Unexecuted instantiation: ADMISSIONS_new
Unexecuted instantiation: ADMISSION_SYNTAX_new
Unexecuted instantiation: BASIC_CONSTRAINTS_new
Unexecuted instantiation: EXTENDED_KEY_USAGE_new
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_new
Unexecuted instantiation: PBEPARAM_new
Unexecuted instantiation: PBE2PARAM_new
Unexecuted instantiation: PBKDF2PARAM_new
Unexecuted instantiation: SCRYPT_PARAMS_new
Unexecuted instantiation: CMS_ReceiptRequest_new
801
        void fname##_free(stname *a) \
802
1.70M
        { \
803
1.70M
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
1.70M
        }
Unexecuted instantiation: X509_REVOKED_free
Unexecuted instantiation: X509_CRL_INFO_free
Unexecuted instantiation: X509_CRL_free
Unexecuted instantiation: X509_EXTENSION_free
X509_NAME_ENTRY_free
Line
Count
Source
802
745k
        { \
803
745k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
745k
        }
X509_NAME_free
Line
Count
Source
802
5.45k
        { \
803
5.45k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
5.45k
        }
Unexecuted instantiation: X509_PUBKEY_free
Unexecuted instantiation: X509_REQ_INFO_free
Unexecuted instantiation: X509_REQ_free
Unexecuted instantiation: X509_CINF_free
X509_free
Line
Count
Source
802
33.5k
        { \
803
33.5k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
33.5k
        }
X509_CERT_AUX_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
Unexecuted instantiation: ASN1_TIME_free
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_free
Unexecuted instantiation: ASN1_NULL_free
ASN1_TYPE_free
Line
Count
Source
802
64.5k
        { \
803
64.5k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
64.5k
        }
Unexecuted instantiation: ASN1_PRINTABLE_free
Unexecuted instantiation: DISPLAYTEXT_free
Unexecuted instantiation: DIRECTORYSTRING_free
X509_ALGOR_free
Line
Count
Source
802
2.00k
        { \
803
2.00k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
2.00k
        }
Unexecuted instantiation: X509_SIG_free
Unexecuted instantiation: NETSCAPE_SPKAC_free
Unexecuted instantiation: NETSCAPE_SPKI_free
Unexecuted instantiation: X509_VAL_free
Unexecuted instantiation: X9_62_PENTANOMIAL_free
Unexecuted instantiation: X9_62_CHARACTERISTIC_TWO_free
Unexecuted instantiation: ECPARAMETERS_free
ECPKPARAMETERS_free
Line
Count
Source
802
5.85k
        { \
803
5.85k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
5.85k
        }
Unexecuted instantiation: EC_PRIVATEKEY_free
Unexecuted instantiation: PKCS7_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
RSA_PSS_PARAMS_free
Line
Count
Source
802
10.4k
        { \
803
10.4k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
10.4k
        }
Unexecuted instantiation: RSA_OAEP_PARAMS_free
Unexecuted instantiation: IPAddressRange_free
Unexecuted instantiation: IPAddressOrRange_free
Unexecuted instantiation: IPAddressChoice_free
Unexecuted instantiation: IPAddressFamily_free
AUTHORITY_KEYID_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
Unexecuted instantiation: ASRange_free
Unexecuted instantiation: ASIdOrRange_free
Unexecuted instantiation: ASIdentifierChoice_free
ASIdentifiers_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
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
CRL_DIST_POINTS_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
Unexecuted instantiation: ISSUING_DIST_POINT_free
Unexecuted instantiation: OTHERNAME_free
Unexecuted instantiation: EDIPARTYNAME_free
Unexecuted instantiation: GENERAL_NAME_free
GENERAL_NAMES_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
Unexecuted instantiation: ACCESS_DESCRIPTION_free
Unexecuted instantiation: AUTHORITY_INFO_ACCESS_free
Unexecuted instantiation: GENERAL_SUBTREE_free
NAME_CONSTRAINTS_free
Line
Count
Source
802
139k
        { \
803
139k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
139k
        }
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: SXNETID_free
Unexecuted instantiation: SXNET_free
Unexecuted instantiation: TLS_FEATURE_free
Unexecuted instantiation: X509_ATTRIBUTE_free
Unexecuted instantiation: CMS_ContentInfo_free
Unexecuted instantiation: ESS_ISSUER_SERIAL_free
Unexecuted instantiation: ESS_CERT_ID_free
Unexecuted instantiation: ESS_SIGNING_CERT_free
Unexecuted instantiation: ESS_CERT_ID_V2_free
Unexecuted instantiation: ESS_SIGNING_CERT_V2_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_free
Unexecuted instantiation: PKCS12_MAC_DATA_free
Unexecuted instantiation: PKCS12_BAGS_free
Unexecuted instantiation: PKCS12_SAFEBAG_free
Unexecuted instantiation: SM2_Ciphertext_free
Unexecuted instantiation: NAMING_AUTHORITY_free
Unexecuted instantiation: PROFESSION_INFO_free
Unexecuted instantiation: ADMISSIONS_free
Unexecuted instantiation: ADMISSION_SYNTAX_free
Unexecuted instantiation: BASIC_CONSTRAINTS_free
Unexecuted instantiation: EXTENDED_KEY_USAGE_free
Unexecuted instantiation: NETSCAPE_CERT_SEQUENCE_free
Unexecuted instantiation: PBEPARAM_free
Unexecuted instantiation: PBE2PARAM_free
Unexecuted instantiation: PBKDF2PARAM_free
Unexecuted instantiation: SCRYPT_PARAMS_free
Unexecuted instantiation: CMS_ReceiptRequest_free
805
806
# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
807
        IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
808
        IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
809
810
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
811
        stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
812
3.37M
        { \
813
3.37M
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
3.37M
        } \
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_NAME_ENTRY
Unexecuted instantiation: d2i_X509_NAME
Unexecuted instantiation: d2i_X509_PUBKEY
Unexecuted instantiation: d2i_X509_REQ_INFO
Unexecuted instantiation: d2i_X509_REQ
Unexecuted instantiation: d2i_X509_CINF
d2i_X509
Line
Count
Source
812
3.26M
        { \
813
3.26M
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
3.26M
        } \
Unexecuted instantiation: d2i_X509_CERT_AUX
Unexecuted instantiation: d2i_ASN1_TIME
Unexecuted instantiation: d2i_PKCS8_PRIV_KEY_INFO
d2i_ASN1_OCTET_STRING
Line
Count
Source
812
91.2k
        { \
813
91.2k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
91.2k
        } \
d2i_ASN1_INTEGER
Line
Count
Source
812
1.78k
        { \
813
1.78k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
1.78k
        } \
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_NETSCAPE_SPKAC
Unexecuted instantiation: d2i_NETSCAPE_SPKI
Unexecuted instantiation: d2i_X509_VAL
d2i_DHparams
Line
Count
Source
812
57
        { \
813
57
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
57
        } \
d2i_int_dhx
Line
Count
Source
812
1.12k
        { \
813
1.12k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
1.12k
        } \
Unexecuted instantiation: d2i_DSAPrivateKey
d2i_DSAparams
Line
Count
Source
812
481
        { \
813
481
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
481
        } \
Unexecuted instantiation: d2i_DSAPublicKey
d2i_ECPKPARAMETERS
Line
Count
Source
812
5.85k
        { \
813
5.85k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
5.85k
        } \
Unexecuted instantiation: d2i_EC_PRIVATEKEY
Unexecuted instantiation: d2i_PKCS7
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
d2i_RSAPublicKey
Line
Count
Source
812
9.94k
        { \
813
9.94k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
9.94k
        } \
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_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_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_SXNETID
Unexecuted instantiation: d2i_SXNET
Unexecuted instantiation: d2i_X509_ATTRIBUTE
Unexecuted instantiation: d2i_CMS_ContentInfo
Unexecuted instantiation: d2i_ESS_ISSUER_SERIAL
Unexecuted instantiation: d2i_ESS_CERT_ID
Unexecuted instantiation: d2i_ESS_SIGNING_CERT
Unexecuted instantiation: d2i_ESS_CERT_ID_V2
Unexecuted instantiation: d2i_ESS_SIGNING_CERT_V2
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_SM2_Ciphertext
Unexecuted instantiation: d2i_NAMING_AUTHORITY
Unexecuted instantiation: d2i_PROFESSION_INFO
Unexecuted instantiation: d2i_ADMISSIONS
Unexecuted instantiation: d2i_ADMISSION_SYNTAX
Unexecuted instantiation: d2i_BASIC_CONSTRAINTS
Unexecuted instantiation: d2i_EXTENDED_KEY_USAGE
Unexecuted instantiation: d2i_NETSCAPE_CERT_SEQUENCE
Unexecuted instantiation: d2i_PBEPARAM
Unexecuted instantiation: d2i_PBE2PARAM
Unexecuted instantiation: d2i_PBKDF2PARAM
Unexecuted instantiation: d2i_SCRYPT_PARAMS
Unexecuted instantiation: d2i_CMS_ReceiptRequest
815
        int i2d_##fname(const stname *a, unsigned char **out) \
816
35.3k
        { \
817
35.3k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
35.3k
        }
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_NAME_ENTRY
Unexecuted instantiation: i2d_X509_NAME
Unexecuted instantiation: i2d_X509_PUBKEY
Unexecuted instantiation: i2d_X509_REQ_INFO
Unexecuted instantiation: i2d_X509_REQ
Unexecuted instantiation: i2d_X509_CINF
i2d_X509
Line
Count
Source
816
33.5k
        { \
817
33.5k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
33.5k
        }
Unexecuted instantiation: i2d_X509_CERT_AUX
Unexecuted instantiation: i2d_ASN1_TIME
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
i2d_ASN1_TYPE
Line
Count
Source
816
1.79k
        { \
817
1.79k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
1.79k
        }
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_NETSCAPE_SPKAC
Unexecuted instantiation: i2d_NETSCAPE_SPKI
Unexecuted instantiation: i2d_X509_VAL
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
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_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_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_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_SXNETID
Unexecuted instantiation: i2d_SXNET
Unexecuted instantiation: i2d_X509_ATTRIBUTE
Unexecuted instantiation: i2d_CMS_ContentInfo
Unexecuted instantiation: i2d_ESS_ISSUER_SERIAL
Unexecuted instantiation: i2d_ESS_CERT_ID
Unexecuted instantiation: i2d_ESS_SIGNING_CERT
Unexecuted instantiation: i2d_ESS_CERT_ID_V2
Unexecuted instantiation: i2d_ESS_SIGNING_CERT_V2
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_SM2_Ciphertext
Unexecuted instantiation: i2d_NAMING_AUTHORITY
Unexecuted instantiation: i2d_PROFESSION_INFO
Unexecuted instantiation: i2d_ADMISSIONS
Unexecuted instantiation: i2d_ADMISSION_SYNTAX
Unexecuted instantiation: i2d_BASIC_CONSTRAINTS
Unexecuted instantiation: i2d_EXTENDED_KEY_USAGE
Unexecuted instantiation: i2d_NETSCAPE_CERT_SEQUENCE
Unexecuted instantiation: i2d_PBEPARAM
Unexecuted instantiation: i2d_PBE2PARAM
Unexecuted instantiation: i2d_PBKDF2PARAM
Unexecuted instantiation: i2d_SCRYPT_PARAMS
Unexecuted instantiation: i2d_CMS_ReceiptRequest
819
820
# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
821
        int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \
822
0
        { \
823
0
                return ASN1_item_ndef_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
824
0
        }
825
826
# define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \
827
        static stname *d2i_##stname(stname **a, \
828
                                   const unsigned char **in, long len) \
829
        { \
830
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
831
                                               ASN1_ITEM_rptr(stname)); \
832
        } \
833
        static int i2d_##stname(const stname *a, unsigned char **out) \
834
        { \
835
                return ASN1_item_i2d((ASN1_VALUE *)a, out, \
836
                                     ASN1_ITEM_rptr(stname)); \
837
        }
838
839
# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
840
        stname * stname##_dup(const stname *x) \
841
0
        { \
842
0
        return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
843
0
        }
Unexecuted instantiation: X509_REVOKED_dup
Unexecuted instantiation: X509_CRL_dup
Unexecuted instantiation: X509_EXTENSION_dup
Unexecuted instantiation: X509_NAME_ENTRY_dup
Unexecuted instantiation: X509_NAME_dup
Unexecuted instantiation: X509_PUBKEY_dup
Unexecuted instantiation: X509_REQ_dup
Unexecuted instantiation: X509_dup
Unexecuted instantiation: ASN1_TIME_dup
Unexecuted instantiation: ASN1_UTCTIME_dup
Unexecuted instantiation: X509_ALGOR_dup
Unexecuted instantiation: PKCS7_dup
Unexecuted instantiation: X509_ATTRIBUTE_dup
Unexecuted instantiation: ASN1_GENERALIZEDTIME_dup
Unexecuted instantiation: ESS_ISSUER_SERIAL_dup
Unexecuted instantiation: ESS_CERT_ID_dup
Unexecuted instantiation: ESS_SIGNING_CERT_dup
Unexecuted instantiation: ESS_CERT_ID_V2_dup
Unexecuted instantiation: ESS_SIGNING_CERT_V2_dup
844
845
# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
846
        IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
847
848
# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
849
        int fname##_print_ctx(BIO *out, const stname *x, int indent, \
850
                                                const ASN1_PCTX *pctx) \
851
0
        { \
852
0
                return ASN1_item_print(out, (ASN1_VALUE *)x, indent, \
853
0
                        ASN1_ITEM_rptr(itname), pctx); \
854
0
        }
Unexecuted instantiation: PKCS7_print_ctx
Unexecuted instantiation: CMS_ContentInfo_print_ctx
855
856
/* external definitions for primitive types */
857
858
DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
859
DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
860
DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
861
DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
862
DECLARE_ASN1_ITEM(CBIGNUM)
863
DECLARE_ASN1_ITEM(BIGNUM)
864
DECLARE_ASN1_ITEM(INT32)
865
DECLARE_ASN1_ITEM(ZINT32)
866
DECLARE_ASN1_ITEM(UINT32)
867
DECLARE_ASN1_ITEM(ZUINT32)
868
DECLARE_ASN1_ITEM(INT64)
869
DECLARE_ASN1_ITEM(ZINT64)
870
DECLARE_ASN1_ITEM(UINT64)
871
DECLARE_ASN1_ITEM(ZUINT64)
872
873
# ifndef OPENSSL_NO_DEPRECATED_3_0
874
/*
875
 * LONG and ZLONG are strongly discouraged for use as stored data, as the
876
 * underlying C type (long) differs in size depending on the architecture.
877
 * They are designed with 32-bit longs in mind.
878
 */
879
DECLARE_ASN1_ITEM(LONG)
880
DECLARE_ASN1_ITEM(ZLONG)
881
# endif
882
883
DEFINE_STACK_OF(ASN1_VALUE)
884
885
/* Functions used internally by the ASN1 code */
886
887
int ASN1_item_ex_new(ASN1_VALUE **pval, const ASN1_ITEM *it);
888
void ASN1_item_ex_free(ASN1_VALUE **pval, const ASN1_ITEM *it);
889
890
int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
891
                     const ASN1_ITEM *it, int tag, int aclass, char opt,
892
                     ASN1_TLC *ctx);
893
894
int ASN1_item_ex_i2d(const ASN1_VALUE **pval, unsigned char **out,
895
                     const ASN1_ITEM *it, int tag, int aclass);
896
897
/* Legacy compatibility */
898
# define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name)
899
# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
900
         IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)
901
902
#ifdef  __cplusplus
903
}
904
#endif
905
#endif