]> git.saurik.com Git - apple/security.git/blame - libsecurity_apple_csp/open_ssl/openssl/asn1.h
Security-55471.14.18.tar.gz
[apple/security.git] / libsecurity_apple_csp / open_ssl / openssl / asn1.h
CommitLineData
b1ab9ed8
A
1/*
2 * Copyright (c) 2000-2001 Apple Computer, Inc. All Rights Reserved.
3 *
4 * The contents of this file constitute Original Code as defined in and are
5 * subject to the Apple Public Source License Version 1.2 (the 'License').
6 * You may not use this file except in compliance with the License. Please obtain
7 * a copy of the License at http://www.apple.com/publicsource and read it before
8 * using this file.
9 *
10 * This Original Code and all software distributed under the License are
11 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
12 * OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, INCLUDING WITHOUT
13 * LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
14 * PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. Please see the License for the
15 * specific language governing rights and limitations under the License.
16 */
17
18
19/* crypto/asn1/asn1.h */
20/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
21 * All rights reserved.
22 *
23 * This package is an SSL implementation written
24 * by Eric Young (eay@cryptsoft.com).
25 * The implementation was written so as to conform with Netscapes SSL.
26 *
27 * This library is free for commercial and non-commercial use as long as
28 * the following conditions are aheared to. The following conditions
29 * apply to all code found in this distribution, be it the RC4, RSA,
30 * lhash, DES, etc., code; not just the SSL code. The SSL documentation
31 * included with this distribution is covered by the same copyright terms
32 * except that the holder is Tim Hudson (tjh@cryptsoft.com).
33 *
34 * Copyright remains Eric Young's, and as such any Copyright notices in
35 * the code are not to be removed.
36 * If this package is used in a product, Eric Young should be given attribution
37 * as the author of the parts of the library used.
38 * This can be in the form of a textual message at program startup or
39 * in documentation (online or textual) provided with the package.
40 *
41 * Redistribution and use in source and binary forms, with or without
42 * modification, are permitted provided that the following conditions
43 * are met:
44 * 1. Redistributions of source code must retain the copyright
45 * notice, this list of conditions and the following disclaimer.
46 * 2. Redistributions in binary form must reproduce the above copyright
47 * notice, this list of conditions and the following disclaimer in the
48 * documentation and/or other materials provided with the distribution.
49 * 3. All advertising materials mentioning features or use of this software
50 * must display the following acknowledgement:
51 * "This product includes cryptographic software written by
52 * Eric Young (eay@cryptsoft.com)"
53 * The word 'cryptographic' can be left out if the rouines from the library
54 * being used are not cryptographic related :-).
55 * 4. If you include any Windows specific code (or a derivative thereof) from
56 * the apps directory (application code) you must include an acknowledgement:
57 * "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
58 *
59 * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
60 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
61 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
62 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
63 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
64 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
65 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
66 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
67 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
68 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
69 * SUCH DAMAGE.
70 *
71 * The licence and distribution terms for any publically available version or
72 * derivative of this code cannot be changed. i.e. this code cannot simply be
73 * copied and put under another distribution licence
74 * [including the GNU Public Licence.]
75 */
76
77#ifndef HEADER_ASN1_H
78#define HEADER_ASN1_H
79
80#ifdef __cplusplus
81extern "C" {
82#endif
83
84#include <time.h>
85#include <openssl/bn.h>
86#include <openssl/stack.h>
87#include <openssl/safestack.h>
88
89#ifdef VMS
90#include <openssl/vms_idhacks.h>
91#endif
92
93#define V_ASN1_UNIVERSAL 0x00
94#define V_ASN1_APPLICATION 0x40
95#define V_ASN1_CONTEXT_SPECIFIC 0x80
96#define V_ASN1_PRIVATE 0xc0
97
98#define V_ASN1_CONSTRUCTED 0x20
99#define V_ASN1_PRIMITIVE_TAG 0x1f
100#define V_ASN1_PRIMATIVE_TAG 0x1f
101
102#define V_ASN1_APP_CHOOSE -2 /* let the recipient choose */
103
104#define V_ASN1_UNDEF -1
105#define V_ASN1_EOC 0
106#define V_ASN1_BOOLEAN 1 /**/
107#define V_ASN1_INTEGER 2
108#define V_ASN1_NEG_INTEGER (2+0x100)
109#define V_ASN1_BIT_STRING 3
110#define V_ASN1_OCTET_STRING 4
111#define V_ASN1_NULL 5
112#define V_ASN1_OBJECT 6
113#define V_ASN1_OBJECT_DESCRIPTOR 7
114#define V_ASN1_EXTERNAL 8
115#define V_ASN1_REAL 9
116#define V_ASN1_ENUMERATED 10
117#define V_ASN1_NEG_ENUMERATED (10+0x100)
118#define V_ASN1_UTF8STRING 12
119#define V_ASN1_SEQUENCE 16
120#define V_ASN1_SET 17
121#define V_ASN1_NUMERICSTRING 18 /**/
122#define V_ASN1_PRINTABLESTRING 19
123#define V_ASN1_T61STRING 20
124#define V_ASN1_TELETEXSTRING 20 /* alias */
125#define V_ASN1_VIDEOTEXSTRING 21 /**/
126#define V_ASN1_IA5STRING 22
127#define V_ASN1_UTCTIME 23
128#define V_ASN1_GENERALIZEDTIME 24 /**/
129#define V_ASN1_GRAPHICSTRING 25 /**/
130#define V_ASN1_ISO64STRING 26 /**/
131#define V_ASN1_VISIBLESTRING 26 /* alias */
132#define V_ASN1_GENERALSTRING 27 /**/
133#define V_ASN1_UNIVERSALSTRING 28 /**/
134#define V_ASN1_BMPSTRING 30
135
136/* For use with d2i_ASN1_type_bytes() */
137#define B_ASN1_NUMERICSTRING 0x0001
138#define B_ASN1_PRINTABLESTRING 0x0002
139#define B_ASN1_T61STRING 0x0004
140#define B_ASN1_TELETEXSTRING 0x0008
141#define B_ASN1_VIDEOTEXSTRING 0x0008
142#define B_ASN1_IA5STRING 0x0010
143#define B_ASN1_GRAPHICSTRING 0x0020
144#define B_ASN1_ISO64STRING 0x0040
145#define B_ASN1_VISIBLESTRING 0x0040
146#define B_ASN1_GENERALSTRING 0x0080
147#define B_ASN1_UNIVERSALSTRING 0x0100
148#define B_ASN1_OCTET_STRING 0x0200
149#define B_ASN1_BIT_STRING 0x0400
150#define B_ASN1_BMPSTRING 0x0800
151#define B_ASN1_UNKNOWN 0x1000
152#define B_ASN1_UTF8STRING 0x2000
153
154/* For use with ASN1_mbstring_copy() */
155#define MBSTRING_FLAG 0x1000
156#define MBSTRING_ASC (MBSTRING_FLAG|1)
157#define MBSTRING_BMP (MBSTRING_FLAG|2)
158#define MBSTRING_UNIV (MBSTRING_FLAG|3)
159#define MBSTRING_UTF8 (MBSTRING_FLAG|4)
160
161#define DECLARE_ASN1_SET_OF(type) \
162int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
163 int (*func)(type *,unsigned char **), int ex_tag, \
164 int ex_class, int is_set); \
165STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
166 long length, \
167 type *(*func)(type **, \
168 unsigned char **,long), \
169 void (*free_func)(type *), \
170 int ex_tag,int ex_class);
171
172#define IMPLEMENT_ASN1_SET_OF(type) \
173int i2d_ASN1_SET_OF_##type(STACK_OF(type) *a,unsigned char **pp, \
174 int (*func)(type *,unsigned char **), int ex_tag, \
175 int ex_class, int is_set) \
176 { return i2d_ASN1_SET((STACK *)a,pp,func,ex_tag,ex_class,is_set); } \
177STACK_OF(type) *d2i_ASN1_SET_OF_##type(STACK_OF(type) **a,unsigned char **pp, \
178 long length, \
179 type *(*func)(type **, \
180 unsigned char **,long), \
181 void (*free_func)(type *), \
182 int ex_tag,int ex_class) \
183 { return (STACK_OF(type) *)d2i_ASN1_SET((STACK **)a,pp,length, \
184 (char *(*)())func, \
185 (void (*)())free_func, \
186 ex_tag,ex_class); }
187
188typedef struct asn1_ctx_st
189 {
190 unsigned char *p;/* work char pointer */
191 int eos; /* end of sequence read for indefinite encoding */
192 int error; /* error code to use when returning an error */
193 int inf; /* constructed if 0x20, indefinite is 0x21 */
194 int tag; /* tag from last 'get object' */
195 int xclass; /* class from last 'get object' */
196 long slen; /* length of last 'get object' */
197 unsigned char *max; /* largest value of p allowed */
198 unsigned char *q;/* temporary variable */
199 unsigned char **pp;/* variable */
200 int line; /* used in error processing */
201 } ASN1_CTX;
202
203/* These are used internally in the ASN1_OBJECT to keep track of
204 * whether the names and data need to be free()ed */
205#define ASN1_OBJECT_FLAG_DYNAMIC 0x01 /* internal use */
206#define ASN1_OBJECT_FLAG_CRITICAL 0x02 /* critical x509v3 object id */
207#define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04 /* internal use */
208#define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08 /* internal use */
209typedef struct asn1_object_st
210 {
211 const char *sn,*ln;
212 int nid;
213 int length;
214 unsigned char *data;
215 int flags; /* Should we free this one */
216 } ASN1_OBJECT;
217
218#define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
219/* This is the base type that holds just about everything :-) */
220typedef struct asn1_string_st
221 {
222 int length;
223 int type;
224 unsigned char *data;
225 /* The value of the following field depends on the type being
226 * held. It is mostly being used for BIT_STRING so if the
227 * input data has a non-zero 'unused bits' value, it will be
228 * handled correctly */
229 long flags;
230 } ASN1_STRING;
231
232#define STABLE_FLAGS_MALLOC 0x01
233#define STABLE_NO_MASK 0x02
234#define DIRSTRING_TYPE \
235 (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
236#define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
237
238typedef struct asn1_string_table_st {
239 int nid;
240 long minsize;
241 long maxsize;
242 unsigned long mask;
243 unsigned long flags;
244} ASN1_STRING_TABLE;
245
246DECLARE_STACK_OF(ASN1_STRING_TABLE)
247
248/* size limits: this stuff is taken straight from RFC2459 */
249
250#define ub_name 32768
251#define ub_common_name 64
252#define ub_locality_name 128
253#define ub_state_name 128
254#define ub_organization_name 64
255#define ub_organization_unit_name 64
256#define ub_title 64
257#define ub_email_address 128
258
259#ifdef NO_ASN1_TYPEDEFS
260#define ASN1_INTEGER ASN1_STRING
261#define ASN1_ENUMERATED ASN1_STRING
262#define ASN1_BIT_STRING ASN1_STRING
263#define ASN1_OCTET_STRING ASN1_STRING
264#define ASN1_PRINTABLESTRING ASN1_STRING
265#define ASN1_T61STRING ASN1_STRING
266#define ASN1_IA5STRING ASN1_STRING
267#define ASN1_UTCTIME ASN1_STRING
268#define ASN1_GENERALIZEDTIME ASN1_STRING
269#define ASN1_TIME ASN1_STRING
270#define ASN1_GENERALSTRING ASN1_STRING
271#define ASN1_UNIVERSALSTRING ASN1_STRING
272#define ASN1_BMPSTRING ASN1_STRING
273#define ASN1_VISIBLESTRING ASN1_STRING
274#define ASN1_UTF8STRING ASN1_STRING
275#else
276typedef struct asn1_string_st ASN1_INTEGER;
277typedef struct asn1_string_st ASN1_ENUMERATED;
278typedef struct asn1_string_st ASN1_BIT_STRING;
279typedef struct asn1_string_st ASN1_OCTET_STRING;
280typedef struct asn1_string_st ASN1_PRINTABLESTRING;
281typedef struct asn1_string_st ASN1_T61STRING;
282typedef struct asn1_string_st ASN1_IA5STRING;
283typedef struct asn1_string_st ASN1_GENERALSTRING;
284typedef struct asn1_string_st ASN1_UNIVERSALSTRING;
285typedef struct asn1_string_st ASN1_BMPSTRING;
286typedef struct asn1_string_st ASN1_UTCTIME;
287typedef struct asn1_string_st ASN1_TIME;
288typedef struct asn1_string_st ASN1_GENERALIZEDTIME;
289typedef struct asn1_string_st ASN1_VISIBLESTRING;
290typedef struct asn1_string_st ASN1_UTF8STRING;
291#endif
292
293typedef int ASN1_NULL;
294
295typedef struct asn1_type_st
296 {
297 int type;
298 union {
299 char *ptr;
300 ASN1_STRING * asn1_string;
301 ASN1_OBJECT * object;
302 ASN1_INTEGER * integer;
303 ASN1_ENUMERATED * enumerated;
304 ASN1_BIT_STRING * bit_string;
305 ASN1_OCTET_STRING * octet_string;
306 ASN1_PRINTABLESTRING * printablestring;
307 ASN1_T61STRING * t61string;
308 ASN1_IA5STRING * ia5string;
309 ASN1_GENERALSTRING * generalstring;
310 ASN1_BMPSTRING * bmpstring;
311 ASN1_UNIVERSALSTRING * universalstring;
312 ASN1_UTCTIME * utctime;
313 ASN1_GENERALIZEDTIME * generalizedtime;
314 ASN1_VISIBLESTRING * visiblestring;
315 ASN1_UTF8STRING * utf8string;
316 /* set and sequence are left complete and still
317 * contain the set or sequence bytes */
318 ASN1_STRING * set;
319 ASN1_STRING * sequence;
320 } value;
321 } ASN1_TYPE;
322
323DECLARE_STACK_OF(ASN1_TYPE)
324DECLARE_ASN1_SET_OF(ASN1_TYPE)
325
326typedef struct asn1_method_st
327 {
328 int (*i2d)();
329 char *(*d2i)();
330 char *(*create)();
331 void (*destroy)();
332 } ASN1_METHOD;
333
334/* This is used when parsing some Netscape objects */
335typedef struct asn1_header_st
336 {
337 ASN1_OCTET_STRING *header;
338 char *data;
339 ASN1_METHOD *meth;
340 } ASN1_HEADER;
341
342/* This is used to contain a list of bit names */
343typedef struct BIT_STRING_BITNAME_st {
344 int bitnum;
345 const char *lname;
346 const char *sname;
347} BIT_STRING_BITNAME;
348
349
350#define M_ASN1_STRING_length(x) ((x)->length)
351#define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
352#define M_ASN1_STRING_type(x) ((x)->type)
353#define M_ASN1_STRING_data(x) ((x)->data)
354
355/* Macros for string operations */
356#define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
357 ASN1_STRING_type_new(V_ASN1_BIT_STRING)
358#define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
359#define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
360 ASN1_STRING_dup((ASN1_STRING *)a)
361#define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
362 (ASN1_STRING *)a,(ASN1_STRING *)b)
363#define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
364
365#define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
366 ASN1_STRING_type_new(V_ASN1_INTEGER)
367#define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
368#define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
369#define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
370 (ASN1_STRING *)a,(ASN1_STRING *)b)
371
372#define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
373 ASN1_STRING_type_new(V_ASN1_ENUMERATED)
374#define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
375#define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
376#define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
377 (ASN1_STRING *)a,(ASN1_STRING *)b)
378
379#define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
380 ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
381#define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
382#define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
383 ASN1_STRING_dup((ASN1_STRING *)a)
384#define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
385 (ASN1_STRING *)a,(ASN1_STRING *)b)
386#define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
387#define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
388#define M_i2d_ASN1_OCTET_STRING(a,pp) \
389 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
390 V_ASN1_UNIVERSAL)
391
392#define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
393#define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
394#define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
395 pp,a->type,V_ASN1_UNIVERSAL)
396#define M_d2i_ASN1_PRINTABLE(a,pp,l) \
397 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
398 B_ASN1_PRINTABLESTRING| \
399 B_ASN1_T61STRING| \
400 B_ASN1_IA5STRING| \
401 B_ASN1_BIT_STRING| \
402 B_ASN1_UNIVERSALSTRING|\
403 B_ASN1_BMPSTRING|\
404 B_ASN1_UTF8STRING|\
405 B_ASN1_UNKNOWN)
406
407#define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
408#define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
409#define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
410 pp,a->type,V_ASN1_UNIVERSAL)
411#define M_d2i_DIRECTORYSTRING(a,pp,l) \
412 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
413 B_ASN1_PRINTABLESTRING| \
414 B_ASN1_TELETEXSTRING|\
415 B_ASN1_BMPSTRING|\
416 B_ASN1_UNIVERSALSTRING|\
417 B_ASN1_UTF8STRING)
418
419#define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
420#define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
421#define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
422 pp,a->type,V_ASN1_UNIVERSAL)
423#define M_d2i_DISPLAYTEXT(a,pp,l) \
424 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
425 B_ASN1_VISIBLESTRING| \
426 B_ASN1_BMPSTRING|\
427 B_ASN1_UTF8STRING)
428
429#define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
430 ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
431#define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
432#define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
433 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
434 V_ASN1_UNIVERSAL)
435#define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
436 (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
437 ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
438
439#define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
440 ASN1_STRING_type_new(V_ASN1_T61STRING)
441#define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
442#define M_i2d_ASN1_T61STRING(a,pp) \
443 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
444 V_ASN1_UNIVERSAL)
445#define M_d2i_ASN1_T61STRING(a,pp,l) \
446 (ASN1_T61STRING *)d2i_ASN1_type_bytes\
447 ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
448
449#define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
450 ASN1_STRING_type_new(V_ASN1_IA5STRING)
451#define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
452#define M_ASN1_IA5STRING_dup(a) \
453 (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
454#define M_i2d_ASN1_IA5STRING(a,pp) \
455 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
456 V_ASN1_UNIVERSAL)
457#define M_d2i_ASN1_IA5STRING(a,pp,l) \
458 (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
459 B_ASN1_IA5STRING)
460
461#define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
462 ASN1_STRING_type_new(V_ASN1_UTCTIME)
463#define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
464#define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
465
466#define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
467 ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
468#define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
469#define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
470 (ASN1_STRING *)a)
471
472#define M_ASN1_TIME_new() (ASN1_TIME *)\
473 ASN1_STRING_type_new(V_ASN1_UTCTIME)
474#define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
475#define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
476
477#define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
478 ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
479#define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
480#define M_i2d_ASN1_GENERALSTRING(a,pp) \
481 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
482 V_ASN1_UNIVERSAL)
483#define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
484 (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
485 ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
486
487#define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
488 ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
489#define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
490#define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
491 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
492 V_ASN1_UNIVERSAL)
493#define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
494 (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
495 ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
496
497#define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
498 ASN1_STRING_type_new(V_ASN1_BMPSTRING)
499#define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
500#define M_i2d_ASN1_BMPSTRING(a,pp) \
501 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
502 V_ASN1_UNIVERSAL)
503#define M_d2i_ASN1_BMPSTRING(a,pp,l) \
504 (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
505 ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
506
507#define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
508 ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
509#define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
510#define M_i2d_ASN1_VISIBLESTRING(a,pp) \
511 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
512 V_ASN1_UNIVERSAL)
513#define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
514 (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
515 ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
516
517#define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
518 ASN1_STRING_type_new(V_ASN1_UTF8STRING)
519#define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
520#define M_i2d_ASN1_UTF8STRING(a,pp) \
521 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
522 V_ASN1_UNIVERSAL)
523#define M_d2i_ASN1_UTF8STRING(a,pp,l) \
524 (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
525 ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
526
527 /* for the is_set parameter to i2d_ASN1_SET */
528#define IS_SEQUENCE 0
529#define IS_SET 1
530
531ASN1_TYPE * ASN1_TYPE_new(void );
532void ASN1_TYPE_free(ASN1_TYPE *a);
533int i2d_ASN1_TYPE(ASN1_TYPE *a,unsigned char **pp);
534ASN1_TYPE * d2i_ASN1_TYPE(ASN1_TYPE **a,unsigned char **pp,long length);
535int ASN1_TYPE_get(ASN1_TYPE *a);
536void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
537
538ASN1_OBJECT * ASN1_OBJECT_new(void );
539void ASN1_OBJECT_free(ASN1_OBJECT *a);
540int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
541ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,unsigned char **pp,
542 long length);
543
544DECLARE_STACK_OF(ASN1_OBJECT)
545DECLARE_ASN1_SET_OF(ASN1_OBJECT)
546
547ASN1_STRING * ASN1_STRING_new(void);
548void ASN1_STRING_free(ASN1_STRING *a);
549ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a);
550ASN1_STRING * ASN1_STRING_type_new(int type );
551int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
552 /* Since this is used to store all sorts of things, via macros, for now, make
553 its data void * */
554int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
555int ASN1_STRING_length(ASN1_STRING *x);
556void ASN1_STRING_length_set(ASN1_STRING *x, int n);
557int ASN1_STRING_type(ASN1_STRING *x);
558unsigned char * ASN1_STRING_data(ASN1_STRING *x);
559
560ASN1_BIT_STRING * ASN1_BIT_STRING_new(void);
561void ASN1_BIT_STRING_free(ASN1_BIT_STRING *a);
562int i2d_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
563ASN1_BIT_STRING *d2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,unsigned char **pp,
564 long length);
565int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
566 int length );
567int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
568int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
569
570#ifdef HEADER_BIO_H
571int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
572 BIT_STRING_BITNAME *tbl, int indent);
573#endif
574int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
575int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
576 BIT_STRING_BITNAME *tbl);
577
578int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
579int d2i_ASN1_BOOLEAN(int *a,unsigned char **pp,long length);
580
581ASN1_INTEGER * ASN1_INTEGER_new(void);
582void ASN1_INTEGER_free(ASN1_INTEGER *a);
583int i2d_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
584ASN1_INTEGER *d2i_ASN1_INTEGER(ASN1_INTEGER **a,unsigned char **pp,
585 long length);
586ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,unsigned char **pp,
587 long length);
588ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
589int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y);
590
591ASN1_ENUMERATED * ASN1_ENUMERATED_new(void);
592void ASN1_ENUMERATED_free(ASN1_ENUMERATED *a);
593int i2d_ASN1_ENUMERATED(ASN1_ENUMERATED *a,unsigned char **pp);
594ASN1_ENUMERATED *d2i_ASN1_ENUMERATED(ASN1_ENUMERATED **a,unsigned char **pp,
595 long length);
596
597int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
598ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
599int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, char *str);
600
601int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
602ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
603int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, char *str);
604
605ASN1_OCTET_STRING * ASN1_OCTET_STRING_new(void);
606void ASN1_OCTET_STRING_free(ASN1_OCTET_STRING *a);
607int i2d_ASN1_OCTET_STRING(ASN1_OCTET_STRING *a,unsigned char **pp);
608ASN1_OCTET_STRING *d2i_ASN1_OCTET_STRING(ASN1_OCTET_STRING **a,
609 unsigned char **pp,long length);
610ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
611int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
612int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, unsigned char *data, int len);
613
614ASN1_VISIBLESTRING * ASN1_VISIBLESTRING_new(void);
615void ASN1_VISIBLESTRING_free(ASN1_VISIBLESTRING *a);
616int i2d_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING *a,unsigned char **pp);
617ASN1_VISIBLESTRING *d2i_ASN1_VISIBLESTRING(ASN1_VISIBLESTRING **a,
618 unsigned char **pp,long length);
619
620ASN1_UTF8STRING * ASN1_UTF8STRING_new(void);
621void ASN1_UTF8STRING_free(ASN1_UTF8STRING *a);
622int i2d_ASN1_UTF8STRING(ASN1_UTF8STRING *a,unsigned char **pp);
623ASN1_UTF8STRING *d2i_ASN1_UTF8STRING(ASN1_UTF8STRING **a,
624 unsigned char **pp,long length);
625
626ASN1_NULL * ASN1_NULL_new(void);
627void ASN1_NULL_free(ASN1_NULL *a);
628int i2d_ASN1_NULL(ASN1_NULL *a,unsigned char **pp);
629ASN1_NULL *d2i_ASN1_NULL(ASN1_NULL **a, unsigned char **pp,long length);
630
631ASN1_BMPSTRING * ASN1_BMPSTRING_new(void);
632void ASN1_BMPSTRING_free(ASN1_BMPSTRING *a);
633int i2d_ASN1_BMPSTRING(ASN1_BMPSTRING *a, unsigned char **pp);
634ASN1_BMPSTRING *d2i_ASN1_BMPSTRING(ASN1_BMPSTRING **a, unsigned char **pp,
635 long length);
636
637
638int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
639int UTF8_putc(unsigned char *str, int len, unsigned long value);
640
641int i2d_ASN1_PRINTABLE(ASN1_STRING *a,unsigned char **pp);
642ASN1_STRING *d2i_ASN1_PRINTABLE(ASN1_STRING **a,
643 unsigned char **pp, long l);
644
645ASN1_PRINTABLESTRING * ASN1_PRINTABLESTRING_new(void);
646void ASN1_PRINTABLESTRING_free(ASN1_PRINTABLESTRING *a);
647ASN1_PRINTABLESTRING *d2i_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING **a,
648 unsigned char **pp, long l);
649int i2d_ASN1_PRINTABLESTRING(ASN1_PRINTABLESTRING *a, unsigned char **pp);
650
651ASN1_STRING * DIRECTORYSTRING_new(void);
652void DIRECTORYSTRING_free(ASN1_STRING *a);
653int i2d_DIRECTORYSTRING(ASN1_STRING *a,unsigned char **pp);
654ASN1_STRING *d2i_DIRECTORYSTRING(ASN1_STRING **a, unsigned char **pp,
655 long length);
656
657ASN1_STRING * DISPLAYTEXT_new(void);
658void DISPLAYTEXT_free(ASN1_STRING *a);
659int i2d_DISPLAYTEXT(ASN1_STRING *a,unsigned char **pp);
660ASN1_STRING *d2i_DISPLAYTEXT(ASN1_STRING **a, unsigned char **pp, long length);
661
662ASN1_T61STRING * ASN1_T61STRING_new(void);
663void ASN1_T61STRING_free(ASN1_IA5STRING *a);
664ASN1_T61STRING *d2i_ASN1_T61STRING(ASN1_T61STRING **a,
665 unsigned char **pp, long l);
666
667ASN1_IA5STRING * ASN1_IA5STRING_new(void);
668void ASN1_IA5STRING_free(ASN1_IA5STRING *a);
669int i2d_ASN1_IA5STRING(ASN1_IA5STRING *a,unsigned char **pp);
670ASN1_IA5STRING *d2i_ASN1_IA5STRING(ASN1_IA5STRING **a,
671 unsigned char **pp, long l);
672
673ASN1_UTCTIME * ASN1_UTCTIME_new(void);
674void ASN1_UTCTIME_free(ASN1_UTCTIME *a);
675int i2d_ASN1_UTCTIME(ASN1_UTCTIME *a,unsigned char **pp);
676ASN1_UTCTIME * d2i_ASN1_UTCTIME(ASN1_UTCTIME **a,unsigned char **pp,
677 long length);
678
679ASN1_GENERALIZEDTIME * ASN1_GENERALIZEDTIME_new(void);
680void ASN1_GENERALIZEDTIME_free(ASN1_GENERALIZEDTIME *a);
681int i2d_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME *a,unsigned char **pp);
682ASN1_GENERALIZEDTIME * d2i_ASN1_GENERALIZEDTIME(ASN1_GENERALIZEDTIME **a,unsigned char **pp,
683 long length);
684
685ASN1_TIME * ASN1_TIME_new(void);
686void ASN1_TIME_free(ASN1_TIME *a);
687int i2d_ASN1_TIME(ASN1_TIME *a,unsigned char **pp);
688ASN1_TIME * d2i_ASN1_TIME(ASN1_TIME **a,unsigned char **pp, long length);
689ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
690
691int i2d_ASN1_SET(STACK *a, unsigned char **pp,
692 int (*func)(), int ex_tag, int ex_class, int is_set);
693STACK * d2i_ASN1_SET(STACK **a, unsigned char **pp, long length,
694 char *(*func)(), void (*free_func)(),
695 int ex_tag, int ex_class);
696
697#ifdef HEADER_BIO_H
698int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
699int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);
700int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
701int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size);
702int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a);
703int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size);
704int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
705#endif
706int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
707
708int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
709ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
710 char *sn, char *ln);
711
712int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
713long ASN1_INTEGER_get(ASN1_INTEGER *a);
714ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai);
715BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai,BIGNUM *bn);
716
717int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
718long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);
719ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
720BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn);
721
722/* General */
723/* given a string, return the correct type, max is the maximum length */
724int ASN1_PRINTABLE_type(unsigned char *s, int max);
725
726int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
727ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, unsigned char **pp,
728 long length, int Ptag, int Pclass);
729/* type is one or more of the B_ASN1_ values. */
730ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,unsigned char **pp,
731 long length,int type);
732
733/* PARSING */
734int asn1_Finish(ASN1_CTX *c);
735
736/* SPECIALS */
737int ASN1_get_object(unsigned char **pp, long *plength, int *ptag,
738 int *pclass, long omax);
739int ASN1_check_infinite_end(unsigned char **p,long len);
740void ASN1_put_object(unsigned char **pp, int constructed, int length,
741 int tag, int xclass);
742int ASN1_object_size(int constructed, int length, int tag);
743
744/* Used to implement other functions */
745char *ASN1_dup(int (*i2d)(),char *(*d2i)(),char *x);
746
747#ifndef NO_FP_API
748char *ASN1_d2i_fp(char *(*xnew)(),char *(*d2i)(),FILE *fp,unsigned char **x);
749int ASN1_i2d_fp(int (*i2d)(),FILE *out,unsigned char *x);
750#endif
751
752#ifdef HEADER_BIO_H
753char *ASN1_d2i_bio(char *(*xnew)(),char *(*d2i)(),BIO *bp,unsigned char **x);
754int ASN1_i2d_bio(int (*i2d)(),BIO *out,unsigned char *x);
755int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
756int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
757int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
758int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
759int ASN1_parse(BIO *bp,unsigned char *pp,long len,int indent);
760#endif
761const char *ASN1_tag2str(int tag);
762
763/* Used to load and write netscape format cert/key */
764int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp);
765ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,unsigned char **pp, long length);
766ASN1_HEADER *ASN1_HEADER_new(void );
767void ASN1_HEADER_free(ASN1_HEADER *a);
768
769int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
770
771void ERR_load_ASN1_strings(void);
772
773/* Not used that much at this point, except for the first two */
774ASN1_METHOD *X509_asn1_meth(void);
775ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
776ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void);
777ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void);
778
779int ASN1_TYPE_set_octetstring(ASN1_TYPE *a,
780 unsigned char *data, int len);
781int ASN1_TYPE_get_octetstring(ASN1_TYPE *a,
782 unsigned char *data, int max_len);
783int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
784 unsigned char *data, int len);
785int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
786 unsigned char *data, int max_len);
787
788STACK *ASN1_seq_unpack(unsigned char *buf, int len, char *(*d2i)(),
789 void (*free_func)() );
790unsigned char *ASN1_seq_pack(STACK *safes, int (*i2d)(), unsigned char **buf,
791 int *len );
792void *ASN1_unpack_string(ASN1_STRING *oct, char *(*d2i)());
793ASN1_STRING *ASN1_pack_string(void *obj, int (*i2d)(), ASN1_OCTET_STRING **oct);
794
795void ASN1_STRING_set_default_mask(unsigned long mask);
796int ASN1_STRING_set_default_mask_asc(char *p);
797unsigned long ASN1_STRING_get_default_mask(void);
798int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
799 int inform, unsigned long mask);
800int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
801 int inform, unsigned long mask,
802 long minsize, long maxsize);
803
804ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
805 const unsigned char *in, int inlen, int inform, int nid);
806ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
807int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
808void ASN1_STRING_TABLE_cleanup(void);
809
810/* BEGIN ERROR CODES */
811/* The following lines are auto generated by the script mkerr.pl. Any changes
812 * made after this point may be overwritten when the script is next run.
813 */
814
815/* Error codes for the ASN1 functions. */
816
817/* Function codes. */
818#define ASN1_F_A2D_ASN1_OBJECT 100
819#define ASN1_F_A2I_ASN1_ENUMERATED 236
820#define ASN1_F_A2I_ASN1_INTEGER 101
821#define ASN1_F_A2I_ASN1_STRING 102
822#define ASN1_F_ACCESS_DESCRIPTION_NEW 291
823#define ASN1_F_ASN1_COLLATE_PRIMITIVE 103
824#define ASN1_F_ASN1_D2I_BIO 104
825#define ASN1_F_ASN1_D2I_FP 105
826#define ASN1_F_ASN1_DUP 106
827#define ASN1_F_ASN1_ENUMERATED_SET 232
828#define ASN1_F_ASN1_ENUMERATED_TO_BN 233
829#define ASN1_F_ASN1_GENERALIZEDTIME_NEW 222
830#define ASN1_F_ASN1_GET_OBJECT 107
831#define ASN1_F_ASN1_HEADER_NEW 108
832#define ASN1_F_ASN1_I2D_BIO 109
833#define ASN1_F_ASN1_I2D_FP 110
834#define ASN1_F_ASN1_INTEGER_SET 111
835#define ASN1_F_ASN1_INTEGER_TO_BN 112
836#define ASN1_F_ASN1_MBSTRING_COPY 282
837#define ASN1_F_ASN1_OBJECT_NEW 113
838#define ASN1_F_ASN1_PACK_STRING 245
839#define ASN1_F_ASN1_PBE_SET 253
840#define ASN1_F_ASN1_SEQ_PACK 246
841#define ASN1_F_ASN1_SEQ_UNPACK 247
842#define ASN1_F_ASN1_SIGN 114
843#define ASN1_F_ASN1_STRING_NEW 115
844#define ASN1_F_ASN1_STRING_TABLE_ADD 283
845#define ASN1_F_ASN1_STRING_TYPE_NEW 116
846#define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 117
847#define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 118
848#define ASN1_F_ASN1_TYPE_NEW 119
849#define ASN1_F_ASN1_UNPACK_STRING 248
850#define ASN1_F_ASN1_UTCTIME_NEW 120
851#define ASN1_F_ASN1_VERIFY 121
852#define ASN1_F_AUTHORITY_KEYID_NEW 237
853#define ASN1_F_BASIC_CONSTRAINTS_NEW 226
854#define ASN1_F_BN_TO_ASN1_ENUMERATED 234
855#define ASN1_F_BN_TO_ASN1_INTEGER 122
856#define ASN1_F_D2I_ACCESS_DESCRIPTION 284
857#define ASN1_F_D2I_ASN1_BIT_STRING 123
858#define ASN1_F_D2I_ASN1_BMPSTRING 124
859#define ASN1_F_D2I_ASN1_BOOLEAN 125
860#define ASN1_F_D2I_ASN1_BYTES 126
861#define ASN1_F_D2I_ASN1_ENUMERATED 235
862#define ASN1_F_D2I_ASN1_GENERALIZEDTIME 223
863#define ASN1_F_D2I_ASN1_HEADER 127
864#define ASN1_F_D2I_ASN1_INTEGER 128
865#define ASN1_F_D2I_ASN1_NULL 292
866#define ASN1_F_D2I_ASN1_OBJECT 129
867#define ASN1_F_D2I_ASN1_OCTET_STRING 130
868#define ASN1_F_D2I_ASN1_PRINT_TYPE 131
869#define ASN1_F_D2I_ASN1_SET 132
870#define ASN1_F_D2I_ASN1_TIME 224
871#define ASN1_F_D2I_ASN1_TYPE 133
872#define ASN1_F_D2I_ASN1_TYPE_BYTES 134
873#define ASN1_F_D2I_ASN1_UINTEGER 280
874#define ASN1_F_D2I_ASN1_UTCTIME 135
875#define ASN1_F_D2I_ASN1_UTF8STRING 266
876#define ASN1_F_D2I_ASN1_VISIBLESTRING 267
877#define ASN1_F_D2I_AUTHORITY_KEYID 238
878#define ASN1_F_D2I_BASIC_CONSTRAINTS 227
879#define ASN1_F_D2I_DHPARAMS 136
880#define ASN1_F_D2I_DIST_POINT 276
881#define ASN1_F_D2I_DIST_POINT_NAME 277
882#define ASN1_F_D2I_DSAPARAMS 137
883#define ASN1_F_D2I_DSAPRIVATEKEY 138
884#define ASN1_F_D2I_DSAPUBLICKEY 139
885#define ASN1_F_D2I_GENERAL_NAME 230
886#define ASN1_F_D2I_NETSCAPE_CERT_SEQUENCE 228
887#define ASN1_F_D2I_NETSCAPE_PKEY 140
888#define ASN1_F_D2I_NETSCAPE_RSA 141
889#define ASN1_F_D2I_NETSCAPE_RSA_2 142
890#define ASN1_F_D2I_NETSCAPE_SPKAC 143
891#define ASN1_F_D2I_NETSCAPE_SPKI 144
892#define ASN1_F_D2I_NOTICEREF 268
893#define ASN1_F_D2I_OTHERNAME 287
894#define ASN1_F_D2I_PBE2PARAM 262
895#define ASN1_F_D2I_PBEPARAM 249
896#define ASN1_F_D2I_PBKDF2PARAM 263
897#define ASN1_F_D2I_PKCS12 254
898#define ASN1_F_D2I_PKCS12_BAGS 255
899#define ASN1_F_D2I_PKCS12_MAC_DATA 256
900#define ASN1_F_D2I_PKCS12_SAFEBAG 257
901#define ASN1_F_D2I_PKCS7 145
902#define ASN1_F_D2I_PKCS7_DIGEST 146
903#define ASN1_F_D2I_PKCS7_ENCRYPT 147
904#define ASN1_F_D2I_PKCS7_ENC_CONTENT 148
905#define ASN1_F_D2I_PKCS7_ENVELOPE 149
906#define ASN1_F_D2I_PKCS7_ISSUER_AND_SERIAL 150
907#define ASN1_F_D2I_PKCS7_RECIP_INFO 151
908#define ASN1_F_D2I_PKCS7_SIGNED 152
909#define ASN1_F_D2I_PKCS7_SIGNER_INFO 153
910#define ASN1_F_D2I_PKCS7_SIGN_ENVELOPE 154
911#define ASN1_F_D2I_PKCS8_PRIV_KEY_INFO 250
912#define ASN1_F_D2I_PKEY_USAGE_PERIOD 239
913#define ASN1_F_D2I_POLICYINFO 269
914#define ASN1_F_D2I_POLICYQUALINFO 270
915#define ASN1_F_D2I_PRIVATEKEY 155
916#define ASN1_F_D2I_PUBLICKEY 156
917#define ASN1_F_D2I_RSAPRIVATEKEY 157
918#define ASN1_F_D2I_RSAPUBLICKEY 158
919#define ASN1_F_D2I_SXNET 241
920#define ASN1_F_D2I_SXNETID 243
921#define ASN1_F_D2I_USERNOTICE 271
922#define ASN1_F_D2I_X509 159
923#define ASN1_F_D2I_X509_ALGOR 160
924#define ASN1_F_D2I_X509_ATTRIBUTE 161
925#define ASN1_F_D2I_X509_CERT_AUX 285
926#define ASN1_F_D2I_X509_CINF 162
927#define ASN1_F_D2I_X509_CRL 163
928#define ASN1_F_D2I_X509_CRL_INFO 164
929#define ASN1_F_D2I_X509_EXTENSION 165
930#define ASN1_F_D2I_X509_KEY 166
931#define ASN1_F_D2I_X509_NAME 167
932#define ASN1_F_D2I_X509_NAME_ENTRY 168
933#define ASN1_F_D2I_X509_PKEY 169
934#define ASN1_F_D2I_X509_PUBKEY 170
935#define ASN1_F_D2I_X509_REQ 171
936#define ASN1_F_D2I_X509_REQ_INFO 172
937#define ASN1_F_D2I_X509_REVOKED 173
938#define ASN1_F_D2I_X509_SIG 174
939#define ASN1_F_D2I_X509_VAL 175
940#define ASN1_F_DIST_POINT_NAME_NEW 278
941#define ASN1_F_DIST_POINT_NEW 279
942#define ASN1_F_GENERAL_NAME_NEW 231
943#define ASN1_F_I2D_ASN1_HEADER 176
944#define ASN1_F_I2D_ASN1_TIME 225
945#define ASN1_F_I2D_DHPARAMS 177
946#define ASN1_F_I2D_DSAPARAMS 178
947#define ASN1_F_I2D_DSAPRIVATEKEY 179
948#define ASN1_F_I2D_DSAPUBLICKEY 180
949#define ASN1_F_I2D_DSA_PUBKEY 290
950#define ASN1_F_I2D_NETSCAPE_RSA 181
951#define ASN1_F_I2D_PKCS7 182
952#define ASN1_F_I2D_PRIVATEKEY 183
953#define ASN1_F_I2D_PUBLICKEY 184
954#define ASN1_F_I2D_RSAPRIVATEKEY 185
955#define ASN1_F_I2D_RSAPUBLICKEY 186
956#define ASN1_F_I2D_RSA_PUBKEY 289
957#define ASN1_F_I2D_X509_ATTRIBUTE 187
958#define ASN1_F_I2T_ASN1_OBJECT 188
959#define ASN1_F_NETSCAPE_CERT_SEQUENCE_NEW 229
960#define ASN1_F_NETSCAPE_PKEY_NEW 189
961#define ASN1_F_NETSCAPE_SPKAC_NEW 190
962#define ASN1_F_NETSCAPE_SPKI_NEW 191
963#define ASN1_F_NOTICEREF_NEW 272
964#define ASN1_F_OTHERNAME_NEW 288
965#define ASN1_F_PBE2PARAM_NEW 264
966#define ASN1_F_PBEPARAM_NEW 251
967#define ASN1_F_PBKDF2PARAM_NEW 265
968#define ASN1_F_PKCS12_BAGS_NEW 258
969#define ASN1_F_PKCS12_MAC_DATA_NEW 259
970#define ASN1_F_PKCS12_NEW 260
971#define ASN1_F_PKCS12_SAFEBAG_NEW 261
972#define ASN1_F_PKCS5_PBE2_SET 281
973#define ASN1_F_PKCS7_DIGEST_NEW 192
974#define ASN1_F_PKCS7_ENCRYPT_NEW 193
975#define ASN1_F_PKCS7_ENC_CONTENT_NEW 194
976#define ASN1_F_PKCS7_ENVELOPE_NEW 195
977#define ASN1_F_PKCS7_ISSUER_AND_SERIAL_NEW 196
978#define ASN1_F_PKCS7_NEW 197
979#define ASN1_F_PKCS7_RECIP_INFO_NEW 198
980#define ASN1_F_PKCS7_SIGNED_NEW 199
981#define ASN1_F_PKCS7_SIGNER_INFO_NEW 200
982#define ASN1_F_PKCS7_SIGN_ENVELOPE_NEW 201
983#define ASN1_F_PKCS8_PRIV_KEY_INFO_NEW 252
984#define ASN1_F_PKEY_USAGE_PERIOD_NEW 240
985#define ASN1_F_POLICYINFO_NEW 273
986#define ASN1_F_POLICYQUALINFO_NEW 274
987#define ASN1_F_SXNETID_NEW 244
988#define ASN1_F_SXNET_NEW 242
989#define ASN1_F_USERNOTICE_NEW 275
990#define ASN1_F_X509_ALGOR_NEW 202
991#define ASN1_F_X509_ATTRIBUTE_NEW 203
992#define ASN1_F_X509_CERT_AUX_NEW 286
993#define ASN1_F_X509_CINF_NEW 204
994#define ASN1_F_X509_CRL_INFO_NEW 205
995#define ASN1_F_X509_CRL_NEW 206
996#define ASN1_F_X509_DHPARAMS_NEW 207
997#define ASN1_F_X509_EXTENSION_NEW 208
998#define ASN1_F_X509_INFO_NEW 209
999#define ASN1_F_X509_KEY_NEW 210
1000#define ASN1_F_X509_NAME_ENTRY_NEW 211
1001#define ASN1_F_X509_NAME_NEW 212
1002#define ASN1_F_X509_NEW 213
1003#define ASN1_F_X509_PKEY_NEW 214
1004#define ASN1_F_X509_PUBKEY_NEW 215
1005#define ASN1_F_X509_REQ_INFO_NEW 216
1006#define ASN1_F_X509_REQ_NEW 217
1007#define ASN1_F_X509_REVOKED_NEW 218
1008#define ASN1_F_X509_SIG_NEW 219
1009#define ASN1_F_X509_VAL_FREE 220
1010#define ASN1_F_X509_VAL_NEW 221
1011
1012/* Reason codes. */
1013#define ASN1_R_BAD_CLASS 100
1014#define ASN1_R_BAD_OBJECT_HEADER 101
1015#define ASN1_R_BAD_PASSWORD_READ 102
1016#define ASN1_R_BAD_PKCS7_CONTENT 103
1017#define ASN1_R_BAD_PKCS7_TYPE 104
1018#define ASN1_R_BAD_TAG 105
1019#define ASN1_R_BAD_TYPE 106
1020#define ASN1_R_BN_LIB 107
1021#define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 108
1022#define ASN1_R_BUFFER_TOO_SMALL 109
1023#define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 166
1024#define ASN1_R_DATA_IS_WRONG 110
1025#define ASN1_R_DECODE_ERROR 155
1026#define ASN1_R_DECODING_ERROR 111
1027#define ASN1_R_ENCODE_ERROR 156
1028#define ASN1_R_ERROR_PARSING_SET_ELEMENT 112
1029#define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 157
1030#define ASN1_R_EXPECTING_AN_ENUMERATED 154
1031#define ASN1_R_EXPECTING_AN_INTEGER 113
1032#define ASN1_R_EXPECTING_AN_OBJECT 114
1033#define ASN1_R_EXPECTING_AN_OCTET_STRING 115
1034#define ASN1_R_EXPECTING_A_BIT_STRING 116
1035#define ASN1_R_EXPECTING_A_BOOLEAN 117
1036#define ASN1_R_EXPECTING_A_GENERALIZEDTIME 151
1037#define ASN1_R_EXPECTING_A_NULL 164
1038#define ASN1_R_EXPECTING_A_TIME 152
1039#define ASN1_R_EXPECTING_A_UTCTIME 118
1040#define ASN1_R_FIRST_NUM_TOO_LARGE 119
1041#define ASN1_R_GENERALIZEDTIME_TOO_LONG 153
1042#define ASN1_R_HEADER_TOO_LONG 120
1043#define ASN1_R_ILLEGAL_CHARACTERS 158
1044#define ASN1_R_INVALID_BMPSTRING_LENGTH 159
1045#define ASN1_R_INVALID_DIGIT 121
1046#define ASN1_R_INVALID_SEPARATOR 122
1047#define ASN1_R_INVALID_TIME_FORMAT 123
1048#define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 160
1049#define ASN1_R_INVALID_UTF8STRING 161
1050#define ASN1_R_IV_TOO_LARGE 124
1051#define ASN1_R_LENGTH_ERROR 125
1052#define ASN1_R_MISSING_SECOND_NUMBER 126
1053#define ASN1_R_NON_HEX_CHARACTERS 127
1054#define ASN1_R_NOT_ENOUGH_DATA 128
1055#define ASN1_R_NULL_IS_WRONG_LENGTH 165
1056#define ASN1_R_ODD_NUMBER_OF_CHARS 129
1057#define ASN1_R_PARSING 130
1058#define ASN1_R_PRIVATE_KEY_HEADER_MISSING 131
1059#define ASN1_R_SECOND_NUMBER_TOO_LARGE 132
1060#define ASN1_R_SHORT_LINE 133
1061#define ASN1_R_STRING_TOO_LONG 163
1062#define ASN1_R_STRING_TOO_SHORT 134
1063#define ASN1_R_TAG_VALUE_TOO_HIGH 135
1064#define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 136
1065#define ASN1_R_TOO_LONG 137
1066#define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 138
1067#define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 139
1068#define ASN1_R_UNKNOWN_ATTRIBUTE_TYPE 140
1069#define ASN1_R_UNKNOWN_FORMAT 162
1070#define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 141
1071#define ASN1_R_UNKNOWN_OBJECT_TYPE 142
1072#define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 143
1073#define ASN1_R_UNSUPPORTED_CIPHER 144
1074#define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 145
1075#define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 146
1076#define ASN1_R_UTCTIME_TOO_LONG 147
1077#define ASN1_R_WRONG_PRINTABLE_TYPE 148
1078#define ASN1_R_WRONG_TAG 149
1079#define ASN1_R_WRONG_TYPE 150
1080
1081#ifdef __cplusplus
1082}
1083#endif
1084#endif
1085