/src/openssl/include/openssl/asn1.h
Line | Count | Source (jump to first uncovered line) |
1 | | /* |
2 | | * WARNING: do not edit! |
3 | | * Generated by Makefile from include/openssl/asn1.h.in |
4 | | * |
5 | | * Copyright 1995-2025 The OpenSSL Project Authors. All Rights Reserved. |
6 | | * |
7 | | * Licensed under the Apache License 2.0 (the "License"). You may not use |
8 | | * this file except in compliance with the License. You can obtain a copy |
9 | | * in the file LICENSE in the source distribution or at |
10 | | * https://www.openssl.org/source/license.html |
11 | | */ |
12 | | |
13 | | |
14 | | |
15 | | #ifndef OPENSSL_ASN1_H |
16 | | # define OPENSSL_ASN1_H |
17 | | # pragma once |
18 | | |
19 | | # include <openssl/macros.h> |
20 | | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
21 | | # define HEADER_ASN1_H |
22 | | # endif |
23 | | |
24 | | # ifndef OPENSSL_NO_STDIO |
25 | | # include <stdio.h> |
26 | | # endif |
27 | | # include <time.h> |
28 | | # include <openssl/e_os2.h> |
29 | | # include <openssl/opensslconf.h> |
30 | | # include <openssl/bio.h> |
31 | | # include <openssl/safestack.h> |
32 | | # include <openssl/asn1err.h> |
33 | | # include <openssl/symhacks.h> |
34 | | |
35 | | # include <openssl/types.h> |
36 | | # include <openssl/bn.h> |
37 | | |
38 | | # ifdef OPENSSL_BUILD_SHLIBCRYPTO |
39 | | # undef OPENSSL_EXTERN |
40 | | # define OPENSSL_EXTERN OPENSSL_EXPORT |
41 | | # endif |
42 | | |
43 | | #ifdef __cplusplus |
44 | | extern "C" { |
45 | | #endif |
46 | | |
47 | 0 | # define V_ASN1_UNIVERSAL 0x00 |
48 | 0 | # define V_ASN1_APPLICATION 0x40 |
49 | 0 | # define V_ASN1_CONTEXT_SPECIFIC 0x80 |
50 | 0 | # define V_ASN1_PRIVATE 0xc0 |
51 | | |
52 | 0 | # define V_ASN1_CONSTRUCTED 0x20 |
53 | 0 | # define V_ASN1_PRIMITIVE_TAG 0x1f |
54 | | # define V_ASN1_PRIMATIVE_TAG /*compat*/ V_ASN1_PRIMITIVE_TAG |
55 | | |
56 | 0 | # define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */ |
57 | 0 | # define V_ASN1_OTHER -3 /* used in ASN1_TYPE */ |
58 | 0 | # define V_ASN1_ANY -4 /* used in ASN1 template code */ |
59 | | |
60 | 0 | # define V_ASN1_UNDEF -1 |
61 | | /* ASN.1 tag values */ |
62 | 0 | # define V_ASN1_EOC 0 |
63 | 0 | # define V_ASN1_BOOLEAN 1 |
64 | 0 | # define V_ASN1_INTEGER 2 |
65 | 0 | # define V_ASN1_BIT_STRING 3 |
66 | 0 | # define V_ASN1_OCTET_STRING 4 |
67 | 0 | # define V_ASN1_NULL 5 |
68 | 0 | # define V_ASN1_OBJECT 6 |
69 | 0 | # define V_ASN1_OBJECT_DESCRIPTOR 7 |
70 | | # define V_ASN1_EXTERNAL 8 |
71 | 0 | # define V_ASN1_REAL 9 |
72 | 0 | # define V_ASN1_ENUMERATED 10 |
73 | 0 | # define V_ASN1_UTF8STRING 12 |
74 | 0 | # define V_ASN1_SEQUENCE 16 |
75 | 0 | # define V_ASN1_SET 17 |
76 | 0 | # define V_ASN1_NUMERICSTRING 18 |
77 | 0 | # define V_ASN1_PRINTABLESTRING 19 |
78 | 0 | # define V_ASN1_T61STRING 20 |
79 | | # define V_ASN1_TELETEXSTRING 20 /* alias */ |
80 | 0 | # define V_ASN1_VIDEOTEXSTRING 21 |
81 | 0 | # define V_ASN1_IA5STRING 22 |
82 | 0 | # define V_ASN1_UTCTIME 23 |
83 | 0 | # define V_ASN1_GENERALIZEDTIME 24 |
84 | 0 | # define V_ASN1_GRAPHICSTRING 25 |
85 | | # define V_ASN1_ISO64STRING 26 |
86 | 0 | # define V_ASN1_VISIBLESTRING 26 /* alias */ |
87 | 0 | # define V_ASN1_GENERALSTRING 27 |
88 | 0 | # define V_ASN1_UNIVERSALSTRING 28 |
89 | 0 | # define V_ASN1_BMPSTRING 30 |
90 | | |
91 | | /* |
92 | | * NB the constants below are used internally by ASN1_INTEGER |
93 | | * and ASN1_ENUMERATED to indicate the sign. They are *not* on |
94 | | * the wire tag values. |
95 | | */ |
96 | | |
97 | 0 | # define V_ASN1_NEG 0x100 |
98 | 0 | # define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG) |
99 | 0 | # define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG) |
100 | | |
101 | | /* For use with d2i_ASN1_type_bytes() */ |
102 | 0 | # define B_ASN1_NUMERICSTRING 0x0001 |
103 | 0 | # define B_ASN1_PRINTABLESTRING 0x0002 |
104 | 0 | # define B_ASN1_T61STRING 0x0004 |
105 | 0 | # define B_ASN1_TELETEXSTRING 0x0004 |
106 | | # define B_ASN1_VIDEOTEXSTRING 0x0008 |
107 | 0 | # define B_ASN1_IA5STRING 0x0010 |
108 | | # define B_ASN1_GRAPHICSTRING 0x0020 |
109 | | # define B_ASN1_ISO64STRING 0x0040 |
110 | 0 | # define B_ASN1_VISIBLESTRING 0x0040 |
111 | | # define B_ASN1_GENERALSTRING 0x0080 |
112 | 0 | # define B_ASN1_UNIVERSALSTRING 0x0100 |
113 | | # define B_ASN1_OCTET_STRING 0x0200 |
114 | | # define B_ASN1_BIT_STRING 0x0400 |
115 | 0 | # define B_ASN1_BMPSTRING 0x0800 |
116 | | # define B_ASN1_UNKNOWN 0x1000 |
117 | 0 | # define B_ASN1_UTF8STRING 0x2000 |
118 | | # define B_ASN1_UTCTIME 0x4000 |
119 | | # define B_ASN1_GENERALIZEDTIME 0x8000 |
120 | | # define B_ASN1_SEQUENCE 0x10000 |
121 | | /* For use with ASN1_mbstring_copy() */ |
122 | 0 | # define MBSTRING_FLAG 0x1000 |
123 | 0 | # define MBSTRING_UTF8 (MBSTRING_FLAG) |
124 | 0 | # define MBSTRING_ASC (MBSTRING_FLAG|1) |
125 | 0 | # define MBSTRING_BMP (MBSTRING_FLAG|2) |
126 | 0 | # define MBSTRING_UNIV (MBSTRING_FLAG|4) |
127 | | # define SMIME_OLDMIME 0x400 |
128 | | # define SMIME_CRLFEOL 0x800 |
129 | | # define SMIME_STREAM 0x1000 |
130 | | |
131 | | /* Stacks for types not otherwise defined in this header */ |
132 | | SKM_DEFINE_STACK_OF_INTERNAL(X509_ALGOR, X509_ALGOR, X509_ALGOR) |
133 | 0 | #define sk_X509_ALGOR_num(sk) OPENSSL_sk_num(ossl_check_const_X509_ALGOR_sk_type(sk)) |
134 | 0 | #define sk_X509_ALGOR_value(sk, idx) ((X509_ALGOR *)OPENSSL_sk_value(ossl_check_const_X509_ALGOR_sk_type(sk), (idx))) |
135 | | #define sk_X509_ALGOR_new(cmp) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new(ossl_check_X509_ALGOR_compfunc_type(cmp))) |
136 | | #define sk_X509_ALGOR_new_null() ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_null()) |
137 | | #define sk_X509_ALGOR_new_reserve(cmp, n) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_new_reserve(ossl_check_X509_ALGOR_compfunc_type(cmp), (n))) |
138 | | #define sk_X509_ALGOR_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_X509_ALGOR_sk_type(sk), (n)) |
139 | | #define sk_X509_ALGOR_free(sk) OPENSSL_sk_free(ossl_check_X509_ALGOR_sk_type(sk)) |
140 | | #define sk_X509_ALGOR_zero(sk) OPENSSL_sk_zero(ossl_check_X509_ALGOR_sk_type(sk)) |
141 | | #define sk_X509_ALGOR_delete(sk, i) ((X509_ALGOR *)OPENSSL_sk_delete(ossl_check_X509_ALGOR_sk_type(sk), (i))) |
142 | | #define sk_X509_ALGOR_delete_ptr(sk, ptr) ((X509_ALGOR *)OPENSSL_sk_delete_ptr(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr))) |
143 | 0 | #define sk_X509_ALGOR_push(sk, ptr) OPENSSL_sk_push(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) |
144 | | #define sk_X509_ALGOR_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) |
145 | | #define sk_X509_ALGOR_pop(sk) ((X509_ALGOR *)OPENSSL_sk_pop(ossl_check_X509_ALGOR_sk_type(sk))) |
146 | | #define sk_X509_ALGOR_shift(sk) ((X509_ALGOR *)OPENSSL_sk_shift(ossl_check_X509_ALGOR_sk_type(sk))) |
147 | | #define sk_X509_ALGOR_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_freefunc_type(freefunc)) |
148 | | #define sk_X509_ALGOR_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), (idx)) |
149 | | #define sk_X509_ALGOR_set(sk, idx, ptr) ((X509_ALGOR *)OPENSSL_sk_set(ossl_check_X509_ALGOR_sk_type(sk), (idx), ossl_check_X509_ALGOR_type(ptr))) |
150 | | #define sk_X509_ALGOR_find(sk, ptr) OPENSSL_sk_find(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) |
151 | | #define sk_X509_ALGOR_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr)) |
152 | | #define sk_X509_ALGOR_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_type(ptr), pnum) |
153 | | #define sk_X509_ALGOR_sort(sk) OPENSSL_sk_sort(ossl_check_X509_ALGOR_sk_type(sk)) |
154 | | #define sk_X509_ALGOR_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_X509_ALGOR_sk_type(sk)) |
155 | | #define sk_X509_ALGOR_dup(sk) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_dup(ossl_check_const_X509_ALGOR_sk_type(sk))) |
156 | | #define sk_X509_ALGOR_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(X509_ALGOR) *)OPENSSL_sk_deep_copy(ossl_check_const_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_copyfunc_type(copyfunc), ossl_check_X509_ALGOR_freefunc_type(freefunc))) |
157 | | #define sk_X509_ALGOR_set_cmp_func(sk, cmp) ((sk_X509_ALGOR_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_X509_ALGOR_sk_type(sk), ossl_check_X509_ALGOR_compfunc_type(cmp))) |
158 | | |
159 | | |
160 | | |
161 | 0 | # define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */ |
162 | | /* |
163 | | * This indicates that the ASN1_STRING is not a real value but just a place |
164 | | * holder for the location where indefinite length constructed data should be |
165 | | * inserted in the memory buffer |
166 | | */ |
167 | 0 | # define ASN1_STRING_FLAG_NDEF 0x010 |
168 | | |
169 | | /* |
170 | | * This flag is used by the CMS code to indicate that a string is not |
171 | | * complete and is a place holder for content when it had all been accessed. |
172 | | * The flag will be reset when content has been written to it. |
173 | | */ |
174 | | |
175 | | # define ASN1_STRING_FLAG_CONT 0x020 |
176 | | /* |
177 | | * This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING |
178 | | * type. |
179 | | */ |
180 | 0 | # define ASN1_STRING_FLAG_MSTRING 0x040 |
181 | | /* String is embedded and only content should be freed */ |
182 | 0 | # define ASN1_STRING_FLAG_EMBED 0x080 |
183 | | /* String should be parsed in RFC 5280's time format */ |
184 | 0 | # define ASN1_STRING_FLAG_X509_TIME 0x100 |
185 | | /* This is the base type that holds just about everything :-) */ |
186 | | struct asn1_string_st { |
187 | | int length; |
188 | | int type; |
189 | | unsigned char *data; |
190 | | /* |
191 | | * The value of the following field depends on the type being held. It |
192 | | * is mostly being used for BIT_STRING so if the input data has a |
193 | | * non-zero 'unused bits' value, it will be handled correctly |
194 | | */ |
195 | | long flags; |
196 | | }; |
197 | | |
198 | | /* |
199 | | * ASN1_ENCODING structure: this is used to save the received encoding of an |
200 | | * ASN1 type. This is useful to get round problems with invalid encodings |
201 | | * which can break signatures. |
202 | | */ |
203 | | |
204 | | typedef struct ASN1_ENCODING_st { |
205 | | unsigned char *enc; /* DER encoding */ |
206 | | long len; /* Length of encoding */ |
207 | | int modified; /* set to 1 if 'enc' is invalid */ |
208 | | } ASN1_ENCODING; |
209 | | |
210 | | /* Used with ASN1 LONG type: if a long is set to this it is omitted */ |
211 | | # define ASN1_LONG_UNDEF 0x7fffffffL |
212 | | |
213 | 0 | # define STABLE_FLAGS_MALLOC 0x01 |
214 | | /* |
215 | | * A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted |
216 | | * as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting |
217 | | * STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias |
218 | | * STABLE_FLAGS_CLEAR to reflect this. |
219 | | */ |
220 | 0 | # define STABLE_FLAGS_CLEAR STABLE_FLAGS_MALLOC |
221 | 0 | # define STABLE_NO_MASK 0x02 |
222 | | # define DIRSTRING_TYPE \ |
223 | 0 | (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING) |
224 | | # define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING) |
225 | | |
226 | | struct asn1_string_table_st { |
227 | | int nid; |
228 | | long minsize; |
229 | | long maxsize; |
230 | | unsigned long mask; |
231 | | unsigned long flags; |
232 | | }; |
233 | | |
234 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_STRING_TABLE, ASN1_STRING_TABLE, ASN1_STRING_TABLE) |
235 | | #define sk_ASN1_STRING_TABLE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)) |
236 | 0 | #define sk_ASN1_STRING_TABLE_value(sk, idx) ((ASN1_STRING_TABLE *)OPENSSL_sk_value(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), (idx))) |
237 | 0 | #define sk_ASN1_STRING_TABLE_new(cmp) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp))) |
238 | | #define sk_ASN1_STRING_TABLE_new_null() ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_null()) |
239 | | #define sk_ASN1_STRING_TABLE_new_reserve(cmp, n) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp), (n))) |
240 | | #define sk_ASN1_STRING_TABLE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (n)) |
241 | | #define sk_ASN1_STRING_TABLE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) |
242 | | #define sk_ASN1_STRING_TABLE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) |
243 | | #define sk_ASN1_STRING_TABLE_delete(sk, i) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (i))) |
244 | | #define sk_ASN1_STRING_TABLE_delete_ptr(sk, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr))) |
245 | 0 | #define sk_ASN1_STRING_TABLE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) |
246 | | #define sk_ASN1_STRING_TABLE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) |
247 | | #define sk_ASN1_STRING_TABLE_pop(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_pop(ossl_check_ASN1_STRING_TABLE_sk_type(sk))) |
248 | | #define sk_ASN1_STRING_TABLE_shift(sk) ((ASN1_STRING_TABLE *)OPENSSL_sk_shift(ossl_check_ASN1_STRING_TABLE_sk_type(sk))) |
249 | 0 | #define sk_ASN1_STRING_TABLE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc)) |
250 | | #define sk_ASN1_STRING_TABLE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), (idx)) |
251 | | #define sk_ASN1_STRING_TABLE_set(sk, idx, ptr) ((ASN1_STRING_TABLE *)OPENSSL_sk_set(ossl_check_ASN1_STRING_TABLE_sk_type(sk), (idx), ossl_check_ASN1_STRING_TABLE_type(ptr))) |
252 | 0 | #define sk_ASN1_STRING_TABLE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) |
253 | | #define sk_ASN1_STRING_TABLE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr)) |
254 | | #define sk_ASN1_STRING_TABLE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_type(ptr), pnum) |
255 | 0 | #define sk_ASN1_STRING_TABLE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_STRING_TABLE_sk_type(sk)) |
256 | | #define sk_ASN1_STRING_TABLE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk)) |
257 | | #define sk_ASN1_STRING_TABLE_dup(sk) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk))) |
258 | | #define sk_ASN1_STRING_TABLE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_STRING_TABLE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_copyfunc_type(copyfunc), ossl_check_ASN1_STRING_TABLE_freefunc_type(freefunc))) |
259 | | #define sk_ASN1_STRING_TABLE_set_cmp_func(sk, cmp) ((sk_ASN1_STRING_TABLE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_STRING_TABLE_sk_type(sk), ossl_check_ASN1_STRING_TABLE_compfunc_type(cmp))) |
260 | | |
261 | | |
262 | | /* size limits: this stuff is taken straight from RFC 5280 */ |
263 | | |
264 | | # define ub_name 32768 |
265 | | # define ub_common_name 64 |
266 | | # define ub_locality_name 128 |
267 | | # define ub_state_name 128 |
268 | | # define ub_organization_name 64 |
269 | | # define ub_organization_unit_name 64 |
270 | | # define ub_title 64 |
271 | | # define ub_email_address 128 |
272 | | |
273 | | /* |
274 | | * Declarations for template structures: for full definitions see asn1t.h |
275 | | */ |
276 | | typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE; |
277 | | typedef struct ASN1_TLC_st ASN1_TLC; |
278 | | /* This is just an opaque pointer */ |
279 | | typedef struct ASN1_VALUE_st ASN1_VALUE; |
280 | | |
281 | | /* Declare ASN1 functions: the implement macro is in asn1t.h */ |
282 | | |
283 | | /* |
284 | | * The mysterious 'extern' that's passed to some macros is innocuous, |
285 | | * and is there to quiet pre-C99 compilers that may complain about empty |
286 | | * arguments in macro calls. |
287 | | */ |
288 | | |
289 | | # define DECLARE_ASN1_FUNCTIONS_attr(attr, type) \ |
290 | | DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, type) |
291 | | # define DECLARE_ASN1_FUNCTIONS(type) \ |
292 | | DECLARE_ASN1_FUNCTIONS_attr(extern, type) |
293 | | |
294 | | # define DECLARE_ASN1_ALLOC_FUNCTIONS_attr(attr, type) \ |
295 | | DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, type) |
296 | | # define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \ |
297 | | DECLARE_ASN1_ALLOC_FUNCTIONS_attr(extern, type) |
298 | | |
299 | | # define DECLARE_ASN1_FUNCTIONS_name_attr(attr, type, name) \ |
300 | | DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \ |
301 | | DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) |
302 | | # define DECLARE_ASN1_FUNCTIONS_name(type, name) \ |
303 | | DECLARE_ASN1_FUNCTIONS_name_attr(extern, type, name) |
304 | | |
305 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, itname, name) \ |
306 | | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \ |
307 | | DECLARE_ASN1_ITEM_attr(attr, itname) |
308 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \ |
309 | | DECLARE_ASN1_ENCODE_FUNCTIONS_attr(extern, type, itname, name) |
310 | | |
311 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(attr, type, name) \ |
312 | | DECLARE_ASN1_ENCODE_FUNCTIONS_attr(attr, type, name, name) |
313 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_name(type, name) \ |
314 | | DECLARE_ASN1_ENCODE_FUNCTIONS_name_attr(extern, type, name) |
315 | | |
316 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(attr, type, name) \ |
317 | | attr type *d2i_##name(type **a, const unsigned char **in, long len); \ |
318 | | attr int i2d_##name(const type *a, unsigned char **out); |
319 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_only(type, name) \ |
320 | | DECLARE_ASN1_ENCODE_FUNCTIONS_only_attr(extern, type, name) |
321 | | |
322 | | # define DECLARE_ASN1_NDEF_FUNCTION_attr(attr, name) \ |
323 | | attr int i2d_##name##_NDEF(const name *a, unsigned char **out); |
324 | | # define DECLARE_ASN1_NDEF_FUNCTION(name) \ |
325 | | DECLARE_ASN1_NDEF_FUNCTION_attr(extern, name) |
326 | | |
327 | | # define DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(attr, type, name) \ |
328 | | attr type *name##_new(void); \ |
329 | | attr void name##_free(type *a); |
330 | | # define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ |
331 | | DECLARE_ASN1_ALLOC_FUNCTIONS_name_attr(extern, type, name) |
332 | | |
333 | | # define DECLARE_ASN1_DUP_FUNCTION_attr(attr, type) \ |
334 | | DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, type) |
335 | | # define DECLARE_ASN1_DUP_FUNCTION(type) \ |
336 | | DECLARE_ASN1_DUP_FUNCTION_attr(extern, type) |
337 | | |
338 | | # define DECLARE_ASN1_DUP_FUNCTION_name_attr(attr, type, name) \ |
339 | | attr type *name##_dup(const type *a); |
340 | | # define DECLARE_ASN1_DUP_FUNCTION_name(type, name) \ |
341 | | DECLARE_ASN1_DUP_FUNCTION_name_attr(extern, type, name) |
342 | | |
343 | | # define DECLARE_ASN1_PRINT_FUNCTION_attr(attr, stname) \ |
344 | | DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, stname) |
345 | | # define DECLARE_ASN1_PRINT_FUNCTION(stname) \ |
346 | | DECLARE_ASN1_PRINT_FUNCTION_attr(extern, stname) |
347 | | |
348 | | # define DECLARE_ASN1_PRINT_FUNCTION_fname_attr(attr, stname, fname) \ |
349 | | attr int fname##_print_ctx(BIO *out, const stname *x, int indent, \ |
350 | | const ASN1_PCTX *pctx); |
351 | | # define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \ |
352 | | DECLARE_ASN1_PRINT_FUNCTION_fname_attr(extern, stname, fname) |
353 | | |
354 | | # define D2I_OF(type) type *(*)(type **,const unsigned char **,long) |
355 | | # define I2D_OF(type) int (*)(const type *,unsigned char **) |
356 | | |
357 | | # define CHECKED_D2I_OF(type, d2i) \ |
358 | 0 | ((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0))) |
359 | | # define CHECKED_I2D_OF(type, i2d) \ |
360 | 0 | ((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0))) |
361 | | # define CHECKED_NEW_OF(type, xnew) \ |
362 | 0 | ((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0))) |
363 | | # define CHECKED_PTR_OF(type, p) \ |
364 | 0 | ((void*) (1 ? p : (type*)0)) |
365 | | # define CHECKED_PPTR_OF(type, p) \ |
366 | 0 | ((void**) (1 ? p : (type**)0)) |
367 | | |
368 | | # define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long) |
369 | | # define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(const type *,unsigned char **) |
370 | | # define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type) |
371 | | |
372 | | typedef void *d2i_of_void(void **, const unsigned char **, long); |
373 | | typedef int i2d_of_void(const void *, unsigned char **); |
374 | | typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx); |
375 | | |
376 | | /*- |
377 | | * The following macros and typedefs allow an ASN1_ITEM |
378 | | * to be embedded in a structure and referenced. Since |
379 | | * the ASN1_ITEM pointers need to be globally accessible |
380 | | * (possibly from shared libraries) they may exist in |
381 | | * different forms. On platforms that support it the |
382 | | * ASN1_ITEM structure itself will be globally exported. |
383 | | * Other platforms will export a function that returns |
384 | | * an ASN1_ITEM pointer. |
385 | | * |
386 | | * To handle both cases transparently the macros below |
387 | | * should be used instead of hard coding an ASN1_ITEM |
388 | | * pointer in a structure. |
389 | | * |
390 | | * The structure will look like this: |
391 | | * |
392 | | * typedef struct SOMETHING_st { |
393 | | * ... |
394 | | * ASN1_ITEM_EXP *iptr; |
395 | | * ... |
396 | | * } SOMETHING; |
397 | | * |
398 | | * It would be initialised as e.g.: |
399 | | * |
400 | | * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...}; |
401 | | * |
402 | | * and the actual pointer extracted with: |
403 | | * |
404 | | * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr); |
405 | | * |
406 | | * Finally an ASN1_ITEM pointer can be extracted from an |
407 | | * appropriate reference with: ASN1_ITEM_rptr(X509). This |
408 | | * would be used when a function takes an ASN1_ITEM * argument. |
409 | | * |
410 | | */ |
411 | | |
412 | | |
413 | | /* |
414 | | * Platforms that can't easily handle shared global variables are declared as |
415 | | * functions returning ASN1_ITEM pointers. |
416 | | */ |
417 | | |
418 | | /* ASN1_ITEM pointer exported type */ |
419 | | typedef const ASN1_ITEM *ASN1_ITEM_EXP (void); |
420 | | |
421 | | /* Macro to obtain ASN1_ITEM pointer from exported type */ |
422 | 0 | # define ASN1_ITEM_ptr(iptr) (iptr()) |
423 | | |
424 | | /* Macro to include ASN1_ITEM pointer from base type */ |
425 | | # define ASN1_ITEM_ref(iptr) (iptr##_it) |
426 | | |
427 | 0 | # define ASN1_ITEM_rptr(ref) (ref##_it()) |
428 | | |
429 | | # define DECLARE_ASN1_ITEM_attr(attr, name) \ |
430 | | attr const ASN1_ITEM * name##_it(void); |
431 | | # define DECLARE_ASN1_ITEM(name) \ |
432 | | DECLARE_ASN1_ITEM_attr(extern, name) |
433 | | |
434 | | /* Parameters used by ASN1_STRING_print_ex() */ |
435 | | |
436 | | /* |
437 | | * These determine which characters to escape: RFC2253 special characters, |
438 | | * control characters and MSB set characters |
439 | | */ |
440 | | |
441 | 0 | # define ASN1_STRFLGS_ESC_2253 1 |
442 | 0 | # define ASN1_STRFLGS_ESC_CTRL 2 |
443 | 0 | # define ASN1_STRFLGS_ESC_MSB 4 |
444 | | |
445 | | /* Lower 8 bits are reserved as an output type specifier */ |
446 | 0 | # define ASN1_DTFLGS_TYPE_MASK 0x0FUL |
447 | 0 | # define ASN1_DTFLGS_RFC822 0x00UL |
448 | 0 | # define ASN1_DTFLGS_ISO8601 0x01UL |
449 | | |
450 | | /* |
451 | | * This flag determines how we do escaping: normally RC2253 backslash only, |
452 | | * set this to use backslash and quote. |
453 | | */ |
454 | | |
455 | 0 | # define ASN1_STRFLGS_ESC_QUOTE 8 |
456 | | |
457 | | /* These three flags are internal use only. */ |
458 | | |
459 | | /* Character is a valid PrintableString character */ |
460 | | # define CHARTYPE_PRINTABLESTRING 0x10 |
461 | | /* Character needs escaping if it is the first character */ |
462 | 0 | # define CHARTYPE_FIRST_ESC_2253 0x20 |
463 | | /* Character needs escaping if it is the last character */ |
464 | 0 | # define CHARTYPE_LAST_ESC_2253 0x40 |
465 | | |
466 | | /* |
467 | | * NB the internal flags are safely reused below by flags handled at the top |
468 | | * level. |
469 | | */ |
470 | | |
471 | | /* |
472 | | * If this is set we convert all character strings to UTF8 first |
473 | | */ |
474 | | |
475 | 0 | # define ASN1_STRFLGS_UTF8_CONVERT 0x10 |
476 | | |
477 | | /* |
478 | | * If this is set we don't attempt to interpret content: just assume all |
479 | | * strings are 1 byte per character. This will produce some pretty odd |
480 | | * looking output! |
481 | | */ |
482 | | |
483 | 0 | # define ASN1_STRFLGS_IGNORE_TYPE 0x20 |
484 | | |
485 | | /* If this is set we include the string type in the output */ |
486 | 0 | # define ASN1_STRFLGS_SHOW_TYPE 0x40 |
487 | | |
488 | | /* |
489 | | * This determines which strings to display and which to 'dump' (hex dump of |
490 | | * content octets or DER encoding). We can only dump non character strings or |
491 | | * everything. If we don't dump 'unknown' they are interpreted as character |
492 | | * strings with 1 octet per character and are subject to the usual escaping |
493 | | * options. |
494 | | */ |
495 | | |
496 | 0 | # define ASN1_STRFLGS_DUMP_ALL 0x80 |
497 | 0 | # define ASN1_STRFLGS_DUMP_UNKNOWN 0x100 |
498 | | |
499 | | /* |
500 | | * These determine what 'dumping' does, we can dump the content octets or the |
501 | | * DER encoding: both use the RFC2253 #XXXXX notation. |
502 | | */ |
503 | | |
504 | 0 | # define ASN1_STRFLGS_DUMP_DER 0x200 |
505 | | |
506 | | /* |
507 | | * This flag specifies that RC2254 escaping shall be performed. |
508 | | */ |
509 | 0 | #define ASN1_STRFLGS_ESC_2254 0x400 |
510 | | |
511 | | /* |
512 | | * All the string flags consistent with RFC2253, escaping control characters |
513 | | * isn't essential in RFC2253 but it is advisable anyway. |
514 | | */ |
515 | | |
516 | 0 | # define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \ |
517 | 0 | ASN1_STRFLGS_ESC_CTRL | \ |
518 | 0 | ASN1_STRFLGS_ESC_MSB | \ |
519 | 0 | ASN1_STRFLGS_UTF8_CONVERT | \ |
520 | 0 | ASN1_STRFLGS_DUMP_UNKNOWN | \ |
521 | 0 | ASN1_STRFLGS_DUMP_DER) |
522 | | |
523 | | |
524 | | struct asn1_type_st { |
525 | | int type; |
526 | | union { |
527 | | char *ptr; |
528 | | ASN1_BOOLEAN boolean; |
529 | | ASN1_STRING *asn1_string; |
530 | | ASN1_OBJECT *object; |
531 | | ASN1_INTEGER *integer; |
532 | | ASN1_ENUMERATED *enumerated; |
533 | | ASN1_BIT_STRING *bit_string; |
534 | | ASN1_OCTET_STRING *octet_string; |
535 | | ASN1_PRINTABLESTRING *printablestring; |
536 | | ASN1_T61STRING *t61string; |
537 | | ASN1_IA5STRING *ia5string; |
538 | | ASN1_GENERALSTRING *generalstring; |
539 | | ASN1_BMPSTRING *bmpstring; |
540 | | ASN1_UNIVERSALSTRING *universalstring; |
541 | | ASN1_UTCTIME *utctime; |
542 | | ASN1_GENERALIZEDTIME *generalizedtime; |
543 | | ASN1_VISIBLESTRING *visiblestring; |
544 | | ASN1_UTF8STRING *utf8string; |
545 | | /* |
546 | | * set and sequence are left complete and still contain the set or |
547 | | * sequence bytes |
548 | | */ |
549 | | ASN1_STRING *set; |
550 | | ASN1_STRING *sequence; |
551 | | ASN1_VALUE *asn1_value; |
552 | | } value; |
553 | | }; |
554 | | |
555 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_TYPE, ASN1_TYPE, ASN1_TYPE) |
556 | 0 | #define sk_ASN1_TYPE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_TYPE_sk_type(sk)) |
557 | 0 | #define sk_ASN1_TYPE_value(sk, idx) ((ASN1_TYPE *)OPENSSL_sk_value(ossl_check_const_ASN1_TYPE_sk_type(sk), (idx))) |
558 | | #define sk_ASN1_TYPE_new(cmp) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new(ossl_check_ASN1_TYPE_compfunc_type(cmp))) |
559 | 0 | #define sk_ASN1_TYPE_new_null() ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_null()) |
560 | | #define sk_ASN1_TYPE_new_reserve(cmp, n) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_TYPE_compfunc_type(cmp), (n))) |
561 | | #define sk_ASN1_TYPE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_TYPE_sk_type(sk), (n)) |
562 | | #define sk_ASN1_TYPE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_TYPE_sk_type(sk)) |
563 | | #define sk_ASN1_TYPE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_TYPE_sk_type(sk)) |
564 | | #define sk_ASN1_TYPE_delete(sk, i) ((ASN1_TYPE *)OPENSSL_sk_delete(ossl_check_ASN1_TYPE_sk_type(sk), (i))) |
565 | | #define sk_ASN1_TYPE_delete_ptr(sk, ptr) ((ASN1_TYPE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr))) |
566 | 0 | #define sk_ASN1_TYPE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) |
567 | | #define sk_ASN1_TYPE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) |
568 | | #define sk_ASN1_TYPE_pop(sk) ((ASN1_TYPE *)OPENSSL_sk_pop(ossl_check_ASN1_TYPE_sk_type(sk))) |
569 | | #define sk_ASN1_TYPE_shift(sk) ((ASN1_TYPE *)OPENSSL_sk_shift(ossl_check_ASN1_TYPE_sk_type(sk))) |
570 | 0 | #define sk_ASN1_TYPE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_freefunc_type(freefunc)) |
571 | | #define sk_ASN1_TYPE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), (idx)) |
572 | | #define sk_ASN1_TYPE_set(sk, idx, ptr) ((ASN1_TYPE *)OPENSSL_sk_set(ossl_check_ASN1_TYPE_sk_type(sk), (idx), ossl_check_ASN1_TYPE_type(ptr))) |
573 | | #define sk_ASN1_TYPE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) |
574 | | #define sk_ASN1_TYPE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr)) |
575 | | #define sk_ASN1_TYPE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_type(ptr), pnum) |
576 | | #define sk_ASN1_TYPE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_TYPE_sk_type(sk)) |
577 | | #define sk_ASN1_TYPE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_TYPE_sk_type(sk)) |
578 | | #define sk_ASN1_TYPE_dup(sk) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_TYPE_sk_type(sk))) |
579 | | #define sk_ASN1_TYPE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_TYPE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_copyfunc_type(copyfunc), ossl_check_ASN1_TYPE_freefunc_type(freefunc))) |
580 | | #define sk_ASN1_TYPE_set_cmp_func(sk, cmp) ((sk_ASN1_TYPE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_TYPE_sk_type(sk), ossl_check_ASN1_TYPE_compfunc_type(cmp))) |
581 | | |
582 | | |
583 | | typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY; |
584 | | |
585 | | DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY) |
586 | | DECLARE_ASN1_ENCODE_FUNCTIONS_name(ASN1_SEQUENCE_ANY, ASN1_SET_ANY) |
587 | | |
588 | | /* This is used to contain a list of bit names */ |
589 | | typedef struct BIT_STRING_BITNAME_st { |
590 | | int bitnum; |
591 | | const char *lname; |
592 | | const char *sname; |
593 | | } BIT_STRING_BITNAME; |
594 | | |
595 | | # define B_ASN1_TIME \ |
596 | | B_ASN1_UTCTIME | \ |
597 | | B_ASN1_GENERALIZEDTIME |
598 | | |
599 | | # define B_ASN1_PRINTABLE \ |
600 | | B_ASN1_NUMERICSTRING| \ |
601 | | B_ASN1_PRINTABLESTRING| \ |
602 | | B_ASN1_T61STRING| \ |
603 | | B_ASN1_IA5STRING| \ |
604 | | B_ASN1_BIT_STRING| \ |
605 | | B_ASN1_UNIVERSALSTRING|\ |
606 | | B_ASN1_BMPSTRING|\ |
607 | | B_ASN1_UTF8STRING|\ |
608 | | B_ASN1_SEQUENCE|\ |
609 | | B_ASN1_UNKNOWN |
610 | | |
611 | | # define B_ASN1_DIRECTORYSTRING \ |
612 | 0 | B_ASN1_PRINTABLESTRING| \ |
613 | 0 | B_ASN1_TELETEXSTRING|\ |
614 | 0 | B_ASN1_BMPSTRING|\ |
615 | 0 | B_ASN1_UNIVERSALSTRING|\ |
616 | 0 | B_ASN1_UTF8STRING |
617 | | |
618 | | # define B_ASN1_DISPLAYTEXT \ |
619 | | B_ASN1_IA5STRING| \ |
620 | | B_ASN1_VISIBLESTRING| \ |
621 | | B_ASN1_BMPSTRING|\ |
622 | | B_ASN1_UTF8STRING |
623 | | |
624 | | DECLARE_ASN1_ALLOC_FUNCTIONS_name(ASN1_TYPE, ASN1_TYPE) |
625 | | DECLARE_ASN1_ENCODE_FUNCTIONS(ASN1_TYPE, ASN1_ANY, ASN1_TYPE) |
626 | | |
627 | | int ASN1_TYPE_get(const ASN1_TYPE *a); |
628 | | void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value); |
629 | | int ASN1_TYPE_set1(ASN1_TYPE *a, int type, const void *value); |
630 | | int ASN1_TYPE_cmp(const ASN1_TYPE *a, const ASN1_TYPE *b); |
631 | | |
632 | | ASN1_TYPE *ASN1_TYPE_pack_sequence(const ASN1_ITEM *it, void *s, ASN1_TYPE **t); |
633 | | void *ASN1_TYPE_unpack_sequence(const ASN1_ITEM *it, const ASN1_TYPE *t); |
634 | | |
635 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_OBJECT, ASN1_OBJECT, ASN1_OBJECT) |
636 | 0 | #define sk_ASN1_OBJECT_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_OBJECT_sk_type(sk)) |
637 | 0 | #define sk_ASN1_OBJECT_value(sk, idx) ((ASN1_OBJECT *)OPENSSL_sk_value(ossl_check_const_ASN1_OBJECT_sk_type(sk), (idx))) |
638 | | #define sk_ASN1_OBJECT_new(cmp) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new(ossl_check_ASN1_OBJECT_compfunc_type(cmp))) |
639 | 0 | #define sk_ASN1_OBJECT_new_null() ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_null()) |
640 | 0 | #define sk_ASN1_OBJECT_new_reserve(cmp, n) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_OBJECT_compfunc_type(cmp), (n))) |
641 | | #define sk_ASN1_OBJECT_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_OBJECT_sk_type(sk), (n)) |
642 | 0 | #define sk_ASN1_OBJECT_free(sk) OPENSSL_sk_free(ossl_check_ASN1_OBJECT_sk_type(sk)) |
643 | | #define sk_ASN1_OBJECT_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_OBJECT_sk_type(sk)) |
644 | | #define sk_ASN1_OBJECT_delete(sk, i) ((ASN1_OBJECT *)OPENSSL_sk_delete(ossl_check_ASN1_OBJECT_sk_type(sk), (i))) |
645 | | #define sk_ASN1_OBJECT_delete_ptr(sk, ptr) ((ASN1_OBJECT *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr))) |
646 | 0 | #define sk_ASN1_OBJECT_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) |
647 | | #define sk_ASN1_OBJECT_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) |
648 | | #define sk_ASN1_OBJECT_pop(sk) ((ASN1_OBJECT *)OPENSSL_sk_pop(ossl_check_ASN1_OBJECT_sk_type(sk))) |
649 | | #define sk_ASN1_OBJECT_shift(sk) ((ASN1_OBJECT *)OPENSSL_sk_shift(ossl_check_ASN1_OBJECT_sk_type(sk))) |
650 | 0 | #define sk_ASN1_OBJECT_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_freefunc_type(freefunc)) |
651 | | #define sk_ASN1_OBJECT_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), (idx)) |
652 | | #define sk_ASN1_OBJECT_set(sk, idx, ptr) ((ASN1_OBJECT *)OPENSSL_sk_set(ossl_check_ASN1_OBJECT_sk_type(sk), (idx), ossl_check_ASN1_OBJECT_type(ptr))) |
653 | | #define sk_ASN1_OBJECT_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) |
654 | | #define sk_ASN1_OBJECT_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr)) |
655 | | #define sk_ASN1_OBJECT_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_type(ptr), pnum) |
656 | | #define sk_ASN1_OBJECT_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_OBJECT_sk_type(sk)) |
657 | | #define sk_ASN1_OBJECT_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_OBJECT_sk_type(sk)) |
658 | | #define sk_ASN1_OBJECT_dup(sk) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_dup(ossl_check_const_ASN1_OBJECT_sk_type(sk))) |
659 | | #define sk_ASN1_OBJECT_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_OBJECT) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_copyfunc_type(copyfunc), ossl_check_ASN1_OBJECT_freefunc_type(freefunc))) |
660 | | #define sk_ASN1_OBJECT_set_cmp_func(sk, cmp) ((sk_ASN1_OBJECT_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_OBJECT_sk_type(sk), ossl_check_ASN1_OBJECT_compfunc_type(cmp))) |
661 | | |
662 | | |
663 | | DECLARE_ASN1_FUNCTIONS(ASN1_OBJECT) |
664 | | |
665 | | ASN1_STRING *ASN1_STRING_new(void); |
666 | | void ASN1_STRING_free(ASN1_STRING *a); |
667 | | void ASN1_STRING_clear_free(ASN1_STRING *a); |
668 | | int ASN1_STRING_copy(ASN1_STRING *dst, const ASN1_STRING *str); |
669 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_STRING) |
670 | | ASN1_STRING *ASN1_STRING_type_new(int type); |
671 | | int ASN1_STRING_cmp(const ASN1_STRING *a, const ASN1_STRING *b); |
672 | | /* |
673 | | * Since this is used to store all sorts of things, via macros, for now, |
674 | | * make its data void * |
675 | | */ |
676 | | int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len); |
677 | | void ASN1_STRING_set0(ASN1_STRING *str, void *data, int len); |
678 | | int ASN1_STRING_length(const ASN1_STRING *x); |
679 | | # ifndef OPENSSL_NO_DEPRECATED_3_0 |
680 | | OSSL_DEPRECATEDIN_3_0 void ASN1_STRING_length_set(ASN1_STRING *x, int n); |
681 | | # endif |
682 | | int ASN1_STRING_type(const ASN1_STRING *x); |
683 | | # ifndef OPENSSL_NO_DEPRECATED_1_1_0 |
684 | | OSSL_DEPRECATEDIN_1_1_0 unsigned char *ASN1_STRING_data(ASN1_STRING *x); |
685 | | # endif |
686 | | const unsigned char *ASN1_STRING_get0_data(const ASN1_STRING *x); |
687 | | |
688 | | DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING) |
689 | | int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d, int length); |
690 | | int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value); |
691 | | int ASN1_BIT_STRING_get_bit(const ASN1_BIT_STRING *a, int n); |
692 | | int ASN1_BIT_STRING_check(const ASN1_BIT_STRING *a, |
693 | | const unsigned char *flags, int flags_len); |
694 | | |
695 | | int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs, |
696 | | BIT_STRING_BITNAME *tbl, int indent); |
697 | | int ASN1_BIT_STRING_num_asc(const char *name, BIT_STRING_BITNAME *tbl); |
698 | | int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, const char *name, int value, |
699 | | BIT_STRING_BITNAME *tbl); |
700 | | |
701 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_INTEGER, ASN1_INTEGER, ASN1_INTEGER) |
702 | 0 | #define sk_ASN1_INTEGER_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_INTEGER_sk_type(sk)) |
703 | 0 | #define sk_ASN1_INTEGER_value(sk, idx) ((ASN1_INTEGER *)OPENSSL_sk_value(ossl_check_const_ASN1_INTEGER_sk_type(sk), (idx))) |
704 | | #define sk_ASN1_INTEGER_new(cmp) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new(ossl_check_ASN1_INTEGER_compfunc_type(cmp))) |
705 | 0 | #define sk_ASN1_INTEGER_new_null() ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_null()) |
706 | | #define sk_ASN1_INTEGER_new_reserve(cmp, n) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_INTEGER_compfunc_type(cmp), (n))) |
707 | | #define sk_ASN1_INTEGER_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_INTEGER_sk_type(sk), (n)) |
708 | | #define sk_ASN1_INTEGER_free(sk) OPENSSL_sk_free(ossl_check_ASN1_INTEGER_sk_type(sk)) |
709 | | #define sk_ASN1_INTEGER_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_INTEGER_sk_type(sk)) |
710 | | #define sk_ASN1_INTEGER_delete(sk, i) ((ASN1_INTEGER *)OPENSSL_sk_delete(ossl_check_ASN1_INTEGER_sk_type(sk), (i))) |
711 | | #define sk_ASN1_INTEGER_delete_ptr(sk, ptr) ((ASN1_INTEGER *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr))) |
712 | 0 | #define sk_ASN1_INTEGER_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) |
713 | | #define sk_ASN1_INTEGER_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) |
714 | | #define sk_ASN1_INTEGER_pop(sk) ((ASN1_INTEGER *)OPENSSL_sk_pop(ossl_check_ASN1_INTEGER_sk_type(sk))) |
715 | | #define sk_ASN1_INTEGER_shift(sk) ((ASN1_INTEGER *)OPENSSL_sk_shift(ossl_check_ASN1_INTEGER_sk_type(sk))) |
716 | 0 | #define sk_ASN1_INTEGER_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_freefunc_type(freefunc)) |
717 | | #define sk_ASN1_INTEGER_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), (idx)) |
718 | | #define sk_ASN1_INTEGER_set(sk, idx, ptr) ((ASN1_INTEGER *)OPENSSL_sk_set(ossl_check_ASN1_INTEGER_sk_type(sk), (idx), ossl_check_ASN1_INTEGER_type(ptr))) |
719 | | #define sk_ASN1_INTEGER_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) |
720 | | #define sk_ASN1_INTEGER_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr)) |
721 | | #define sk_ASN1_INTEGER_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_type(ptr), pnum) |
722 | | #define sk_ASN1_INTEGER_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_INTEGER_sk_type(sk)) |
723 | | #define sk_ASN1_INTEGER_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_INTEGER_sk_type(sk)) |
724 | | #define sk_ASN1_INTEGER_dup(sk) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_dup(ossl_check_const_ASN1_INTEGER_sk_type(sk))) |
725 | | #define sk_ASN1_INTEGER_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_INTEGER) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_copyfunc_type(copyfunc), ossl_check_ASN1_INTEGER_freefunc_type(freefunc))) |
726 | | #define sk_ASN1_INTEGER_set_cmp_func(sk, cmp) ((sk_ASN1_INTEGER_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_INTEGER_sk_type(sk), ossl_check_ASN1_INTEGER_compfunc_type(cmp))) |
727 | | |
728 | | |
729 | | |
730 | | DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER) |
731 | | ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a, const unsigned char **pp, |
732 | | long length); |
733 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_INTEGER) |
734 | | int ASN1_INTEGER_cmp(const ASN1_INTEGER *x, const ASN1_INTEGER *y); |
735 | | |
736 | | DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED) |
737 | | |
738 | | int ASN1_UTCTIME_check(const ASN1_UTCTIME *a); |
739 | | ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s, time_t t); |
740 | | ASN1_UTCTIME *ASN1_UTCTIME_adj(ASN1_UTCTIME *s, time_t t, |
741 | | int offset_day, long offset_sec); |
742 | | int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str); |
743 | | int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t); |
744 | | |
745 | | int ASN1_GENERALIZEDTIME_check(const ASN1_GENERALIZEDTIME *a); |
746 | | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s, |
747 | | time_t t); |
748 | | ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_adj(ASN1_GENERALIZEDTIME *s, |
749 | | time_t t, int offset_day, |
750 | | long offset_sec); |
751 | | int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str); |
752 | | |
753 | | int ASN1_TIME_diff(int *pday, int *psec, |
754 | | const ASN1_TIME *from, const ASN1_TIME *to); |
755 | | |
756 | | DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING) |
757 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_OCTET_STRING) |
758 | | int ASN1_OCTET_STRING_cmp(const ASN1_OCTET_STRING *a, |
759 | | const ASN1_OCTET_STRING *b); |
760 | | int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, |
761 | | int len); |
762 | | |
763 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_UTF8STRING, ASN1_UTF8STRING, ASN1_UTF8STRING) |
764 | 0 | #define sk_ASN1_UTF8STRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)) |
765 | 0 | #define sk_ASN1_UTF8STRING_value(sk, idx) ((ASN1_UTF8STRING *)OPENSSL_sk_value(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), (idx))) |
766 | | #define sk_ASN1_UTF8STRING_new(cmp) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp))) |
767 | | #define sk_ASN1_UTF8STRING_new_null() ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_null()) |
768 | | #define sk_ASN1_UTF8STRING_new_reserve(cmp, n) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_UTF8STRING_compfunc_type(cmp), (n))) |
769 | | #define sk_ASN1_UTF8STRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_UTF8STRING_sk_type(sk), (n)) |
770 | | #define sk_ASN1_UTF8STRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_UTF8STRING_sk_type(sk)) |
771 | | #define sk_ASN1_UTF8STRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_UTF8STRING_sk_type(sk)) |
772 | | #define sk_ASN1_UTF8STRING_delete(sk, i) ((ASN1_UTF8STRING *)OPENSSL_sk_delete(ossl_check_ASN1_UTF8STRING_sk_type(sk), (i))) |
773 | | #define sk_ASN1_UTF8STRING_delete_ptr(sk, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr))) |
774 | 0 | #define sk_ASN1_UTF8STRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) |
775 | | #define sk_ASN1_UTF8STRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) |
776 | | #define sk_ASN1_UTF8STRING_pop(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_pop(ossl_check_ASN1_UTF8STRING_sk_type(sk))) |
777 | | #define sk_ASN1_UTF8STRING_shift(sk) ((ASN1_UTF8STRING *)OPENSSL_sk_shift(ossl_check_ASN1_UTF8STRING_sk_type(sk))) |
778 | | #define sk_ASN1_UTF8STRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc)) |
779 | | #define sk_ASN1_UTF8STRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), (idx)) |
780 | | #define sk_ASN1_UTF8STRING_set(sk, idx, ptr) ((ASN1_UTF8STRING *)OPENSSL_sk_set(ossl_check_ASN1_UTF8STRING_sk_type(sk), (idx), ossl_check_ASN1_UTF8STRING_type(ptr))) |
781 | | #define sk_ASN1_UTF8STRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) |
782 | | #define sk_ASN1_UTF8STRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr)) |
783 | | #define sk_ASN1_UTF8STRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_type(ptr), pnum) |
784 | | #define sk_ASN1_UTF8STRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_UTF8STRING_sk_type(sk)) |
785 | | #define sk_ASN1_UTF8STRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_UTF8STRING_sk_type(sk)) |
786 | | #define sk_ASN1_UTF8STRING_dup(sk) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_UTF8STRING_sk_type(sk))) |
787 | | #define sk_ASN1_UTF8STRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_UTF8STRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_copyfunc_type(copyfunc), ossl_check_ASN1_UTF8STRING_freefunc_type(freefunc))) |
788 | | #define sk_ASN1_UTF8STRING_set_cmp_func(sk, cmp) ((sk_ASN1_UTF8STRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_UTF8STRING_sk_type(sk), ossl_check_ASN1_UTF8STRING_compfunc_type(cmp))) |
789 | | |
790 | | |
791 | | DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING) |
792 | | DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING) |
793 | | DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING) |
794 | | DECLARE_ASN1_FUNCTIONS(ASN1_NULL) |
795 | | DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING) |
796 | | |
797 | | int UTF8_getc(const unsigned char *str, int len, unsigned long *val); |
798 | | int UTF8_putc(unsigned char *str, int len, unsigned long value); |
799 | | |
800 | | SKM_DEFINE_STACK_OF_INTERNAL(ASN1_GENERALSTRING, ASN1_GENERALSTRING, ASN1_GENERALSTRING) |
801 | | #define sk_ASN1_GENERALSTRING_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)) |
802 | | #define sk_ASN1_GENERALSTRING_value(sk, idx) ((ASN1_GENERALSTRING *)OPENSSL_sk_value(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), (idx))) |
803 | | #define sk_ASN1_GENERALSTRING_new(cmp) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp))) |
804 | | #define sk_ASN1_GENERALSTRING_new_null() ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_null()) |
805 | | #define sk_ASN1_GENERALSTRING_new_reserve(cmp, n) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp), (n))) |
806 | | #define sk_ASN1_GENERALSTRING_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (n)) |
807 | | #define sk_ASN1_GENERALSTRING_free(sk) OPENSSL_sk_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) |
808 | | #define sk_ASN1_GENERALSTRING_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) |
809 | | #define sk_ASN1_GENERALSTRING_delete(sk, i) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (i))) |
810 | | #define sk_ASN1_GENERALSTRING_delete_ptr(sk, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr))) |
811 | | #define sk_ASN1_GENERALSTRING_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) |
812 | | #define sk_ASN1_GENERALSTRING_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) |
813 | | #define sk_ASN1_GENERALSTRING_pop(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_pop(ossl_check_ASN1_GENERALSTRING_sk_type(sk))) |
814 | | #define sk_ASN1_GENERALSTRING_shift(sk) ((ASN1_GENERALSTRING *)OPENSSL_sk_shift(ossl_check_ASN1_GENERALSTRING_sk_type(sk))) |
815 | | #define sk_ASN1_GENERALSTRING_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc)) |
816 | | #define sk_ASN1_GENERALSTRING_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), (idx)) |
817 | | #define sk_ASN1_GENERALSTRING_set(sk, idx, ptr) ((ASN1_GENERALSTRING *)OPENSSL_sk_set(ossl_check_ASN1_GENERALSTRING_sk_type(sk), (idx), ossl_check_ASN1_GENERALSTRING_type(ptr))) |
818 | | #define sk_ASN1_GENERALSTRING_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) |
819 | | #define sk_ASN1_GENERALSTRING_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr)) |
820 | | #define sk_ASN1_GENERALSTRING_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_type(ptr), pnum) |
821 | | #define sk_ASN1_GENERALSTRING_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_GENERALSTRING_sk_type(sk)) |
822 | | #define sk_ASN1_GENERALSTRING_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk)) |
823 | | #define sk_ASN1_GENERALSTRING_dup(sk) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_dup(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk))) |
824 | | #define sk_ASN1_GENERALSTRING_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_GENERALSTRING) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_copyfunc_type(copyfunc), ossl_check_ASN1_GENERALSTRING_freefunc_type(freefunc))) |
825 | | #define sk_ASN1_GENERALSTRING_set_cmp_func(sk, cmp) ((sk_ASN1_GENERALSTRING_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_GENERALSTRING_sk_type(sk), ossl_check_ASN1_GENERALSTRING_compfunc_type(cmp))) |
826 | | |
827 | | |
828 | | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE) |
829 | | |
830 | | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING) |
831 | | DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT) |
832 | | DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING) |
833 | | DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING) |
834 | | DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING) |
835 | | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING) |
836 | | DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME) |
837 | | DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME) |
838 | | DECLARE_ASN1_FUNCTIONS(ASN1_TIME) |
839 | | |
840 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_TIME) |
841 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_UTCTIME) |
842 | | DECLARE_ASN1_DUP_FUNCTION(ASN1_GENERALIZEDTIME) |
843 | | |
844 | | DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF) |
845 | | |
846 | | ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s, time_t t); |
847 | | ASN1_TIME *ASN1_TIME_adj(ASN1_TIME *s, time_t t, |
848 | | int offset_day, long offset_sec); |
849 | | int ASN1_TIME_check(const ASN1_TIME *t); |
850 | | ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(const ASN1_TIME *t, |
851 | | ASN1_GENERALIZEDTIME **out); |
852 | | int ASN1_TIME_set_string(ASN1_TIME *s, const char *str); |
853 | | int ASN1_TIME_set_string_X509(ASN1_TIME *s, const char *str); |
854 | | int ASN1_TIME_to_tm(const ASN1_TIME *s, struct tm *tm); |
855 | | int ASN1_TIME_normalize(ASN1_TIME *s); |
856 | | int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t); |
857 | | int ASN1_TIME_compare(const ASN1_TIME *a, const ASN1_TIME *b); |
858 | | |
859 | | int i2a_ASN1_INTEGER(BIO *bp, const ASN1_INTEGER *a); |
860 | | int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size); |
861 | | int i2a_ASN1_ENUMERATED(BIO *bp, const ASN1_ENUMERATED *a); |
862 | | int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size); |
863 | | int i2a_ASN1_OBJECT(BIO *bp, const ASN1_OBJECT *a); |
864 | | int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size); |
865 | | int i2a_ASN1_STRING(BIO *bp, const ASN1_STRING *a, int type); |
866 | | int i2t_ASN1_OBJECT(char *buf, int buf_len, const ASN1_OBJECT *a); |
867 | | |
868 | | int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num); |
869 | | ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data, int len, |
870 | | const char *sn, const char *ln); |
871 | | |
872 | | int ASN1_INTEGER_get_int64(int64_t *pr, const ASN1_INTEGER *a); |
873 | | int ASN1_INTEGER_set_int64(ASN1_INTEGER *a, int64_t r); |
874 | | int ASN1_INTEGER_get_uint64(uint64_t *pr, const ASN1_INTEGER *a); |
875 | | int ASN1_INTEGER_set_uint64(ASN1_INTEGER *a, uint64_t r); |
876 | | |
877 | | int ASN1_INTEGER_set(ASN1_INTEGER *a, long v); |
878 | | long ASN1_INTEGER_get(const ASN1_INTEGER *a); |
879 | | ASN1_INTEGER *BN_to_ASN1_INTEGER(const BIGNUM *bn, ASN1_INTEGER *ai); |
880 | | BIGNUM *ASN1_INTEGER_to_BN(const ASN1_INTEGER *ai, BIGNUM *bn); |
881 | | |
882 | | int ASN1_ENUMERATED_get_int64(int64_t *pr, const ASN1_ENUMERATED *a); |
883 | | int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *a, int64_t r); |
884 | | |
885 | | |
886 | | int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v); |
887 | | long ASN1_ENUMERATED_get(const ASN1_ENUMERATED *a); |
888 | | ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(const BIGNUM *bn, ASN1_ENUMERATED *ai); |
889 | | BIGNUM *ASN1_ENUMERATED_to_BN(const ASN1_ENUMERATED *ai, BIGNUM *bn); |
890 | | |
891 | | /* General */ |
892 | | /* given a string, return the correct type, max is the maximum length */ |
893 | | int ASN1_PRINTABLE_type(const unsigned char *s, int max); |
894 | | |
895 | | unsigned long ASN1_tag2bit(int tag); |
896 | | |
897 | | /* SPECIALS */ |
898 | | int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag, |
899 | | int *pclass, long omax); |
900 | | int ASN1_check_infinite_end(unsigned char **p, long len); |
901 | | int ASN1_const_check_infinite_end(const unsigned char **p, long len); |
902 | | void ASN1_put_object(unsigned char **pp, int constructed, int length, |
903 | | int tag, int xclass); |
904 | | int ASN1_put_eoc(unsigned char **pp); |
905 | | int ASN1_object_size(int constructed, int length, int tag); |
906 | | |
907 | | /* Used to implement other functions */ |
908 | | void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, const void *x); |
909 | | |
910 | | # define ASN1_dup_of(type,i2d,d2i,x) \ |
911 | | ((type*)ASN1_dup(CHECKED_I2D_OF(type, i2d), \ |
912 | | CHECKED_D2I_OF(type, d2i), \ |
913 | | CHECKED_PTR_OF(const type, x))) |
914 | | |
915 | | void *ASN1_item_dup(const ASN1_ITEM *it, const void *x); |
916 | | int ASN1_item_sign_ex(const ASN1_ITEM *it, X509_ALGOR *algor1, |
917 | | X509_ALGOR *algor2, ASN1_BIT_STRING *signature, |
918 | | const void *data, const ASN1_OCTET_STRING *id, |
919 | | EVP_PKEY *pkey, const EVP_MD *md, OSSL_LIB_CTX *libctx, |
920 | | const char *propq); |
921 | | int ASN1_item_verify_ex(const ASN1_ITEM *it, const X509_ALGOR *alg, |
922 | | const ASN1_BIT_STRING *signature, const void *data, |
923 | | const ASN1_OCTET_STRING *id, EVP_PKEY *pkey, |
924 | | OSSL_LIB_CTX *libctx, const char *propq); |
925 | | |
926 | | /* ASN1 alloc/free macros for when a type is only used internally */ |
927 | | |
928 | | # define M_ASN1_new_of(type) (type *)ASN1_item_new(ASN1_ITEM_rptr(type)) |
929 | | # define M_ASN1_free_of(x, type) \ |
930 | 0 | ASN1_item_free(CHECKED_PTR_OF(type, x), ASN1_ITEM_rptr(type)) |
931 | | |
932 | | # ifndef OPENSSL_NO_STDIO |
933 | | void *ASN1_d2i_fp(void *(*xnew) (void), d2i_of_void *d2i, FILE *in, void **x); |
934 | | |
935 | | # define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \ |
936 | 0 | ((type*)ASN1_d2i_fp(CHECKED_NEW_OF(type, xnew), \ |
937 | 0 | CHECKED_D2I_OF(type, d2i), \ |
938 | 0 | in, \ |
939 | 0 | CHECKED_PPTR_OF(type, x))) |
940 | | |
941 | | void *ASN1_item_d2i_fp_ex(const ASN1_ITEM *it, FILE *in, void *x, |
942 | | OSSL_LIB_CTX *libctx, const char *propq); |
943 | | void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x); |
944 | | int ASN1_i2d_fp(i2d_of_void *i2d, FILE *out, const void *x); |
945 | | |
946 | | # define ASN1_i2d_fp_of(type,i2d,out,x) \ |
947 | 0 | (ASN1_i2d_fp(CHECKED_I2D_OF(type, i2d), \ |
948 | 0 | out, \ |
949 | 0 | CHECKED_PTR_OF(const type, x))) |
950 | | |
951 | | int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, const void *x); |
952 | | int ASN1_STRING_print_ex_fp(FILE *fp, const ASN1_STRING *str, unsigned long flags); |
953 | | # endif |
954 | | |
955 | | int ASN1_STRING_to_UTF8(unsigned char **out, const ASN1_STRING *in); |
956 | | |
957 | | void *ASN1_d2i_bio(void *(*xnew) (void), d2i_of_void *d2i, BIO *in, void **x); |
958 | | |
959 | | # define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \ |
960 | 0 | ((type*)ASN1_d2i_bio( CHECKED_NEW_OF(type, xnew), \ |
961 | 0 | CHECKED_D2I_OF(type, d2i), \ |
962 | 0 | in, \ |
963 | 0 | CHECKED_PPTR_OF(type, x))) |
964 | | |
965 | | void *ASN1_item_d2i_bio_ex(const ASN1_ITEM *it, BIO *in, void *pval, |
966 | | OSSL_LIB_CTX *libctx, const char *propq); |
967 | | void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *pval); |
968 | | int ASN1_i2d_bio(i2d_of_void *i2d, BIO *out, const void *x); |
969 | | |
970 | | # define ASN1_i2d_bio_of(type,i2d,out,x) \ |
971 | 0 | (ASN1_i2d_bio(CHECKED_I2D_OF(type, i2d), \ |
972 | 0 | out, \ |
973 | 0 | CHECKED_PTR_OF(const type, x))) |
974 | | |
975 | | int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, const void *x); |
976 | | BIO *ASN1_item_i2d_mem_bio(const ASN1_ITEM *it, const ASN1_VALUE *val); |
977 | | int ASN1_UTCTIME_print(BIO *fp, const ASN1_UTCTIME *a); |
978 | | int ASN1_GENERALIZEDTIME_print(BIO *fp, const ASN1_GENERALIZEDTIME *a); |
979 | | int ASN1_TIME_print(BIO *bp, const ASN1_TIME *tm); |
980 | | int ASN1_TIME_print_ex(BIO *bp, const ASN1_TIME *tm, unsigned long flags); |
981 | | int ASN1_STRING_print(BIO *bp, const ASN1_STRING *v); |
982 | | int ASN1_STRING_print_ex(BIO *out, const ASN1_STRING *str, unsigned long flags); |
983 | | int ASN1_buf_print(BIO *bp, const unsigned char *buf, size_t buflen, int off); |
984 | | int ASN1_bn_print(BIO *bp, const char *number, const BIGNUM *num, |
985 | | unsigned char *buf, int off); |
986 | | int ASN1_parse(BIO *bp, const unsigned char *pp, long len, int indent); |
987 | | int ASN1_parse_dump(BIO *bp, const unsigned char *pp, long len, int indent, |
988 | | int dump); |
989 | | const char *ASN1_tag2str(int tag); |
990 | | |
991 | | /* Used to load and write Netscape format cert */ |
992 | | |
993 | | int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s); |
994 | | |
995 | | int ASN1_TYPE_set_octetstring(ASN1_TYPE *a, unsigned char *data, int len); |
996 | | int ASN1_TYPE_get_octetstring(const ASN1_TYPE *a, unsigned char *data, int max_len); |
997 | | int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num, |
998 | | unsigned char *data, int len); |
999 | | int ASN1_TYPE_get_int_octetstring(const ASN1_TYPE *a, long *num, |
1000 | | unsigned char *data, int max_len); |
1001 | | |
1002 | | void *ASN1_item_unpack(const ASN1_STRING *oct, const ASN1_ITEM *it); |
1003 | | void *ASN1_item_unpack_ex(const ASN1_STRING *oct, const ASN1_ITEM *it, |
1004 | | OSSL_LIB_CTX *libctx, const char *propq); |
1005 | | |
1006 | | ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, |
1007 | | ASN1_OCTET_STRING **oct); |
1008 | | |
1009 | | void ASN1_STRING_set_default_mask(unsigned long mask); |
1010 | | int ASN1_STRING_set_default_mask_asc(const char *p); |
1011 | | unsigned long ASN1_STRING_get_default_mask(void); |
1012 | | int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len, |
1013 | | int inform, unsigned long mask); |
1014 | | int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len, |
1015 | | int inform, unsigned long mask, |
1016 | | long minsize, long maxsize); |
1017 | | |
1018 | | ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out, |
1019 | | const unsigned char *in, int inlen, |
1020 | | int inform, int nid); |
1021 | | ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid); |
1022 | | int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long); |
1023 | | void ASN1_STRING_TABLE_cleanup(void); |
1024 | | |
1025 | | /* ASN1 template functions */ |
1026 | | |
1027 | | /* Old API compatible functions */ |
1028 | | ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it); |
1029 | | ASN1_VALUE *ASN1_item_new_ex(const ASN1_ITEM *it, OSSL_LIB_CTX *libctx, |
1030 | | const char *propq); |
1031 | | void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it); |
1032 | | ASN1_VALUE *ASN1_item_d2i_ex(ASN1_VALUE **val, const unsigned char **in, |
1033 | | long len, const ASN1_ITEM *it, |
1034 | | OSSL_LIB_CTX *libctx, const char *propq); |
1035 | | ASN1_VALUE *ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, |
1036 | | long len, const ASN1_ITEM *it); |
1037 | | int ASN1_item_i2d(const ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it); |
1038 | | int ASN1_item_ndef_i2d(const ASN1_VALUE *val, unsigned char **out, |
1039 | | const ASN1_ITEM *it); |
1040 | | |
1041 | | void ASN1_add_oid_module(void); |
1042 | | void ASN1_add_stable_module(void); |
1043 | | |
1044 | | ASN1_TYPE *ASN1_generate_nconf(const char *str, CONF *nconf); |
1045 | | ASN1_TYPE *ASN1_generate_v3(const char *str, X509V3_CTX *cnf); |
1046 | | int ASN1_str2mask(const char *str, unsigned long *pmask); |
1047 | | |
1048 | | /* ASN1 Print flags */ |
1049 | | |
1050 | | /* Indicate missing OPTIONAL fields */ |
1051 | 0 | # define ASN1_PCTX_FLAGS_SHOW_ABSENT 0x001 |
1052 | | /* Mark start and end of SEQUENCE */ |
1053 | 0 | # define ASN1_PCTX_FLAGS_SHOW_SEQUENCE 0x002 |
1054 | | /* Mark start and end of SEQUENCE/SET OF */ |
1055 | 0 | # define ASN1_PCTX_FLAGS_SHOW_SSOF 0x004 |
1056 | | /* Show the ASN1 type of primitives */ |
1057 | 0 | # define ASN1_PCTX_FLAGS_SHOW_TYPE 0x008 |
1058 | | /* Don't show ASN1 type of ANY */ |
1059 | 0 | # define ASN1_PCTX_FLAGS_NO_ANY_TYPE 0x010 |
1060 | | /* Don't show ASN1 type of MSTRINGs */ |
1061 | | # define ASN1_PCTX_FLAGS_NO_MSTRING_TYPE 0x020 |
1062 | | /* Don't show field names in SEQUENCE */ |
1063 | 0 | # define ASN1_PCTX_FLAGS_NO_FIELD_NAME 0x040 |
1064 | | /* Show structure names of each SEQUENCE field */ |
1065 | 0 | # define ASN1_PCTX_FLAGS_SHOW_FIELD_STRUCT_NAME 0x080 |
1066 | | /* Don't show structure name even at top level */ |
1067 | 0 | # define ASN1_PCTX_FLAGS_NO_STRUCT_NAME 0x100 |
1068 | | |
1069 | | int ASN1_item_print(BIO *out, const ASN1_VALUE *ifld, int indent, |
1070 | | const ASN1_ITEM *it, const ASN1_PCTX *pctx); |
1071 | | ASN1_PCTX *ASN1_PCTX_new(void); |
1072 | | void ASN1_PCTX_free(ASN1_PCTX *p); |
1073 | | unsigned long ASN1_PCTX_get_flags(const ASN1_PCTX *p); |
1074 | | void ASN1_PCTX_set_flags(ASN1_PCTX *p, unsigned long flags); |
1075 | | unsigned long ASN1_PCTX_get_nm_flags(const ASN1_PCTX *p); |
1076 | | void ASN1_PCTX_set_nm_flags(ASN1_PCTX *p, unsigned long flags); |
1077 | | unsigned long ASN1_PCTX_get_cert_flags(const ASN1_PCTX *p); |
1078 | | void ASN1_PCTX_set_cert_flags(ASN1_PCTX *p, unsigned long flags); |
1079 | | unsigned long ASN1_PCTX_get_oid_flags(const ASN1_PCTX *p); |
1080 | | void ASN1_PCTX_set_oid_flags(ASN1_PCTX *p, unsigned long flags); |
1081 | | unsigned long ASN1_PCTX_get_str_flags(const ASN1_PCTX *p); |
1082 | | void ASN1_PCTX_set_str_flags(ASN1_PCTX *p, unsigned long flags); |
1083 | | |
1084 | | ASN1_SCTX *ASN1_SCTX_new(int (*scan_cb) (ASN1_SCTX *ctx)); |
1085 | | void ASN1_SCTX_free(ASN1_SCTX *p); |
1086 | | const ASN1_ITEM *ASN1_SCTX_get_item(ASN1_SCTX *p); |
1087 | | const ASN1_TEMPLATE *ASN1_SCTX_get_template(ASN1_SCTX *p); |
1088 | | unsigned long ASN1_SCTX_get_flags(ASN1_SCTX *p); |
1089 | | void ASN1_SCTX_set_app_data(ASN1_SCTX *p, void *data); |
1090 | | void *ASN1_SCTX_get_app_data(ASN1_SCTX *p); |
1091 | | |
1092 | | const BIO_METHOD *BIO_f_asn1(void); |
1093 | | |
1094 | | /* cannot constify val because of CMS_stream() */ |
1095 | | BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it); |
1096 | | |
1097 | | int i2d_ASN1_bio_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1098 | | const ASN1_ITEM *it); |
1099 | | int PEM_write_bio_ASN1_stream(BIO *out, ASN1_VALUE *val, BIO *in, int flags, |
1100 | | const char *hdr, const ASN1_ITEM *it); |
1101 | | /* cannot constify val because of CMS_dataFinal() */ |
1102 | | int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, |
1103 | | int ctype_nid, int econt_nid, |
1104 | | STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it); |
1105 | | int SMIME_write_ASN1_ex(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, |
1106 | | int ctype_nid, int econt_nid, |
1107 | | STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it, |
1108 | | OSSL_LIB_CTX *libctx, const char *propq); |
1109 | | ASN1_VALUE *SMIME_read_ASN1(BIO *bio, BIO **bcont, const ASN1_ITEM *it); |
1110 | | ASN1_VALUE *SMIME_read_ASN1_ex(BIO *bio, int flags, BIO **bcont, |
1111 | | const ASN1_ITEM *it, ASN1_VALUE **x, |
1112 | | OSSL_LIB_CTX *libctx, const char *propq); |
1113 | | int SMIME_crlf_copy(BIO *in, BIO *out, int flags); |
1114 | | int SMIME_text(BIO *in, BIO *out); |
1115 | | |
1116 | | const ASN1_ITEM *ASN1_ITEM_lookup(const char *name); |
1117 | | const ASN1_ITEM *ASN1_ITEM_get(size_t i); |
1118 | | |
1119 | | /* Legacy compatibility */ |
1120 | | # define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \ |
1121 | | DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \ |
1122 | | DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) |
1123 | | # define DECLARE_ASN1_FUNCTIONS_const(type) DECLARE_ASN1_FUNCTIONS(type) |
1124 | | # define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \ |
1125 | | DECLARE_ASN1_ENCODE_FUNCTIONS(type, name) |
1126 | | # define I2D_OF_const(type) I2D_OF(type) |
1127 | | # define ASN1_dup_of_const(type,i2d,d2i,x) ASN1_dup_of(type,i2d,d2i,x) |
1128 | | # define ASN1_i2d_fp_of_const(type,i2d,out,x) ASN1_i2d_fp_of(type,i2d,out,x) |
1129 | | # define ASN1_i2d_bio_of_const(type,i2d,out,x) ASN1_i2d_bio_of(type,i2d,out,x) |
1130 | | |
1131 | | # ifdef __cplusplus |
1132 | | } |
1133 | | # endif |
1134 | | #endif |