Coverage Report

Created: 2023-09-24 16:05

/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
82.0k
# 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
50.5M
        { \
42
50.5M
                static const ASN1_ITEM local_it = {
43
44
# define static_ASN1_ITEM_start(itname) \
45
937k
        static ASN1_ITEM_start(itname)
46
47
# define ASN1_ITEM_end(itname) \
48
50.5M
                }; \
49
50.5M
        return &local_it; \
50
50.5M
        }
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
682k
        ASN1_ITEM_start(tname) \
60
682k
                ASN1_ITYPE_PRIMITIVE,\
61
682k
                -1,\
62
682k
                &tname##_item_tt,\
63
682k
                0,\
64
682k
                NULL,\
65
682k
                0,\
66
682k
                #tname \
67
682k
        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
8.26k
        ASN1_ITEM_start(tname) \
60
8.26k
                ASN1_ITYPE_PRIMITIVE,\
61
8.26k
                -1,\
62
8.26k
                &tname##_item_tt,\
63
8.26k
                0,\
64
8.26k
                NULL,\
65
8.26k
                0,\
66
8.26k
                #tname \
67
8.26k
        ASN1_ITEM_end(tname)
CRL_DIST_POINTS_it
Line
Count
Source
59
203k
        ASN1_ITEM_start(tname) \
60
203k
                ASN1_ITYPE_PRIMITIVE,\
61
203k
                -1,\
62
203k
                &tname##_item_tt,\
63
203k
                0,\
64
203k
                NULL,\
65
203k
                0,\
66
203k
                #tname \
67
203k
        ASN1_ITEM_end(tname)
GENERAL_NAMES_it
Line
Count
Source
59
207k
        ASN1_ITEM_start(tname) \
60
207k
                ASN1_ITYPE_PRIMITIVE,\
61
207k
                -1,\
62
207k
                &tname##_item_tt,\
63
207k
                0,\
64
207k
                NULL,\
65
207k
                0,\
66
207k
                #tname \
67
207k
        ASN1_ITEM_end(tname)
AUTHORITY_INFO_ACCESS_it
Line
Count
Source
59
6.73k
        ASN1_ITEM_start(tname) \
60
6.73k
                ASN1_ITYPE_PRIMITIVE,\
61
6.73k
                -1,\
62
6.73k
                &tname##_item_tt,\
63
6.73k
                0,\
64
6.73k
                NULL,\
65
6.73k
                0,\
66
6.73k
                #tname \
67
6.73k
        ASN1_ITEM_end(tname)
POLICY_MAPPINGS_it
Line
Count
Source
59
2.04k
        ASN1_ITEM_start(tname) \
60
2.04k
                ASN1_ITYPE_PRIMITIVE,\
61
2.04k
                -1,\
62
2.04k
                &tname##_item_tt,\
63
2.04k
                0,\
64
2.04k
                NULL,\
65
2.04k
                0,\
66
2.04k
                #tname \
67
2.04k
        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
254k
        ASN1_ITEM_start(tname) \
60
254k
                ASN1_ITYPE_PRIMITIVE,\
61
254k
                -1,\
62
254k
                &tname##_item_tt,\
63
254k
                0,\
64
254k
                NULL,\
65
254k
                0,\
66
254k
                #tname \
67
254k
        ASN1_ITEM_end(tname)
68
# define static_ASN1_ITEM_TEMPLATE_END(tname) \
69
        ;\
70
880k
        static_ASN1_ITEM_start(tname) \
71
880k
                ASN1_ITYPE_PRIMITIVE,\
72
880k
                -1,\
73
880k
                &tname##_item_tt,\
74
880k
                0,\
75
880k
                NULL,\
76
880k
                0,\
77
880k
                #tname \
78
880k
        ASN1_ITEM_end(tname)
x_name.c:X509_NAME_INTERNAL_it
Line
Count
Source
70
243k
        static_ASN1_ITEM_start(tname) \
71
243k
                ASN1_ITYPE_PRIMITIVE,\
72
243k
                -1,\
73
243k
                &tname##_item_tt,\
74
243k
                0,\
75
243k
                NULL,\
76
243k
                0,\
77
243k
                #tname \
78
243k
        ASN1_ITEM_end(tname)
x_name.c:X509_NAME_ENTRIES_it
Line
Count
Source
70
623k
        static_ASN1_ITEM_start(tname) \
71
623k
                ASN1_ITYPE_PRIMITIVE,\
72
623k
                -1,\
73
623k
                &tname##_item_tt,\
74
623k
                0,\
75
623k
                NULL,\
76
623k
                0,\
77
623k
                #tname \
78
623k
        ASN1_ITEM_end(tname)
v3_addr.c:IPAddrBlocks_it
Line
Count
Source
70
11.6k
        static_ASN1_ITEM_start(tname) \
71
11.6k
                ASN1_ITYPE_PRIMITIVE,\
72
11.6k
                -1,\
73
11.6k
                &tname##_item_tt,\
74
11.6k
                0,\
75
11.6k
                NULL,\
76
11.6k
                0,\
77
11.6k
                #tname \
78
11.6k
        ASN1_ITEM_end(tname)
v3_tlsf.c:TLS_FEATURE_it
Line
Count
Source
70
1.48k
        static_ASN1_ITEM_start(tname) \
71
1.48k
                ASN1_ITYPE_PRIMITIVE,\
72
1.48k
                -1,\
73
1.48k
                &tname##_item_tt,\
74
1.48k
                0,\
75
1.48k
                NULL,\
76
1.48k
                0,\
77
1.48k
                #tname \
78
1.48k
        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
10.2M
        ASN1_ITEM_start(tname) \
113
10.2M
                ASN1_ITYPE_SEQUENCE,\
114
10.2M
                V_ASN1_SEQUENCE,\
115
10.2M
                tname##_seq_tt,\
116
10.2M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
10.2M
                NULL,\
118
10.2M
                sizeof(stname),\
119
10.2M
                #tname \
120
10.2M
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_REVOKED_it
X509_EXTENSION_it
Line
Count
Source
112
3.24M
        ASN1_ITEM_start(tname) \
113
3.24M
                ASN1_ITYPE_SEQUENCE,\
114
3.24M
                V_ASN1_SEQUENCE,\
115
3.24M
                tname##_seq_tt,\
116
3.24M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.24M
                NULL,\
118
3.24M
                sizeof(stname),\
119
3.24M
                #tname \
120
3.24M
        ASN1_ITEM_end(tname)
X509_NAME_ENTRY_it
Line
Count
Source
112
3.08M
        ASN1_ITEM_start(tname) \
113
3.08M
                ASN1_ITYPE_SEQUENCE,\
114
3.08M
                V_ASN1_SEQUENCE,\
115
3.08M
                tname##_seq_tt,\
116
3.08M
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.08M
                NULL,\
118
3.08M
                sizeof(stname),\
119
3.08M
                #tname \
120
3.08M
        ASN1_ITEM_end(tname)
X509_CERT_AUX_it
Line
Count
Source
112
192k
        ASN1_ITEM_start(tname) \
113
192k
                ASN1_ITYPE_SEQUENCE,\
114
192k
                V_ASN1_SEQUENCE,\
115
192k
                tname##_seq_tt,\
116
192k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
192k
                NULL,\
118
192k
                sizeof(stname),\
119
192k
                #tname \
120
192k
        ASN1_ITEM_end(tname)
X509_ALGOR_it
Line
Count
Source
112
952k
        ASN1_ITEM_start(tname) \
113
952k
                ASN1_ITYPE_SEQUENCE,\
114
952k
                V_ASN1_SEQUENCE,\
115
952k
                tname##_seq_tt,\
116
952k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
952k
                NULL,\
118
952k
                sizeof(stname),\
119
952k
                #tname \
120
952k
        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
256k
        ASN1_ITEM_start(tname) \
113
256k
                ASN1_ITYPE_SEQUENCE,\
114
256k
                V_ASN1_SEQUENCE,\
115
256k
                tname##_seq_tt,\
116
256k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
256k
                NULL,\
118
256k
                sizeof(stname),\
119
256k
                #tname \
120
256k
        ASN1_ITEM_end(tname)
ECPARAMETERS_it
Line
Count
Source
112
18.4k
        ASN1_ITEM_start(tname) \
113
18.4k
                ASN1_ITYPE_SEQUENCE,\
114
18.4k
                V_ASN1_SEQUENCE,\
115
18.4k
                tname##_seq_tt,\
116
18.4k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
18.4k
                NULL,\
118
18.4k
                sizeof(stname),\
119
18.4k
                #tname \
120
18.4k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS7_ISSUER_AND_SERIAL_it
Unexecuted instantiation: RSA_PRIME_INFO_it
IPAddressRange_it
Line
Count
Source
112
6.86k
        ASN1_ITEM_start(tname) \
113
6.86k
                ASN1_ITYPE_SEQUENCE,\
114
6.86k
                V_ASN1_SEQUENCE,\
115
6.86k
                tname##_seq_tt,\
116
6.86k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
6.86k
                NULL,\
118
6.86k
                sizeof(stname),\
119
6.86k
                #tname \
120
6.86k
        ASN1_ITEM_end(tname)
IPAddressFamily_it
Line
Count
Source
112
24.2k
        ASN1_ITEM_start(tname) \
113
24.2k
                ASN1_ITYPE_SEQUENCE,\
114
24.2k
                V_ASN1_SEQUENCE,\
115
24.2k
                tname##_seq_tt,\
116
24.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
24.2k
                NULL,\
118
24.2k
                sizeof(stname),\
119
24.2k
                #tname \
120
24.2k
        ASN1_ITEM_end(tname)
AUTHORITY_KEYID_it
Line
Count
Source
112
209k
        ASN1_ITEM_start(tname) \
113
209k
                ASN1_ITYPE_SEQUENCE,\
114
209k
                V_ASN1_SEQUENCE,\
115
209k
                tname##_seq_tt,\
116
209k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
209k
                NULL,\
118
209k
                sizeof(stname),\
119
209k
                #tname \
120
209k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ASRange_it
ASIdentifiers_it
Line
Count
Source
112
192k
        ASN1_ITEM_start(tname) \
113
192k
                ASN1_ITYPE_SEQUENCE,\
114
192k
                V_ASN1_SEQUENCE,\
115
192k
                tname##_seq_tt,\
116
192k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
192k
                NULL,\
118
192k
                sizeof(stname),\
119
192k
                #tname \
120
192k
        ASN1_ITEM_end(tname)
POLICYINFO_it
Line
Count
Source
112
22.4k
        ASN1_ITEM_start(tname) \
113
22.4k
                ASN1_ITYPE_SEQUENCE,\
114
22.4k
                V_ASN1_SEQUENCE,\
115
22.4k
                tname##_seq_tt,\
116
22.4k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
22.4k
                NULL,\
118
22.4k
                sizeof(stname),\
119
22.4k
                #tname \
120
22.4k
        ASN1_ITEM_end(tname)
POLICYQUALINFO_it
Line
Count
Source
112
49.5k
        ASN1_ITEM_start(tname) \
113
49.5k
                ASN1_ITYPE_SEQUENCE,\
114
49.5k
                V_ASN1_SEQUENCE,\
115
49.5k
                tname##_seq_tt,\
116
49.5k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
49.5k
                NULL,\
118
49.5k
                sizeof(stname),\
119
49.5k
                #tname \
120
49.5k
        ASN1_ITEM_end(tname)
USERNOTICE_it
Line
Count
Source
112
2.76k
        ASN1_ITEM_start(tname) \
113
2.76k
                ASN1_ITYPE_SEQUENCE,\
114
2.76k
                V_ASN1_SEQUENCE,\
115
2.76k
                tname##_seq_tt,\
116
2.76k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
2.76k
                NULL,\
118
2.76k
                sizeof(stname),\
119
2.76k
                #tname \
120
2.76k
        ASN1_ITEM_end(tname)
NOTICEREF_it
Line
Count
Source
112
6.53k
        ASN1_ITEM_start(tname) \
113
6.53k
                ASN1_ITYPE_SEQUENCE,\
114
6.53k
                V_ASN1_SEQUENCE,\
115
6.53k
                tname##_seq_tt,\
116
6.53k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
6.53k
                NULL,\
118
6.53k
                sizeof(stname),\
119
6.53k
                #tname \
120
6.53k
        ASN1_ITEM_end(tname)
DIST_POINT_it
Line
Count
Source
112
22.0k
        ASN1_ITEM_start(tname) \
113
22.0k
                ASN1_ITYPE_SEQUENCE,\
114
22.0k
                V_ASN1_SEQUENCE,\
115
22.0k
                tname##_seq_tt,\
116
22.0k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
22.0k
                NULL,\
118
22.0k
                sizeof(stname),\
119
22.0k
                #tname \
120
22.0k
        ASN1_ITEM_end(tname)
ISSUING_DIST_POINT_it
Line
Count
Source
112
6.76k
        ASN1_ITEM_start(tname) \
113
6.76k
                ASN1_ITYPE_SEQUENCE,\
114
6.76k
                V_ASN1_SEQUENCE,\
115
6.76k
                tname##_seq_tt,\
116
6.76k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
6.76k
                NULL,\
118
6.76k
                sizeof(stname),\
119
6.76k
                #tname \
120
6.76k
        ASN1_ITEM_end(tname)
OTHERNAME_it
Line
Count
Source
112
383k
        ASN1_ITEM_start(tname) \
113
383k
                ASN1_ITYPE_SEQUENCE,\
114
383k
                V_ASN1_SEQUENCE,\
115
383k
                tname##_seq_tt,\
116
383k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
383k
                NULL,\
118
383k
                sizeof(stname),\
119
383k
                #tname \
120
383k
        ASN1_ITEM_end(tname)
EDIPARTYNAME_it
Line
Count
Source
112
277k
        ASN1_ITEM_start(tname) \
113
277k
                ASN1_ITYPE_SEQUENCE,\
114
277k
                V_ASN1_SEQUENCE,\
115
277k
                tname##_seq_tt,\
116
277k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
277k
                NULL,\
118
277k
                sizeof(stname),\
119
277k
                #tname \
120
277k
        ASN1_ITEM_end(tname)
ACCESS_DESCRIPTION_it
Line
Count
Source
112
70.2k
        ASN1_ITEM_start(tname) \
113
70.2k
                ASN1_ITYPE_SEQUENCE,\
114
70.2k
                V_ASN1_SEQUENCE,\
115
70.2k
                tname##_seq_tt,\
116
70.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
70.2k
                NULL,\
118
70.2k
                sizeof(stname),\
119
70.2k
                #tname \
120
70.2k
        ASN1_ITEM_end(tname)
GENERAL_SUBTREE_it
Line
Count
Source
112
21.2k
        ASN1_ITEM_start(tname) \
113
21.2k
                ASN1_ITYPE_SEQUENCE,\
114
21.2k
                V_ASN1_SEQUENCE,\
115
21.2k
                tname##_seq_tt,\
116
21.2k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
21.2k
                NULL,\
118
21.2k
                sizeof(stname),\
119
21.2k
                #tname \
120
21.2k
        ASN1_ITEM_end(tname)
NAME_CONSTRAINTS_it
Line
Count
Source
112
195k
        ASN1_ITEM_start(tname) \
113
195k
                ASN1_ITYPE_SEQUENCE,\
114
195k
                V_ASN1_SEQUENCE,\
115
195k
                tname##_seq_tt,\
116
195k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
195k
                NULL,\
118
195k
                sizeof(stname),\
119
195k
                #tname \
120
195k
        ASN1_ITEM_end(tname)
PROXY_POLICY_it
Line
Count
Source
112
240
        ASN1_ITEM_start(tname) \
113
240
                ASN1_ITYPE_SEQUENCE,\
114
240
                V_ASN1_SEQUENCE,\
115
240
                tname##_seq_tt,\
116
240
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
240
                NULL,\
118
240
                sizeof(stname),\
119
240
                #tname \
120
240
        ASN1_ITEM_end(tname)
PROXY_CERT_INFO_EXTENSION_it
Line
Count
Source
112
160
        ASN1_ITEM_start(tname) \
113
160
                ASN1_ITYPE_SEQUENCE,\
114
160
                V_ASN1_SEQUENCE,\
115
160
                tname##_seq_tt,\
116
160
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
160
                NULL,\
118
160
                sizeof(stname),\
119
160
                #tname \
120
160
        ASN1_ITEM_end(tname)
POLICY_CONSTRAINTS_it
Line
Count
Source
112
5.19k
        ASN1_ITEM_start(tname) \
113
5.19k
                ASN1_ITYPE_SEQUENCE,\
114
5.19k
                V_ASN1_SEQUENCE,\
115
5.19k
                tname##_seq_tt,\
116
5.19k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
5.19k
                NULL,\
118
5.19k
                sizeof(stname),\
119
5.19k
                #tname \
120
5.19k
        ASN1_ITEM_end(tname)
PKEY_USAGE_PERIOD_it
Line
Count
Source
112
3.86k
        ASN1_ITEM_start(tname) \
113
3.86k
                ASN1_ITYPE_SEQUENCE,\
114
3.86k
                V_ASN1_SEQUENCE,\
115
3.86k
                tname##_seq_tt,\
116
3.86k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.86k
                NULL,\
118
3.86k
                sizeof(stname),\
119
3.86k
                #tname \
120
3.86k
        ASN1_ITEM_end(tname)
POLICY_MAPPING_it
Line
Count
Source
112
3.88k
        ASN1_ITEM_start(tname) \
113
3.88k
                ASN1_ITYPE_SEQUENCE,\
114
3.88k
                V_ASN1_SEQUENCE,\
115
3.88k
                tname##_seq_tt,\
116
3.88k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
3.88k
                NULL,\
118
3.88k
                sizeof(stname),\
119
3.88k
                #tname \
120
3.88k
        ASN1_ITEM_end(tname)
SXNETID_it
Line
Count
Source
112
41.6k
        ASN1_ITEM_start(tname) \
113
41.6k
                ASN1_ITYPE_SEQUENCE,\
114
41.6k
                V_ASN1_SEQUENCE,\
115
41.6k
                tname##_seq_tt,\
116
41.6k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
41.6k
                NULL,\
118
41.6k
                sizeof(stname),\
119
41.6k
                #tname \
120
41.6k
        ASN1_ITEM_end(tname)
SXNET_it
Line
Count
Source
112
64.9k
        ASN1_ITEM_start(tname) \
113
64.9k
                ASN1_ITYPE_SEQUENCE,\
114
64.9k
                V_ASN1_SEQUENCE,\
115
64.9k
                tname##_seq_tt,\
116
64.9k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
64.9k
                NULL,\
118
64.9k
                sizeof(stname),\
119
64.9k
                #tname \
120
64.9k
        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
47.7k
        ASN1_ITEM_start(tname) \
113
47.7k
                ASN1_ITYPE_SEQUENCE,\
114
47.7k
                V_ASN1_SEQUENCE,\
115
47.7k
                tname##_seq_tt,\
116
47.7k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
47.7k
                NULL,\
118
47.7k
                sizeof(stname),\
119
47.7k
                #tname \
120
47.7k
        ASN1_ITEM_end(tname)
OCSP_SERVICELOC_it
Line
Count
Source
112
93.3k
        ASN1_ITEM_start(tname) \
113
93.3k
                ASN1_ITYPE_SEQUENCE,\
114
93.3k
                V_ASN1_SEQUENCE,\
115
93.3k
                tname##_seq_tt,\
116
93.3k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
93.3k
                NULL,\
118
93.3k
                sizeof(stname),\
119
93.3k
                #tname \
120
93.3k
        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
37.3k
        ASN1_ITEM_start(tname) \
113
37.3k
                ASN1_ITYPE_SEQUENCE,\
114
37.3k
                V_ASN1_SEQUENCE,\
115
37.3k
                tname##_seq_tt,\
116
37.3k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
37.3k
                NULL,\
118
37.3k
                sizeof(stname),\
119
37.3k
                #tname \
120
37.3k
        ASN1_ITEM_end(tname)
PROFESSION_INFO_it
Line
Count
Source
112
9.46k
        ASN1_ITEM_start(tname) \
113
9.46k
                ASN1_ITYPE_SEQUENCE,\
114
9.46k
                V_ASN1_SEQUENCE,\
115
9.46k
                tname##_seq_tt,\
116
9.46k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
9.46k
                NULL,\
118
9.46k
                sizeof(stname),\
119
9.46k
                #tname \
120
9.46k
        ASN1_ITEM_end(tname)
ADMISSIONS_it
Line
Count
Source
112
319k
        ASN1_ITEM_start(tname) \
113
319k
                ASN1_ITYPE_SEQUENCE,\
114
319k
                V_ASN1_SEQUENCE,\
115
319k
                tname##_seq_tt,\
116
319k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
319k
                NULL,\
118
319k
                sizeof(stname),\
119
319k
                #tname \
120
319k
        ASN1_ITEM_end(tname)
ADMISSION_SYNTAX_it
Line
Count
Source
112
384k
        ASN1_ITEM_start(tname) \
113
384k
                ASN1_ITYPE_SEQUENCE,\
114
384k
                V_ASN1_SEQUENCE,\
115
384k
                tname##_seq_tt,\
116
384k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
384k
                NULL,\
118
384k
                sizeof(stname),\
119
384k
                #tname \
120
384k
        ASN1_ITEM_end(tname)
BASIC_CONSTRAINTS_it
Line
Count
Source
112
13.8k
        ASN1_ITEM_start(tname) \
113
13.8k
                ASN1_ITYPE_SEQUENCE,\
114
13.8k
                V_ASN1_SEQUENCE,\
115
13.8k
                tname##_seq_tt,\
116
13.8k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
117
13.8k
                NULL,\
118
13.8k
                sizeof(stname),\
119
13.8k
                #tname \
120
13.8k
        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
55.8k
        static_ASN1_ITEM_start(tname) \
125
55.8k
                ASN1_ITYPE_SEQUENCE,\
126
55.8k
                V_ASN1_SEQUENCE,\
127
55.8k
                tname##_seq_tt,\
128
55.8k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
55.8k
                NULL,\
130
55.8k
                sizeof(stname),\
131
55.8k
                #stname \
132
55.8k
        ASN1_ITEM_end(tname)
dh_asn1.c:DHxparams_it
Line
Count
Source
124
1.51k
        static_ASN1_ITEM_start(tname) \
125
1.51k
                ASN1_ITYPE_SEQUENCE,\
126
1.51k
                V_ASN1_SEQUENCE,\
127
1.51k
                tname##_seq_tt,\
128
1.51k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
1.51k
                NULL,\
130
1.51k
                sizeof(stname),\
131
1.51k
                #stname \
132
1.51k
        ASN1_ITEM_end(tname)
dh_asn1.c:DHvparams_it
Line
Count
Source
124
5.01k
        static_ASN1_ITEM_start(tname) \
125
5.01k
                ASN1_ITYPE_SEQUENCE,\
126
5.01k
                V_ASN1_SEQUENCE,\
127
5.01k
                tname##_seq_tt,\
128
5.01k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
5.01k
                NULL,\
130
5.01k
                sizeof(stname),\
131
5.01k
                #stname \
132
5.01k
        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
944
        static_ASN1_ITEM_start(tname) \
125
944
                ASN1_ITYPE_SEQUENCE,\
126
944
                V_ASN1_SEQUENCE,\
127
944
                tname##_seq_tt,\
128
944
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
944
                NULL,\
130
944
                sizeof(stname),\
131
944
                #stname \
132
944
        ASN1_ITEM_end(tname)
ec_asn1.c:X9_62_FIELDID_it
Line
Count
Source
124
26.4k
        static_ASN1_ITEM_start(tname) \
125
26.4k
                ASN1_ITYPE_SEQUENCE,\
126
26.4k
                V_ASN1_SEQUENCE,\
127
26.4k
                tname##_seq_tt,\
128
26.4k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
26.4k
                NULL,\
130
26.4k
                sizeof(stname),\
131
26.4k
                #stname \
132
26.4k
        ASN1_ITEM_end(tname)
ec_asn1.c:X9_62_CURVE_it
Line
Count
Source
124
21.8k
        static_ASN1_ITEM_start(tname) \
125
21.8k
                ASN1_ITYPE_SEQUENCE,\
126
21.8k
                V_ASN1_SEQUENCE,\
127
21.8k
                tname##_seq_tt,\
128
21.8k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
129
21.8k
                NULL,\
130
21.8k
                sizeof(stname),\
131
21.8k
                #stname \
132
21.8k
        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
911k
        ASN1_ITEM_start(tname) \
194
911k
                ASN1_ITYPE_SEQUENCE,\
195
911k
                V_ASN1_SEQUENCE,\
196
911k
                tname##_seq_tt,\
197
911k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
911k
                &tname##_aux,\
199
911k
                sizeof(stname),\
200
911k
                #tname \
201
911k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_CRL_INFO_it
Unexecuted instantiation: X509_CRL_it
X509_PUBKEY_it
Line
Count
Source
193
255k
        ASN1_ITEM_start(tname) \
194
255k
                ASN1_ITYPE_SEQUENCE,\
195
255k
                V_ASN1_SEQUENCE,\
196
255k
                tname##_seq_tt,\
197
255k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
255k
                &tname##_aux,\
199
255k
                sizeof(stname),\
200
255k
                #tname \
201
255k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: X509_REQ_INFO_it
Unexecuted instantiation: X509_REQ_it
X509_CINF_it
Line
Count
Source
193
431k
        ASN1_ITEM_start(tname) \
194
431k
                ASN1_ITYPE_SEQUENCE,\
195
431k
                V_ASN1_SEQUENCE,\
196
431k
                tname##_seq_tt,\
197
431k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
431k
                &tname##_aux,\
199
431k
                sizeof(stname),\
200
431k
                #tname \
201
431k
        ASN1_ITEM_end(tname)
X509_it
Line
Count
Source
193
191k
        ASN1_ITEM_start(tname) \
194
191k
                ASN1_ITYPE_SEQUENCE,\
195
191k
                V_ASN1_SEQUENCE,\
196
191k
                tname##_seq_tt,\
197
191k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
191k
                &tname##_aux,\
199
191k
                sizeof(stname),\
200
191k
                #tname \
201
191k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_it
DHparams_it
Line
Count
Source
193
100
        ASN1_ITEM_start(tname) \
194
100
                ASN1_ITYPE_SEQUENCE,\
195
100
                V_ASN1_SEQUENCE,\
196
100
                tname##_seq_tt,\
197
100
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
100
                &tname##_aux,\
199
100
                sizeof(stname),\
200
100
                #tname \
201
100
        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
13.8k
        ASN1_ITEM_start(tname) \
194
13.8k
                ASN1_ITYPE_SEQUENCE,\
195
13.8k
                V_ASN1_SEQUENCE,\
196
13.8k
                tname##_seq_tt,\
197
13.8k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
13.8k
                &tname##_aux,\
199
13.8k
                sizeof(stname),\
200
13.8k
                #tname \
201
13.8k
        ASN1_ITEM_end(tname)
RSA_PSS_PARAMS_it
Line
Count
Source
193
18.6k
        ASN1_ITEM_start(tname) \
194
18.6k
                ASN1_ITYPE_SEQUENCE,\
195
18.6k
                V_ASN1_SEQUENCE,\
196
18.6k
                tname##_seq_tt,\
197
18.6k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
198
18.6k
                &tname##_aux,\
199
18.6k
                sizeof(stname),\
200
18.6k
                #tname \
201
18.6k
        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
1.63k
        static_ASN1_ITEM_start(tname) \
205
1.63k
                ASN1_ITYPE_SEQUENCE,\
206
1.63k
                V_ASN1_SEQUENCE,\
207
1.63k
                tname##_seq_tt,\
208
1.63k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
209
1.63k
                &tname##_aux,\
210
1.63k
                sizeof(stname),\
211
1.63k
                #stname \
212
1.63k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: dsa_asn1.c:DSAPrivateKey_it
dsa_asn1.c:DSAparams_it
Line
Count
Source
204
1.63k
        static_ASN1_ITEM_start(tname) \
205
1.63k
                ASN1_ITYPE_SEQUENCE,\
206
1.63k
                V_ASN1_SEQUENCE,\
207
1.63k
                tname##_seq_tt,\
208
1.63k
                sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
209
1.63k
                &tname##_aux,\
210
1.63k
                sizeof(stname),\
211
1.63k
                #stname \
212
1.63k
        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.50M
        ASN1_ITEM_start(tname) \
267
1.50M
                ASN1_ITYPE_CHOICE,\
268
1.50M
                offsetof(stname,selname) ,\
269
1.50M
                tname##_ch_tt,\
270
1.50M
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
1.50M
                NULL,\
272
1.50M
                sizeof(stname),\
273
1.50M
                #stname \
274
1.50M
        ASN1_ITEM_end(tname)
ECPKPARAMETERS_it
Line
Count
Source
266
18.4k
        ASN1_ITEM_start(tname) \
267
18.4k
                ASN1_ITYPE_CHOICE,\
268
18.4k
                offsetof(stname,selname) ,\
269
18.4k
                tname##_ch_tt,\
270
18.4k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
18.4k
                NULL,\
272
18.4k
                sizeof(stname),\
273
18.4k
                #stname \
274
18.4k
        ASN1_ITEM_end(tname)
IPAddressOrRange_it
Line
Count
Source
266
36.7k
        ASN1_ITEM_start(tname) \
267
36.7k
                ASN1_ITYPE_CHOICE,\
268
36.7k
                offsetof(stname,selname) ,\
269
36.7k
                tname##_ch_tt,\
270
36.7k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
36.7k
                NULL,\
272
36.7k
                sizeof(stname),\
273
36.7k
                #stname \
274
36.7k
        ASN1_ITEM_end(tname)
IPAddressChoice_it
Line
Count
Source
266
36.0k
        ASN1_ITEM_start(tname) \
267
36.0k
                ASN1_ITYPE_CHOICE,\
268
36.0k
                offsetof(stname,selname) ,\
269
36.0k
                tname##_ch_tt,\
270
36.0k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
36.0k
                NULL,\
272
36.0k
                sizeof(stname),\
273
36.0k
                #stname \
274
36.0k
        ASN1_ITEM_end(tname)
Unexecuted instantiation: ASIdOrRange_it
ASIdentifierChoice_it
Line
Count
Source
266
1.40k
        ASN1_ITEM_start(tname) \
267
1.40k
                ASN1_ITYPE_CHOICE,\
268
1.40k
                offsetof(stname,selname) ,\
269
1.40k
                tname##_ch_tt,\
270
1.40k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
1.40k
                NULL,\
272
1.40k
                sizeof(stname),\
273
1.40k
                #stname \
274
1.40k
        ASN1_ITEM_end(tname)
GENERAL_NAME_it
Line
Count
Source
266
1.41M
        ASN1_ITEM_start(tname) \
267
1.41M
                ASN1_ITYPE_CHOICE,\
268
1.41M
                offsetof(stname,selname) ,\
269
1.41M
                tname##_ch_tt,\
270
1.41M
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
271
1.41M
                NULL,\
272
1.41M
                sizeof(stname),\
273
1.41M
                #stname \
274
1.41M
        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
56.6k
        ASN1_ITEM_start(tname) \
291
56.6k
                ASN1_ITYPE_CHOICE,\
292
56.6k
                offsetof(stname,selname) ,\
293
56.6k
                tname##_ch_tt,\
294
56.6k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
295
56.6k
                &tname##_aux,\
296
56.6k
                sizeof(stname),\
297
56.6k
                #stname \
298
56.6k
        ASN1_ITEM_end(tname)
DIST_POINT_NAME_it
Line
Count
Source
290
56.6k
        ASN1_ITEM_start(tname) \
291
56.6k
                ASN1_ITYPE_CHOICE,\
292
56.6k
                offsetof(stname,selname) ,\
293
56.6k
                tname##_ch_tt,\
294
56.6k
                sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
295
56.6k
                &tname##_aux,\
296
56.6k
                sizeof(stname),\
297
56.6k
                #stname \
298
56.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
111k
        { \
410
111k
        static const ASN1_ADB internal_adb = \
411
111k
                {\
412
111k
                flags,\
413
111k
                offsetof(name, field),\
414
111k
                adb_cb,\
415
111k
                name##_adbtbl,\
416
111k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
111k
                def,\
418
111k
                none\
419
111k
                }; \
420
111k
                return (const ASN1_ITEM *) &internal_adb; \
421
111k
        } \
ec_asn1.c:X9_62_CHARACTERISTIC_TWO_adb
Line
Count
Source
409
1.56k
        { \
410
1.56k
        static const ASN1_ADB internal_adb = \
411
1.56k
                {\
412
1.56k
                flags,\
413
1.56k
                offsetof(name, field),\
414
1.56k
                adb_cb,\
415
1.56k
                name##_adbtbl,\
416
1.56k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
1.56k
                def,\
418
1.56k
                none\
419
1.56k
                }; \
420
1.56k
                return (const ASN1_ITEM *) &internal_adb; \
421
1.56k
        } \
ec_asn1.c:X9_62_FIELDID_adb
Line
Count
Source
409
32.9k
        { \
410
32.9k
        static const ASN1_ADB internal_adb = \
411
32.9k
                {\
412
32.9k
                flags,\
413
32.9k
                offsetof(name, field),\
414
32.9k
                adb_cb,\
415
32.9k
                name##_adbtbl,\
416
32.9k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
32.9k
                def,\
418
32.9k
                none\
419
32.9k
                }; \
420
32.9k
                return (const ASN1_ITEM *) &internal_adb; \
421
32.9k
        } \
Unexecuted instantiation: pk7_asn1.c:PKCS7_adb
v3_cpols.c:POLICYQUALINFO_adb
Line
Count
Source
409
76.5k
        { \
410
76.5k
        static const ASN1_ADB internal_adb = \
411
76.5k
                {\
412
76.5k
                flags,\
413
76.5k
                offsetof(name, field),\
414
76.5k
                adb_cb,\
415
76.5k
                name##_adbtbl,\
416
76.5k
                sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
417
76.5k
                def,\
418
76.5k
                none\
419
76.5k
                }; \
420
76.5k
                return (const ASN1_ITEM *) &internal_adb; \
421
76.5k
        } \
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
16.2M
# define ASN1_TFLG_OPTIONAL      (0x1)
470
471
/* Field is a SET OF */
472
1.24M
# define ASN1_TFLG_SET_OF        (0x1 << 1)
473
474
/* Field is a SEQUENCE OF */
475
341k
# 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
39.1M
# 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
10.5M
# define ASN1_TFLG_IMPTAG        (0x1 << 3)
494
495
/* EXPLICIT tagging, inner tag from underlying type */
496
15.7M
# define ASN1_TFLG_EXPTAG        (0x2 << 3)
497
498
4.66M
# 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
27.6M
# 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
43.1M
# define ASN1_TFLG_ADB_MASK      (0x3<<8)
530
531
52.7k
# 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
6.75M
# define ASN1_TFLG_NDEF          (0x1<<11)
541
542
/* Field is embedded and not a pointer */
543
39.2M
# 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
89.7M
# define ASN1_ITYPE_PRIMITIVE            0x0
601
602
32.7M
# define ASN1_ITYPE_SEQUENCE             0x1
603
604
3.10M
# define ASN1_ITYPE_CHOICE               0x2
605
606
1.58M
# define ASN1_ITYPE_EXTERN               0x4
607
608
50.3M
# define ASN1_ITYPE_MSTRING              0x5
609
610
335k
# 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
589k
# define ASN1_AFLG_REFCOUNT      1
723
/* Save the encoding of structure (useful for signatures) */
724
986k
# define ASN1_AFLG_ENCODING      2
725
/* The Sequence length is invalid */
726
271k
# define ASN1_AFLG_BROKEN        4
727
/* Use the new asn1_const_cb */
728
239k
# define ASN1_AFLG_CONST_CB      8
729
730
/* operation values for asn1_cb */
731
732
254k
# define ASN1_OP_NEW_PRE         0
733
400k
# define ASN1_OP_NEW_POST        1
734
250k
# define ASN1_OP_FREE_PRE        2
735
813k
# define ASN1_OP_FREE_POST       3
736
278k
# define ASN1_OP_D2I_PRE         4
737
551k
# define ASN1_OP_D2I_POST        5
738
95.6k
# define ASN1_OP_I2D_PRE         6
739
47.8k
# 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
29.8M
                                ASN1_ITEM_start(itname) \
751
29.8M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
29.8M
                                ASN1_ITEM_end(itname)
ASN1_OCTET_STRING_it
Line
Count
Source
750
5.13M
                                ASN1_ITEM_start(itname) \
751
5.13M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
5.13M
                                ASN1_ITEM_end(itname)
ASN1_INTEGER_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)
ASN1_ENUMERATED_it
Line
Count
Source
750
7.68k
                                ASN1_ITEM_start(itname) \
751
7.68k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
7.68k
                                ASN1_ITEM_end(itname)
ASN1_BIT_STRING_it
Line
Count
Source
750
1.59M
                                ASN1_ITEM_start(itname) \
751
1.59M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
1.59M
                                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
953k
                                ASN1_ITEM_start(itname) \
751
953k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
953k
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_GENERALSTRING_it
Unexecuted instantiation: ASN1_UTCTIME_it
ASN1_GENERALIZEDTIME_it
Line
Count
Source
750
495k
                                ASN1_ITEM_start(itname) \
751
495k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
495k
                                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
75.0k
                                ASN1_ITEM_start(itname) \
751
75.0k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
75.0k
                                ASN1_ITEM_end(itname)
ASN1_OBJECT_it
Line
Count
Source
750
10.5M
                                ASN1_ITEM_start(itname) \
751
10.5M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
10.5M
                                ASN1_ITEM_end(itname)
ASN1_ANY_it
Line
Count
Source
750
1.56M
                                ASN1_ITEM_start(itname) \
751
1.56M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
1.56M
                                ASN1_ITEM_end(itname)
ASN1_SEQUENCE_it
Line
Count
Source
750
343k
                                ASN1_ITEM_start(itname) \
751
343k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
343k
                                ASN1_ITEM_end(itname)
ASN1_BOOLEAN_it
Line
Count
Source
750
7.85M
                                ASN1_ITEM_start(itname) \
751
7.85M
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
7.85M
                                ASN1_ITEM_end(itname)
Unexecuted instantiation: ASN1_TBOOLEAN_it
ASN1_FBOOLEAN_it
Line
Count
Source
750
84.4k
                                ASN1_ITEM_start(itname) \
751
84.4k
                                        ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
752
84.4k
                                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
5.50M
                                ASN1_ITEM_start(itname) \
757
5.50M
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
5.50M
                                ASN1_ITEM_end(itname)
ASN1_TIME_it
Line
Count
Source
756
512k
                                ASN1_ITEM_start(itname) \
757
512k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
512k
                                ASN1_ITEM_end(itname)
ASN1_PRINTABLE_it
Line
Count
Source
756
4.27M
                                ASN1_ITEM_start(itname) \
757
4.27M
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
4.27M
                                ASN1_ITEM_end(itname)
DISPLAYTEXT_it
Line
Count
Source
756
6.17k
                                ASN1_ITEM_start(itname) \
757
6.17k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
6.17k
                                ASN1_ITEM_end(itname)
DIRECTORYSTRING_it
Line
Count
Source
756
711k
                                ASN1_ITEM_start(itname) \
757
711k
                                        ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
758
711k
                                ASN1_ITEM_end(itname)
759
760
# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
761
802k
        ASN1_ITEM_start(sname) \
762
802k
                ASN1_ITYPE_EXTERN, \
763
802k
                tag, \
764
802k
                NULL, \
765
802k
                0, \
766
802k
                &fptrs, \
767
802k
                0, \
768
802k
                #sname \
769
802k
        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
558k
        { \
799
558k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
558k
        } \
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
453k
        { \
799
453k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
453k
        } \
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
104k
        { \
799
104k
                return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
800
104k
        } \
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
2.30M
        { \
803
2.30M
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
2.30M
        }
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
956k
        { \
803
956k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
956k
        }
X509_NAME_free
Line
Count
Source
802
8.61k
        { \
803
8.61k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
8.61k
        }
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
47.8k
        { \
803
47.8k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
47.8k
        }
X509_CERT_AUX_free
Line
Count
Source
802
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
Unexecuted instantiation: ASN1_TIME_free
Unexecuted instantiation: PKCS8_PRIV_KEY_INFO_free
Unexecuted instantiation: ASN1_NULL_free
ASN1_TYPE_free
Line
Count
Source
802
115k
        { \
803
115k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
115k
        }
Unexecuted instantiation: ASN1_PRINTABLE_free
Unexecuted instantiation: DISPLAYTEXT_free
Unexecuted instantiation: DIRECTORYSTRING_free
X509_ALGOR_free
Line
Count
Source
802
3.39k
        { \
803
3.39k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
3.39k
        }
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
9.24k
        { \
803
9.24k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
9.24k
        }
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
15.2k
        { \
803
15.2k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
15.2k
        }
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
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
Unexecuted instantiation: ASRange_free
Unexecuted instantiation: ASIdOrRange_free
Unexecuted instantiation: ASIdentifierChoice_free
ASIdentifiers_free
Line
Count
Source
802
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
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
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
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
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
Unexecuted instantiation: ACCESS_DESCRIPTION_free
Unexecuted instantiation: AUTHORITY_INFO_ACCESS_free
Unexecuted instantiation: GENERAL_SUBTREE_free
NAME_CONSTRAINTS_free
Line
Count
Source
802
192k
        { \
803
192k
                ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
804
192k
        }
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
279k
        { \
813
279k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
279k
        } \
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
96.1k
        { \
813
96.1k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
96.1k
        } \
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
154k
        { \
813
154k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
154k
        } \
d2i_ASN1_INTEGER
Line
Count
Source
812
2.90k
        { \
813
2.90k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
2.90k
        } \
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
100
        { \
813
100
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
100
        } \
d2i_int_dhx
Line
Count
Source
812
1.51k
        { \
813
1.51k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
1.51k
        } \
Unexecuted instantiation: d2i_DSAPrivateKey
d2i_DSAparams
Line
Count
Source
812
1.63k
        { \
813
1.63k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
1.63k
        } \
Unexecuted instantiation: d2i_DSAPublicKey
d2i_ECPKPARAMETERS
Line
Count
Source
812
9.24k
        { \
813
9.24k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
9.24k
        } \
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
13.8k
        { \
813
13.8k
                return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
814
13.8k
        } \
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
50.3k
        { \
817
50.3k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
50.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
47.8k
        { \
817
47.8k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
47.8k
        }
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
2.48k
        { \
817
2.48k
                return ASN1_item_i2d((ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
818
2.48k
        }
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