asn1.h

Go to the documentation of this file.
00001 /* crypto/asn1/asn1.h */
00002 /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
00003  * All rights reserved.
00004  *
00005  * This package is an SSL implementation written
00006  * by Eric Young (eay@cryptsoft.com).
00007  * The implementation was written so as to conform with Netscapes SSL.
00008  *
00009  * This library is free for commercial and non-commercial use as long as
00010  * the following conditions are aheared to.  The following conditions
00011  * apply to all code found in this distribution, be it the RC4, RSA,
00012  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
00013  * included with this distribution is covered by the same copyright terms
00014  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
00015  *
00016  * Copyright remains Eric Young's, and as such any Copyright notices in
00017  * the code are not to be removed.
00018  * If this package is used in a product, Eric Young should be given attribution
00019  * as the author of the parts of the library used.
00020  * This can be in the form of a textual message at program startup or
00021  * in documentation (online or textual) provided with the package.
00022  *
00023  * Redistribution and use in source and binary forms, with or without
00024  * modification, are permitted provided that the following conditions
00025  * are met:
00026  * 1. Redistributions of source code must retain the copyright
00027  *    notice, this list of conditions and the following disclaimer.
00028  * 2. Redistributions in binary form must reproduce the above copyright
00029  *    notice, this list of conditions and the following disclaimer in the
00030  *    documentation and/or other materials provided with the distribution.
00031  * 3. All advertising materials mentioning features or use of this software
00032  *    must display the following acknowledgement:
00033  *    "This product includes cryptographic software written by
00034  *     Eric Young (eay@cryptsoft.com)"
00035  *    The word 'cryptographic' can be left out if the rouines from the library
00036  *    being used are not cryptographic related :-).
00037  * 4. If you include any Windows specific code (or a derivative thereof) from
00038  *    the apps directory (application code) you must include an acknowledgement:
00039  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
00040  *
00041  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
00042  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00043  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00044  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
00045  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00046  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
00047  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00048  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
00049  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
00050  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00051  * SUCH DAMAGE.
00052  *
00053  * The licence and distribution terms for any publically available version or
00054  * derivative of this code cannot be changed.  i.e. this code cannot simply be
00055  * copied and put under another distribution licence
00056  * [including the GNU Public Licence.]
00057  */
00058 
00059 #ifndef HEADER_ASN1_H
00060 #define HEADER_ASN1_H
00061 
00062 #include <time.h>
00063 #include <openssl/e_os2.h>
00064 #ifndef OPENSSL_NO_BIO
00065 #include <openssl/bio.h>
00066 #endif
00067 #include <openssl/stack.h>
00068 #include <openssl/safestack.h>
00069 
00070 #include <openssl/symhacks.h>
00071 
00072 #include <openssl/ossl_typ.h>
00073 #ifndef OPENSSL_NO_DEPRECATED
00074 #include <openssl/bn.h>
00075 #endif
00076 
00077 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
00078 # undef OPENSSL_EXTERN
00079 # define OPENSSL_EXTERN OPENSSL_EXPORT
00080 #endif
00081 
00082 #ifdef  __cplusplus
00083 extern "C" {
00084 #endif
00085 
00086 #define V_ASN1_UNIVERSAL      0x00
00087 #define  V_ASN1_APPLICATION      0x40
00088 #define V_ASN1_CONTEXT_SPECIFIC     0x80
00089 #define V_ASN1_PRIVATE        0xc0
00090 
00091 #define V_ASN1_CONSTRUCTED    0x20
00092 #define V_ASN1_PRIMITIVE_TAG     0x1f
00093 #define V_ASN1_PRIMATIVE_TAG     0x1f
00094 
00095 #define V_ASN1_APP_CHOOSE     -2 /* let the recipient choose */
00096 #define V_ASN1_OTHER       -3 /* used in ASN1_TYPE */
00097 #define V_ASN1_ANY         -4 /* used in ASN1 template code */
00098 
00099 #define V_ASN1_NEG         0x100 /* negative flag */
00100 
00101 #define V_ASN1_UNDEF       -1
00102 #define V_ASN1_EOC         0
00103 #define V_ASN1_BOOLEAN        1  
00104 #define V_ASN1_INTEGER        2
00105 #define V_ASN1_NEG_INTEGER    (2 | V_ASN1_NEG)
00106 #define V_ASN1_BIT_STRING     3
00107 #define V_ASN1_OCTET_STRING      4
00108 #define V_ASN1_NULL        5
00109 #define V_ASN1_OBJECT         6
00110 #define V_ASN1_OBJECT_DESCRIPTOR 7
00111 #define V_ASN1_EXTERNAL       8
00112 #define V_ASN1_REAL        9
00113 #define V_ASN1_ENUMERATED     10
00114 #define V_ASN1_NEG_ENUMERATED    (10 | V_ASN1_NEG)
00115 #define V_ASN1_UTF8STRING     12
00116 #define V_ASN1_SEQUENCE       16
00117 #define V_ASN1_SET         17
00118 #define V_ASN1_NUMERICSTRING     18 
00119 #define V_ASN1_PRINTABLESTRING      19
00120 #define V_ASN1_T61STRING      20
00121 #define V_ASN1_TELETEXSTRING     20 /* alias */
00122 #define V_ASN1_VIDEOTEXSTRING    21 
00123 #define V_ASN1_IA5STRING      22
00124 #define V_ASN1_UTCTIME        23
00125 #define V_ASN1_GENERALIZEDTIME      24 
00126 #define V_ASN1_GRAPHICSTRING     25 
00127 #define V_ASN1_ISO64STRING    26 
00128 #define V_ASN1_VISIBLESTRING     26 /* alias */
00129 #define V_ASN1_GENERALSTRING     27 
00130 #define V_ASN1_UNIVERSALSTRING      28 
00131 #define V_ASN1_BMPSTRING      30
00132 
00133 /* For use with d2i_ASN1_type_bytes() */
00134 #define B_ASN1_NUMERICSTRING  0x0001
00135 #define B_ASN1_PRINTABLESTRING   0x0002
00136 #define B_ASN1_T61STRING   0x0004
00137 #define B_ASN1_TELETEXSTRING  0x0004
00138 #define B_ASN1_VIDEOTEXSTRING 0x0008
00139 #define B_ASN1_IA5STRING   0x0010
00140 #define B_ASN1_GRAPHICSTRING  0x0020
00141 #define B_ASN1_ISO64STRING 0x0040
00142 #define B_ASN1_VISIBLESTRING  0x0040
00143 #define B_ASN1_GENERALSTRING  0x0080
00144 #define B_ASN1_UNIVERSALSTRING   0x0100
00145 #define B_ASN1_OCTET_STRING   0x0200
00146 #define B_ASN1_BIT_STRING  0x0400
00147 #define B_ASN1_BMPSTRING   0x0800
00148 #define B_ASN1_UNKNOWN     0x1000
00149 #define B_ASN1_UTF8STRING  0x2000
00150 #define B_ASN1_UTCTIME     0x4000
00151 #define B_ASN1_GENERALIZEDTIME   0x8000
00152 #define B_ASN1_SEQUENCE    0x10000
00153 
00154 /* For use with ASN1_mbstring_copy() */
00155 #define MBSTRING_FLAG      0x1000
00156 #define MBSTRING_UTF8      (MBSTRING_FLAG)
00157 #define MBSTRING_ASC    (MBSTRING_FLAG|1)
00158 #define MBSTRING_BMP    (MBSTRING_FLAG|2)
00159 #define MBSTRING_UNIV      (MBSTRING_FLAG|4)
00160 
00161 struct X509_algor_st;
00162 
00163 #define DECLARE_ASN1_SET_OF(type) /* filled in by mkstack.pl */
00164 #define IMPLEMENT_ASN1_SET_OF(type) /* nothing, no longer needed */
00165 
00166 /* We MUST make sure that, except for constness, asn1_ctx_st and
00167    asn1_const_ctx are exactly the same.  Fortunately, as soon as
00168    the old ASN1 parsing macros are gone, we can throw this away
00169    as well... */
00170 typedef struct asn1_ctx_st
00171    {
00172    unsigned char *p;/* work char pointer */
00173    int eos; /* end of sequence read for indefinite encoding */
00174    int error;  /* error code to use when returning an error */
00175    int inf; /* constructed if 0x20, indefinite is 0x21 */
00176    int tag; /* tag from last 'get object' */
00177    int xclass; /* class from last 'get object' */
00178    long slen;  /* length of last 'get object' */
00179    unsigned char *max; /* largest value of p allowed */
00180    unsigned char *q;/* temporary variable */
00181    unsigned char **pp;/* variable */
00182    int line;   /* used in error processing */
00183    } ASN1_CTX;
00184 
00185 typedef struct asn1_const_ctx_st
00186    {
00187    const unsigned char *p;/* work char pointer */
00188    int eos; /* end of sequence read for indefinite encoding */
00189    int error;  /* error code to use when returning an error */
00190    int inf; /* constructed if 0x20, indefinite is 0x21 */
00191    int tag; /* tag from last 'get object' */
00192    int xclass; /* class from last 'get object' */
00193    long slen;  /* length of last 'get object' */
00194    const unsigned char *max; /* largest value of p allowed */
00195    const unsigned char *q;/* temporary variable */
00196    const unsigned char **pp;/* variable */
00197    int line;   /* used in error processing */
00198    } ASN1_const_CTX;
00199 
00200 /* These are used internally in the ASN1_OBJECT to keep track of
00201  * whether the names and data need to be free()ed */
00202 #define ASN1_OBJECT_FLAG_DYNAMIC  0x01 /* internal use */
00203 #define ASN1_OBJECT_FLAG_CRITICAL    0x02 /* critical x509v3 object id */
00204 #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04   /* internal use */
00205 #define ASN1_OBJECT_FLAG_DYNAMIC_DATA   0x08 /* internal use */
00206 typedef struct asn1_object_st
00207    {
00208    const char *sn,*ln;
00209    int nid;
00210    int length;
00211    unsigned char *data;
00212    int flags;  /* Should we free this one */
00213    } ASN1_OBJECT;
00214 
00215 #define ASN1_STRING_FLAG_BITS_LEFT 0x08 /* Set if 0x07 has bits left value */
00216 /* This indicates that the ASN1_STRING is not a real value but just a place
00217  * holder for the location where indefinite length constructed data should
00218  * be inserted in the memory buffer
00219  */
00220 #define ASN1_STRING_FLAG_NDEF 0x010
00221 /* This is the base type that holds just about everything :-) */
00222 typedef struct asn1_string_st
00223    {
00224    int length;
00225    int type;
00226    unsigned char *data;
00227    /* The value of the following field depends on the type being
00228     * held.  It is mostly being used for BIT_STRING so if the
00229     * input data has a non-zero 'unused bits' value, it will be
00230     * handled correctly */
00231    long flags;
00232    } ASN1_STRING;
00233 
00234 /* ASN1_ENCODING structure: this is used to save the received
00235  * encoding of an ASN1 type. This is useful to get round
00236  * problems with invalid encodings which can break signatures.
00237  */
00238 
00239 typedef struct ASN1_ENCODING_st
00240    {
00241    unsigned char *enc;  /* DER encoding */
00242    long len;      /* Length of encoding */
00243    int modified;      /* set to 1 if 'enc' is invalid */
00244    } ASN1_ENCODING;
00245 
00246 /* Used with ASN1 LONG type: if a long is set to this it is omitted */
00247 #define ASN1_LONG_UNDEF 0x7fffffffL
00248 
00249 #define STABLE_FLAGS_MALLOC   0x01
00250 #define STABLE_NO_MASK     0x02
00251 #define DIRSTRING_TYPE  \
00252  (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
00253 #define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
00254 
00255 typedef struct asn1_string_table_st {
00256    int nid;
00257    long minsize;
00258    long maxsize;
00259    unsigned long mask;
00260    unsigned long flags;
00261 } ASN1_STRING_TABLE;
00262 
00263 DECLARE_STACK_OF(ASN1_STRING_TABLE)
00264 
00265 /* size limits: this stuff is taken straight from RFC2459 */
00266 
00267 #define ub_name            32768
00268 #define ub_common_name        64
00269 #define ub_locality_name      128
00270 #define ub_state_name         128
00271 #define ub_organization_name     64
00272 #define ub_organization_unit_name   64
00273 #define ub_title        64
00274 #define ub_email_address      128
00275 
00276 /* Declarations for template structures: for full definitions
00277  * see asn1t.h
00278  */
00279 typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
00280 typedef struct ASN1_ITEM_st ASN1_ITEM;
00281 typedef struct ASN1_TLC_st ASN1_TLC;
00282 /* This is just an opaque pointer */
00283 typedef struct ASN1_VALUE_st ASN1_VALUE;
00284 
00285 /* Declare ASN1 functions: the implement macro in in asn1t.h */
00286 
00287 #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
00288 
00289 #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
00290    DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
00291 
00292 #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
00293    DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00294    DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
00295 
00296 #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
00297    DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00298    DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
00299 
00300 #define  DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
00301    type *d2i_##name(type **a, const unsigned char **in, long len); \
00302    int i2d_##name(type *a, unsigned char **out); \
00303    DECLARE_ASN1_ITEM(itname)
00304 
00305 #define  DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
00306    type *d2i_##name(type **a, const unsigned char **in, long len); \
00307    int i2d_##name(const type *a, unsigned char **out); \
00308    DECLARE_ASN1_ITEM(name)
00309 
00310 #define  DECLARE_ASN1_NDEF_FUNCTION(name) \
00311    int i2d_##name##_NDEF(name *a, unsigned char **out);
00312 
00313 #define DECLARE_ASN1_FUNCTIONS_const(name) \
00314    name *name##_new(void); \
00315    void name##_free(name *a);
00316 
00317 #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00318    type *name##_new(void); \
00319    void name##_free(type *a);
00320 
00321 #define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
00322 #define I2D_OF(type) int (*)(type *,unsigned char **)
00323 #define I2D_OF_const(type) int (*)(const type *,unsigned char **)
00324 
00325 #define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
00326 #define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
00327 #define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
00328 
00329 TYPEDEF_D2I2D_OF(void);
00330 
00331 /* The following macros and typedefs allow an ASN1_ITEM
00332  * to be embedded in a structure and referenced. Since
00333  * the ASN1_ITEM pointers need to be globally accessible
00334  * (possibly from shared libraries) they may exist in
00335  * different forms. On platforms that support it the
00336  * ASN1_ITEM structure itself will be globally exported.
00337  * Other platforms will export a function that returns
00338  * an ASN1_ITEM pointer.
00339  *
00340  * To handle both cases transparently the macros below
00341  * should be used instead of hard coding an ASN1_ITEM
00342  * pointer in a structure.
00343  *
00344  * The structure will look like this:
00345  *
00346  * typedef struct SOMETHING_st {
00347  *      ...
00348  *      ASN1_ITEM_EXP *iptr;
00349  *      ...
00350  * } SOMETHING;
00351  *
00352  * It would be initialised as e.g.:
00353  *
00354  * SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
00355  *
00356  * and the actual pointer extracted with:
00357  *
00358  * const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
00359  *
00360  * Finally an ASN1_ITEM pointer can be extracted from an
00361  * appropriate reference with: ASN1_ITEM_rptr(X509). This
00362  * would be used when a function takes an ASN1_ITEM * argument.
00363  *
00364  */
00365 
00366 #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
00367 
00368 /* ASN1_ITEM pointer exported type */
00369 typedef const ASN1_ITEM ASN1_ITEM_EXP;
00370 
00371 /* Macro to obtain ASN1_ITEM pointer from exported type */
00372 #define ASN1_ITEM_ptr(iptr) (iptr)
00373 
00374 /* Macro to include ASN1_ITEM pointer from base type */
00375 #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
00376 
00377 #define ASN1_ITEM_rptr(ref) (&(ref##_it))
00378 
00379 #define DECLARE_ASN1_ITEM(name) \
00380    OPENSSL_EXTERN const ASN1_ITEM name##_it;
00381 
00382 #else
00383 
00384 /* Platforms that can't easily handle shared global variables are declared
00385  * as functions returning ASN1_ITEM pointers.
00386  */
00387 
00388 /* ASN1_ITEM pointer exported type */
00389 typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
00390 
00391 /* Macro to obtain ASN1_ITEM pointer from exported type */
00392 #define ASN1_ITEM_ptr(iptr) (iptr())
00393 
00394 /* Macro to include ASN1_ITEM pointer from base type */
00395 #define ASN1_ITEM_ref(iptr) (iptr##_it)
00396 
00397 #define ASN1_ITEM_rptr(ref) (ref##_it())
00398 
00399 #define DECLARE_ASN1_ITEM(name) \
00400    const ASN1_ITEM * name##_it(void);
00401 
00402 #endif
00403 
00404 /* Parameters used by ASN1_STRING_print_ex() */
00405 
00406 /* These determine which characters to escape:
00407  * RFC2253 special characters, control characters and
00408  * MSB set characters
00409  */
00410 
00411 #define ASN1_STRFLGS_ESC_2253    1
00412 #define ASN1_STRFLGS_ESC_CTRL    2
00413 #define ASN1_STRFLGS_ESC_MSB     4
00414 
00415 
00416 /* This flag determines how we do escaping: normally
00417  * RC2253 backslash only, set this to use backslash and
00418  * quote.
00419  */
00420 
00421 #define ASN1_STRFLGS_ESC_QUOTE      8
00422 
00423 
00424 /* These three flags are internal use only. */
00425 
00426 /* Character is a valid PrintableString character */
00427 #define CHARTYPE_PRINTABLESTRING 0x10
00428 /* Character needs escaping if it is the first character */
00429 #define CHARTYPE_FIRST_ESC_2253     0x20
00430 /* Character needs escaping if it is the last character */
00431 #define CHARTYPE_LAST_ESC_2253      0x40
00432 
00433 /* NB the internal flags are safely reused below by flags
00434  * handled at the top level.
00435  */
00436 
00437 /* If this is set we convert all character strings
00438  * to UTF8 first
00439  */
00440 
00441 #define ASN1_STRFLGS_UTF8_CONVERT   0x10
00442 
00443 /* If this is set we don't attempt to interpret content:
00444  * just assume all strings are 1 byte per character. This
00445  * will produce some pretty odd looking output!
00446  */
00447 
00448 #define ASN1_STRFLGS_IGNORE_TYPE 0x20
00449 
00450 /* If this is set we include the string type in the output */
00451 #define ASN1_STRFLGS_SHOW_TYPE      0x40
00452 
00453 /* This determines which strings to display and which to
00454  * 'dump' (hex dump of content octets or DER encoding). We can
00455  * only dump non character strings or everything. If we
00456  * don't dump 'unknown' they are interpreted as character
00457  * strings with 1 octet per character and are subject to
00458  * the usual escaping options.
00459  */
00460 
00461 #define ASN1_STRFLGS_DUMP_ALL    0x80
00462 #define ASN1_STRFLGS_DUMP_UNKNOWN   0x100
00463 
00464 /* These determine what 'dumping' does, we can dump the
00465  * content octets or the DER encoding: both use the
00466  * RFC2253 #XXXXX notation.
00467  */
00468 
00469 #define ASN1_STRFLGS_DUMP_DER    0x200
00470 
00471 /* All the string flags consistent with RFC2253,
00472  * escaping control characters isn't essential in
00473  * RFC2253 but it is advisable anyway.
00474  */
00475 
00476 #define ASN1_STRFLGS_RFC2253  (ASN1_STRFLGS_ESC_2253 | \
00477             ASN1_STRFLGS_ESC_CTRL | \
00478             ASN1_STRFLGS_ESC_MSB | \
00479             ASN1_STRFLGS_UTF8_CONVERT | \
00480             ASN1_STRFLGS_DUMP_UNKNOWN | \
00481             ASN1_STRFLGS_DUMP_DER)
00482 
00483 DECLARE_STACK_OF(ASN1_INTEGER)
00484 DECLARE_ASN1_SET_OF(ASN1_INTEGER)
00485 
00486 DECLARE_STACK_OF(ASN1_GENERALSTRING)
00487 
00488 typedef struct asn1_type_st
00489    {
00490    int type;
00491    union {
00492       char *ptr;
00493       ASN1_BOOLEAN      boolean;
00494       ASN1_STRING *     asn1_string;
00495       ASN1_OBJECT *     object;
00496       ASN1_INTEGER *    integer;
00497       ASN1_ENUMERATED * enumerated;
00498       ASN1_BIT_STRING * bit_string;
00499       ASN1_OCTET_STRING *  octet_string;
00500       ASN1_PRINTABLESTRING *  printablestring;
00501       ASN1_T61STRING *  t61string;
00502       ASN1_IA5STRING *  ia5string;
00503       ASN1_GENERALSTRING * generalstring;
00504       ASN1_BMPSTRING *  bmpstring;
00505       ASN1_UNIVERSALSTRING *  universalstring;
00506       ASN1_UTCTIME *    utctime;
00507       ASN1_GENERALIZEDTIME *  generalizedtime;
00508       ASN1_VISIBLESTRING * visiblestring;
00509       ASN1_UTF8STRING * utf8string;
00510       /* set and sequence are left complete and still
00511        * contain the set or sequence bytes */
00512       ASN1_STRING *     set;
00513       ASN1_STRING *     sequence;
00514       } value;
00515    } ASN1_TYPE;
00516 
00517 DECLARE_STACK_OF(ASN1_TYPE)
00518 DECLARE_ASN1_SET_OF(ASN1_TYPE)
00519 
00520 typedef struct asn1_method_st
00521    {
00522    i2d_of_void *i2d;
00523    d2i_of_void *d2i;
00524    void *(*create)(void);
00525    void (*destroy)(void *);
00526    } ASN1_METHOD;
00527 
00528 /* This is used when parsing some Netscape objects */
00529 typedef struct asn1_header_st
00530    {
00531    ASN1_OCTET_STRING *header;
00532    void *data;
00533    ASN1_METHOD *meth;
00534    } ASN1_HEADER;
00535 
00536 /* This is used to contain a list of bit names */
00537 typedef struct BIT_STRING_BITNAME_st {
00538    int bitnum;
00539    const char *lname;
00540    const char *sname;
00541 } BIT_STRING_BITNAME;
00542 
00543 
00544 #define M_ASN1_STRING_length(x)  ((x)->length)
00545 #define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
00546 #define M_ASN1_STRING_type(x) ((x)->type)
00547 #define M_ASN1_STRING_data(x) ((x)->data)
00548 
00549 /* Macros for string operations */
00550 #define M_ASN1_BIT_STRING_new()  (ASN1_BIT_STRING *)\
00551       ASN1_STRING_type_new(V_ASN1_BIT_STRING)
00552 #define M_ASN1_BIT_STRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00553 #define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
00554       ASN1_STRING_dup((ASN1_STRING *)a)
00555 #define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
00556       (ASN1_STRING *)a,(ASN1_STRING *)b)
00557 #define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
00558 
00559 #define M_ASN1_INTEGER_new()  (ASN1_INTEGER *)\
00560       ASN1_STRING_type_new(V_ASN1_INTEGER)
00561 #define M_ASN1_INTEGER_free(a)      ASN1_STRING_free((ASN1_STRING *)a)
00562 #define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
00563 #define M_ASN1_INTEGER_cmp(a,b)  ASN1_STRING_cmp(\
00564       (ASN1_STRING *)a,(ASN1_STRING *)b)
00565 
00566 #define M_ASN1_ENUMERATED_new()  (ASN1_ENUMERATED *)\
00567       ASN1_STRING_type_new(V_ASN1_ENUMERATED)
00568 #define M_ASN1_ENUMERATED_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00569 #define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
00570 #define M_ASN1_ENUMERATED_cmp(a,b)  ASN1_STRING_cmp(\
00571       (ASN1_STRING *)a,(ASN1_STRING *)b)
00572 
00573 #define M_ASN1_OCTET_STRING_new()   (ASN1_OCTET_STRING *)\
00574       ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
00575 #define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00576 #define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
00577       ASN1_STRING_dup((ASN1_STRING *)a)
00578 #define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
00579       (ASN1_STRING *)a,(ASN1_STRING *)b)
00580 #define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
00581 #define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
00582 #define M_i2d_ASN1_OCTET_STRING(a,pp) \
00583       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
00584       V_ASN1_UNIVERSAL)
00585 
00586 #define B_ASN1_TIME \
00587          B_ASN1_UTCTIME | \
00588          B_ASN1_GENERALIZEDTIME
00589 
00590 #define B_ASN1_PRINTABLE \
00591          B_ASN1_PRINTABLESTRING| \
00592          B_ASN1_T61STRING| \
00593          B_ASN1_IA5STRING| \
00594          B_ASN1_BIT_STRING| \
00595          B_ASN1_UNIVERSALSTRING|\
00596          B_ASN1_BMPSTRING|\
00597          B_ASN1_UTF8STRING|\
00598          B_ASN1_SEQUENCE|\
00599          B_ASN1_UNKNOWN
00600 
00601 #define B_ASN1_DIRECTORYSTRING \
00602          B_ASN1_PRINTABLESTRING| \
00603          B_ASN1_TELETEXSTRING|\
00604          B_ASN1_BMPSTRING|\
00605          B_ASN1_UNIVERSALSTRING|\
00606          B_ASN1_UTF8STRING
00607 
00608 #define B_ASN1_DISPLAYTEXT \
00609          B_ASN1_IA5STRING| \
00610          B_ASN1_VISIBLESTRING| \
00611          B_ASN1_BMPSTRING|\
00612          B_ASN1_UTF8STRING
00613 
00614 #define M_ASN1_PRINTABLE_new()   ASN1_STRING_type_new(V_ASN1_T61STRING)
00615 #define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00616 #define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00617       pp,a->type,V_ASN1_UNIVERSAL)
00618 #define M_d2i_ASN1_PRINTABLE(a,pp,l) \
00619       d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00620          B_ASN1_PRINTABLE)
00621 
00622 #define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
00623 #define M_DIRECTORYSTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00624 #define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00625                   pp,a->type,V_ASN1_UNIVERSAL)
00626 #define M_d2i_DIRECTORYSTRING(a,pp,l) \
00627       d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00628          B_ASN1_DIRECTORYSTRING)
00629 
00630 #define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
00631 #define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00632 #define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00633                   pp,a->type,V_ASN1_UNIVERSAL)
00634 #define M_d2i_DISPLAYTEXT(a,pp,l) \
00635       d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00636          B_ASN1_DISPLAYTEXT)
00637 
00638 #define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
00639       ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
00640 #define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00641 #define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
00642       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
00643       V_ASN1_UNIVERSAL)
00644 #define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
00645       (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
00646       ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
00647 
00648 #define M_ASN1_T61STRING_new()   (ASN1_T61STRING *)\
00649       ASN1_STRING_type_new(V_ASN1_T61STRING)
00650 #define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00651 #define M_i2d_ASN1_T61STRING(a,pp) \
00652       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
00653       V_ASN1_UNIVERSAL)
00654 #define M_d2i_ASN1_T61STRING(a,pp,l) \
00655       (ASN1_T61STRING *)d2i_ASN1_type_bytes\
00656       ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
00657 
00658 #define M_ASN1_IA5STRING_new()   (ASN1_IA5STRING *)\
00659       ASN1_STRING_type_new(V_ASN1_IA5STRING)
00660 #define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00661 #define M_ASN1_IA5STRING_dup(a)  \
00662          (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
00663 #define M_i2d_ASN1_IA5STRING(a,pp) \
00664       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
00665          V_ASN1_UNIVERSAL)
00666 #define M_d2i_ASN1_IA5STRING(a,pp,l) \
00667       (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
00668          B_ASN1_IA5STRING)
00669 
00670 #define M_ASN1_UTCTIME_new()  (ASN1_UTCTIME *)\
00671       ASN1_STRING_type_new(V_ASN1_UTCTIME)
00672 #define M_ASN1_UTCTIME_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00673 #define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
00674 
00675 #define M_ASN1_GENERALIZEDTIME_new()   (ASN1_GENERALIZEDTIME *)\
00676       ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
00677 #define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00678 #define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
00679    (ASN1_STRING *)a)
00680 
00681 #define M_ASN1_TIME_new()  (ASN1_TIME *)\
00682       ASN1_STRING_type_new(V_ASN1_UTCTIME)
00683 #define M_ASN1_TIME_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00684 #define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
00685 
00686 #define M_ASN1_GENERALSTRING_new()  (ASN1_GENERALSTRING *)\
00687       ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
00688 #define M_ASN1_GENERALSTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00689 #define M_i2d_ASN1_GENERALSTRING(a,pp) \
00690       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
00691          V_ASN1_UNIVERSAL)
00692 #define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
00693       (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
00694       ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
00695 
00696 #define M_ASN1_UNIVERSALSTRING_new()   (ASN1_UNIVERSALSTRING *)\
00697       ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
00698 #define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00699 #define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
00700       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
00701          V_ASN1_UNIVERSAL)
00702 #define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
00703       (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
00704       ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
00705 
00706 #define M_ASN1_BMPSTRING_new()   (ASN1_BMPSTRING *)\
00707       ASN1_STRING_type_new(V_ASN1_BMPSTRING)
00708 #define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00709 #define M_i2d_ASN1_BMPSTRING(a,pp) \
00710       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
00711          V_ASN1_UNIVERSAL)
00712 #define M_d2i_ASN1_BMPSTRING(a,pp,l) \
00713       (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
00714       ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
00715 
00716 #define M_ASN1_VISIBLESTRING_new()  (ASN1_VISIBLESTRING *)\
00717       ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
00718 #define M_ASN1_VISIBLESTRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00719 #define M_i2d_ASN1_VISIBLESTRING(a,pp) \
00720       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
00721          V_ASN1_UNIVERSAL)
00722 #define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
00723       (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
00724       ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
00725 
00726 #define M_ASN1_UTF8STRING_new()  (ASN1_UTF8STRING *)\
00727       ASN1_STRING_type_new(V_ASN1_UTF8STRING)
00728 #define M_ASN1_UTF8STRING_free(a)   ASN1_STRING_free((ASN1_STRING *)a)
00729 #define M_i2d_ASN1_UTF8STRING(a,pp) \
00730       i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
00731          V_ASN1_UNIVERSAL)
00732 #define M_d2i_ASN1_UTF8STRING(a,pp,l) \
00733       (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
00734       ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
00735 
00736   /* for the is_set parameter to i2d_ASN1_SET */
00737 #define IS_SEQUENCE  0
00738 #define IS_SET    1
00739 
00740 DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
00741 
00742 int ASN1_TYPE_get(ASN1_TYPE *a);
00743 void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
00744 
00745 ASN1_OBJECT *  ASN1_OBJECT_new(void );
00746 void     ASN1_OBJECT_free(ASN1_OBJECT *a);
00747 int      i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
00748 ASN1_OBJECT *  c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
00749          long length);
00750 ASN1_OBJECT *  d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
00751          long length);
00752 
00753 DECLARE_ASN1_ITEM(ASN1_OBJECT)
00754 
00755 DECLARE_STACK_OF(ASN1_OBJECT)
00756 DECLARE_ASN1_SET_OF(ASN1_OBJECT)
00757 
00758 ASN1_STRING *  ASN1_STRING_new(void);
00759 void     ASN1_STRING_free(ASN1_STRING *a);
00760 ASN1_STRING *  ASN1_STRING_dup(ASN1_STRING *a);
00761 ASN1_STRING *  ASN1_STRING_type_new(int type );
00762 int      ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
00763   /* Since this is used to store all sorts of things, via macros, for now, make
00764      its data void * */
00765 int      ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
00766 int ASN1_STRING_length(ASN1_STRING *x);
00767 void ASN1_STRING_length_set(ASN1_STRING *x, int n);
00768 int ASN1_STRING_type(ASN1_STRING *x);
00769 unsigned char * ASN1_STRING_data(ASN1_STRING *x);
00770 
00771 DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
00772 int      i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
00773 ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp,
00774          long length);
00775 int      ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
00776          int length );
00777 int      ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
00778 int      ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
00779 
00780 #ifndef OPENSSL_NO_BIO
00781 int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
00782             BIT_STRING_BITNAME *tbl, int indent);
00783 #endif
00784 int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
00785 int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
00786             BIT_STRING_BITNAME *tbl);
00787 
00788 int      i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
00789 int      d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
00790 
00791 DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
00792 int      i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
00793 ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp,
00794          long length);
00795 ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp,
00796          long length);
00797 ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
00798 int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y);
00799 
00800 DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
00801 
00802 int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
00803 ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
00804 int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
00805 int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
00806 #if 0
00807 time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
00808 #endif
00809 
00810 int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
00811 ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
00812 int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
00813 
00814 DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
00815 ASN1_OCTET_STRING *  ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
00816 int   ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
00817 int   ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len);
00818 
00819 DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
00820 DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
00821 DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
00822 DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
00823 DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
00824 
00825 int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
00826 int UTF8_putc(unsigned char *str, int len, unsigned long value);
00827 
00828 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
00829 
00830 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
00831 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
00832 DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
00833 DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
00834 DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
00835 DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
00836 DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
00837 DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
00838 DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
00839 
00840 DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
00841 
00842 ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
00843 int ASN1_TIME_check(ASN1_TIME *t);
00844 ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
00845 
00846 int i2d_ASN1_SET(STACK *a, unsigned char **pp,
00847        i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
00848 STACK *  d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
00849            d2i_of_void *d2i, void (*free_func)(void *),
00850            int ex_tag, int ex_class);
00851 
00852 #ifndef OPENSSL_NO_BIO
00853 int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
00854 int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);
00855 int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
00856 int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size);
00857 int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a);
00858 int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size);
00859 int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
00860 #endif
00861 int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
00862 
00863 int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
00864 ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
00865    const char *sn, const char *ln);
00866 
00867 int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
00868 long ASN1_INTEGER_get(ASN1_INTEGER *a);
00869 ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai);
00870 BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai,BIGNUM *bn);
00871 
00872 int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
00873 long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);
00874 ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
00875 BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn);
00876 
00877 /* General */
00878 /* given a string, return the correct type, max is the maximum length */
00879 int ASN1_PRINTABLE_type(const unsigned char *s, int max);
00880 
00881 int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
00882 ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
00883    long length, int Ptag, int Pclass);
00884 unsigned long ASN1_tag2bit(int tag);
00885 /* type is one or more of the B_ASN1_ values. */
00886 ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp,
00887       long length,int type);
00888 
00889 /* PARSING */
00890 int asn1_Finish(ASN1_CTX *c);
00891 int asn1_const_Finish(ASN1_const_CTX *c);
00892 
00893 /* SPECIALS */
00894 int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
00895    int *pclass, long omax);
00896 int ASN1_check_infinite_end(unsigned char **p,long len);
00897 int ASN1_const_check_infinite_end(const unsigned char **p,long len);
00898 void ASN1_put_object(unsigned char **pp, int constructed, int length,
00899    int tag, int xclass);
00900 int ASN1_put_eoc(unsigned char **pp);
00901 int ASN1_object_size(int constructed, int length, int tag);
00902 
00903 /* Used to implement other functions */
00904 void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
00905 #define ASN1_dup_of(type,i2d,d2i,x) \
00906    ((type *(*)(I2D_OF(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
00907 #define ASN1_dup_of_const(type,i2d,d2i,x) \
00908    ((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
00909 
00910 void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
00911 
00912 #ifndef OPENSSL_NO_FP_API
00913 void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
00914 #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
00915    ((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))openssl_fcast(ASN1_d2i_fp))(xnew,d2i,in,x)
00916 void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
00917 int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x);
00918 #define ASN1_i2d_fp_of(type,i2d,out,x) \
00919    ((int (*)(I2D_OF(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
00920 #define ASN1_i2d_fp_of_const(type,i2d,out,x) \
00921    ((int (*)(I2D_OF_const(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
00922 int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
00923 int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
00924 #endif
00925 
00926 int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
00927 
00928 #ifndef OPENSSL_NO_BIO
00929 void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
00930 #define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
00931    ((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))openssl_fcast(ASN1_d2i_bio))(xnew,d2i,in,x)
00932 void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
00933 int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
00934 #define ASN1_i2d_bio_of(type,i2d,out,x) \
00935    ((int (*)(I2D_OF(type),BIO *,type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
00936 #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
00937    ((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
00938 int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
00939 int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
00940 int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
00941 int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
00942 int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
00943 int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
00944 int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent);
00945 int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump);
00946 #endif
00947 const char *ASN1_tag2str(int tag);
00948 
00949 /* Used to load and write netscape format cert/key */
00950 int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp);
00951 ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length);
00952 ASN1_HEADER *ASN1_HEADER_new(void );
00953 void ASN1_HEADER_free(ASN1_HEADER *a);
00954 
00955 int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
00956 
00957 /* Not used that much at this point, except for the first two */
00958 ASN1_METHOD *X509_asn1_meth(void);
00959 ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
00960 ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void);
00961 ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void);
00962 
00963 int ASN1_TYPE_set_octetstring(ASN1_TYPE *a,
00964    unsigned char *data, int len);
00965 int ASN1_TYPE_get_octetstring(ASN1_TYPE *a,
00966    unsigned char *data, int max_len);
00967 int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
00968    unsigned char *data, int len);
00969 int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
00970    unsigned char *data, int max_len);
00971 
00972 STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
00973              d2i_of_void *d2i, void (*free_func)(void *));
00974 unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
00975               unsigned char **buf, int *len );
00976 void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
00977 void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
00978 ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
00979                ASN1_OCTET_STRING **oct);
00980 #define ASN1_pack_string_of(type,obj,i2d,oct) \
00981    ((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))openssl_fcast(ASN1_pack_string))(obj,i2d,oct)
00982 ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
00983 
00984 void ASN1_STRING_set_default_mask(unsigned long mask);
00985 int ASN1_STRING_set_default_mask_asc(char *p);
00986 unsigned long ASN1_STRING_get_default_mask(void);
00987 int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
00988                int inform, unsigned long mask);
00989 int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
00990                int inform, unsigned long mask,
00991                long minsize, long maxsize);
00992 
00993 ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
00994       const unsigned char *in, int inlen, int inform, int nid);
00995 ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
00996 int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
00997 void ASN1_STRING_TABLE_cleanup(void);
00998 
00999 /* ASN1 template functions */
01000 
01001 /* Old API compatible functions */
01002 ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
01003 void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
01004 ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it);
01005 int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
01006 int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
01007 
01008 void ASN1_add_oid_module(void);
01009 
01010 ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
01011 ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
01012 
01013 /* BEGIN ERROR CODES */
01014 /* The following lines are auto generated by the script mkerr.pl. Any changes
01015  * made after this point may be overwritten when the script is next run.
01016  */
01017 void ERR_load_ASN1_strings(void);
01018 
01019 /* Error codes for the ASN1 functions. */
01020 
01021 /* Function codes. */
01022 #define ASN1_F_A2D_ASN1_OBJECT             100
01023 #define ASN1_F_A2I_ASN1_ENUMERATED         101
01024 #define ASN1_F_A2I_ASN1_INTEGER            102
01025 #define ASN1_F_A2I_ASN1_STRING             103
01026 #define ASN1_F_APPEND_EXP            176
01027 #define ASN1_F_ASN1_BIT_STRING_SET_BIT        183
01028 #define ASN1_F_ASN1_CB               177
01029 #define ASN1_F_ASN1_CHECK_TLEN             104
01030 #define ASN1_F_ASN1_COLLATE_PRIMITIVE         105
01031 #define ASN1_F_ASN1_COLLECT             106
01032 #define ASN1_F_ASN1_D2I_EX_PRIMITIVE          108
01033 #define ASN1_F_ASN1_D2I_FP           109
01034 #define ASN1_F_ASN1_D2I_READ_BIO        107
01035 #define ASN1_F_ASN1_DIGEST           184
01036 #define ASN1_F_ASN1_DO_ADB           110
01037 #define ASN1_F_ASN1_DUP              111
01038 #define ASN1_F_ASN1_ENUMERATED_SET         112
01039 #define ASN1_F_ASN1_ENUMERATED_TO_BN          113
01040 #define ASN1_F_ASN1_EX_C2I           204
01041 #define ASN1_F_ASN1_FIND_END            190
01042 #define ASN1_F_ASN1_GENERALIZEDTIME_SET          185
01043 #define ASN1_F_ASN1_GENERATE_V3            178
01044 #define ASN1_F_ASN1_GET_OBJECT             114
01045 #define ASN1_F_ASN1_HEADER_NEW             115
01046 #define ASN1_F_ASN1_I2D_BIO             116
01047 #define ASN1_F_ASN1_I2D_FP           117
01048 #define ASN1_F_ASN1_INTEGER_SET            118
01049 #define ASN1_F_ASN1_INTEGER_TO_BN          119
01050 #define ASN1_F_ASN1_ITEM_D2I_FP            206
01051 #define ASN1_F_ASN1_ITEM_DUP            191
01052 #define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW          121
01053 #define ASN1_F_ASN1_ITEM_EX_D2I            120
01054 #define ASN1_F_ASN1_ITEM_I2D_BIO        192
01055 #define ASN1_F_ASN1_ITEM_I2D_FP            193
01056 #define ASN1_F_ASN1_ITEM_PACK           198
01057 #define ASN1_F_ASN1_ITEM_SIGN           195
01058 #define ASN1_F_ASN1_ITEM_UNPACK            199
01059 #define ASN1_F_ASN1_ITEM_VERIFY            197
01060 #define ASN1_F_ASN1_MBSTRING_NCOPY         122
01061 #define ASN1_F_ASN1_OBJECT_NEW             123
01062 #define ASN1_F_ASN1_PACK_STRING            124
01063 #define ASN1_F_ASN1_PCTX_NEW            205
01064 #define ASN1_F_ASN1_PKCS5_PBE_SET          125
01065 #define ASN1_F_ASN1_SEQ_PACK            126
01066 #define ASN1_F_ASN1_SEQ_UNPACK             127
01067 #define ASN1_F_ASN1_SIGN             128
01068 #define ASN1_F_ASN1_STR2TYPE            179
01069 #define ASN1_F_ASN1_STRING_SET             186
01070 #define ASN1_F_ASN1_STRING_TABLE_ADD          129
01071 #define ASN1_F_ASN1_STRING_TYPE_NEW        130
01072 #define ASN1_F_ASN1_TEMPLATE_EX_D2I        132
01073 #define ASN1_F_ASN1_TEMPLATE_NEW        133
01074 #define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I        131
01075 #define ASN1_F_ASN1_TIME_SET            175
01076 #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING     134
01077 #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING      135
01078 #define ASN1_F_ASN1_UNPACK_STRING          136
01079 #define ASN1_F_ASN1_UTCTIME_SET            187
01080 #define ASN1_F_ASN1_VERIFY           137
01081 #define ASN1_F_BITSTR_CB             180
01082 #define ASN1_F_BN_TO_ASN1_ENUMERATED          138
01083 #define ASN1_F_BN_TO_ASN1_INTEGER          139
01084 #define ASN1_F_C2I_ASN1_BIT_STRING         189
01085 #define ASN1_F_C2I_ASN1_INTEGER            194
01086 #define ASN1_F_C2I_ASN1_OBJECT             196
01087 #define ASN1_F_COLLECT_DATA             140
01088 #define ASN1_F_D2I_ASN1_BIT_STRING         141
01089 #define ASN1_F_D2I_ASN1_BOOLEAN            142
01090 #define ASN1_F_D2I_ASN1_BYTES           143
01091 #define ASN1_F_D2I_ASN1_GENERALIZEDTIME          144
01092 #define ASN1_F_D2I_ASN1_HEADER             145
01093 #define ASN1_F_D2I_ASN1_INTEGER            146
01094 #define ASN1_F_D2I_ASN1_OBJECT             147
01095 #define ASN1_F_D2I_ASN1_SET             148
01096 #define ASN1_F_D2I_ASN1_TYPE_BYTES         149
01097 #define ASN1_F_D2I_ASN1_UINTEGER        150
01098 #define ASN1_F_D2I_ASN1_UTCTIME            151
01099 #define ASN1_F_D2I_NETSCAPE_RSA            152
01100 #define ASN1_F_D2I_NETSCAPE_RSA_2          153
01101 #define ASN1_F_D2I_PRIVATEKEY           154
01102 #define ASN1_F_D2I_PUBLICKEY            155
01103 #define ASN1_F_D2I_RSA_NET           200
01104 #define ASN1_F_D2I_RSA_NET_2            201
01105 #define ASN1_F_D2I_X509              156
01106 #define ASN1_F_D2I_X509_CINF            157
01107 #define ASN1_F_D2I_X509_PKEY            159
01108 #define ASN1_F_I2D_ASN1_SET             188
01109 #define ASN1_F_I2D_ASN1_TIME            160
01110 #define ASN1_F_I2D_DSA_PUBKEY           161
01111 #define ASN1_F_I2D_EC_PUBKEY            181
01112 #define ASN1_F_I2D_PRIVATEKEY           163
01113 #define ASN1_F_I2D_PUBLICKEY            164
01114 #define ASN1_F_I2D_RSA_NET           162
01115 #define ASN1_F_I2D_RSA_PUBKEY           165
01116 #define ASN1_F_LONG_C2I              166
01117 #define ASN1_F_OID_MODULE_INIT             174
01118 #define ASN1_F_PARSE_TAGGING            182
01119 #define ASN1_F_PKCS5_PBE2_SET           167
01120 #define ASN1_F_PKCS5_PBE_SET            202
01121 #define ASN1_F_X509_CINF_NEW            168
01122 #define ASN1_F_X509_CRL_ADD0_REVOKED          169
01123 #define ASN1_F_X509_INFO_NEW            170
01124 #define ASN1_F_X509_NAME_ENCODE            203
01125 #define ASN1_F_X509_NAME_EX_D2I            158
01126 #define ASN1_F_X509_NAME_EX_NEW            171
01127 #define ASN1_F_X509_NEW              172
01128 #define ASN1_F_X509_PKEY_NEW            173
01129 
01130 /* Reason codes. */
01131 #define ASN1_R_ADDING_OBJECT            171
01132 #define ASN1_R_AUX_ERROR             100
01133 #define ASN1_R_BAD_CLASS             101
01134 #define ASN1_R_BAD_OBJECT_HEADER        102
01135 #define ASN1_R_BAD_PASSWORD_READ        103
01136 #define ASN1_R_BAD_TAG               104
01137 #define ASN1_R_BN_LIB                105
01138 #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH        106
01139 #define ASN1_R_BUFFER_TOO_SMALL            107
01140 #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER      108
01141 #define ASN1_R_DATA_IS_WRONG            109
01142 #define ASN1_R_DECODE_ERROR             110
01143 #define ASN1_R_DECODING_ERROR           111
01144 #define ASN1_R_DEPTH_EXCEEDED           174
01145 #define ASN1_R_ENCODE_ERROR             112
01146 #define ASN1_R_ERROR_GETTING_TIME          173
01147 #define ASN1_R_ERROR_LOADING_SECTION          172
01148 #define ASN1_R_ERROR_PARSING_SET_ELEMENT      113
01149 #define ASN1_R_ERROR_SETTING_CIPHER_PARAMS       114
01150 #define ASN1_R_EXPECTING_AN_INTEGER        115
01151 #define ASN1_R_EXPECTING_AN_OBJECT         116
01152 #define ASN1_R_EXPECTING_A_BOOLEAN         117
01153 #define ASN1_R_EXPECTING_A_TIME            118
01154 #define ASN1_R_EXPLICIT_LENGTH_MISMATCH          119
01155 #define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED      120
01156 #define ASN1_R_FIELD_MISSING            121
01157 #define ASN1_R_FIRST_NUM_TOO_LARGE         122
01158 #define ASN1_R_HEADER_TOO_LONG             123
01159 #define ASN1_R_ILLEGAL_BITSTRING_FORMAT          175
01160 #define ASN1_R_ILLEGAL_BOOLEAN             176
01161 #define ASN1_R_ILLEGAL_CHARACTERS          124
01162 #define ASN1_R_ILLEGAL_FORMAT           177
01163 #define ASN1_R_ILLEGAL_HEX           178
01164 #define ASN1_R_ILLEGAL_IMPLICIT_TAG        179
01165 #define ASN1_R_ILLEGAL_INTEGER             180
01166 #define ASN1_R_ILLEGAL_NESTED_TAGGING         181
01167 #define ASN1_R_ILLEGAL_NULL             125
01168 #define ASN1_R_ILLEGAL_NULL_VALUE          182
01169 #define ASN1_R_ILLEGAL_OBJECT           183
01170 #define ASN1_R_ILLEGAL_OPTIONAL_ANY        126
01171 #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE     170
01172 #define ASN1_R_ILLEGAL_TAGGED_ANY          127
01173 #define ASN1_R_ILLEGAL_TIME_VALUE          184
01174 #define ASN1_R_INTEGER_NOT_ASCII_FORMAT          185
01175 #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG     128
01176 #define ASN1_R_INVALID_BMPSTRING_LENGTH          129
01177 #define ASN1_R_INVALID_DIGIT            130
01178 #define ASN1_R_INVALID_MODIFIER            186
01179 #define ASN1_R_INVALID_NUMBER           187
01180 #define ASN1_R_INVALID_SEPARATOR        131
01181 #define ASN1_R_INVALID_TIME_FORMAT         132
01182 #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH       133
01183 #define ASN1_R_INVALID_UTF8STRING          134
01184 #define ASN1_R_IV_TOO_LARGE             135
01185 #define ASN1_R_LENGTH_ERROR             136
01186 #define ASN1_R_LIST_ERROR            188
01187 #define ASN1_R_MISSING_EOC           137
01188 #define ASN1_R_MISSING_SECOND_NUMBER          138
01189 #define ASN1_R_MISSING_VALUE            189
01190 #define ASN1_R_MSTRING_NOT_UNIVERSAL          139
01191 #define ASN1_R_MSTRING_WRONG_TAG        140
01192 #define ASN1_R_NESTED_ASN1_STRING          197
01193 #define ASN1_R_NON_HEX_CHARACTERS          141
01194 #define ASN1_R_NOT_ASCII_FORMAT            190
01195 #define ASN1_R_NOT_ENOUGH_DATA             142
01196 #define ASN1_R_NO_MATCHING_CHOICE_TYPE        143
01197 #define ASN1_R_NULL_IS_WRONG_LENGTH        144
01198 #define ASN1_R_OBJECT_NOT_ASCII_FORMAT        191
01199 #define ASN1_R_ODD_NUMBER_OF_CHARS         145
01200 #define ASN1_R_PRIVATE_KEY_HEADER_MISSING     146
01201 #define ASN1_R_SECOND_NUMBER_TOO_LARGE        147
01202 #define ASN1_R_SEQUENCE_LENGTH_MISMATCH          148
01203 #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED          149
01204 #define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG      192
01205 #define ASN1_R_SHORT_LINE            150
01206 #define ASN1_R_STRING_TOO_LONG             151
01207 #define ASN1_R_STRING_TOO_SHORT            152
01208 #define ASN1_R_TAG_VALUE_TOO_HIGH          153
01209 #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
01210 #define ASN1_R_TIME_NOT_ASCII_FORMAT          193
01211 #define ASN1_R_TOO_LONG              155
01212 #define ASN1_R_TYPE_NOT_CONSTRUCTED        156
01213 #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY          157
01214 #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY     158
01215 #define ASN1_R_UNEXPECTED_EOC           159
01216 #define ASN1_R_UNKNOWN_FORMAT           160
01217 #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM     161
01218 #define ASN1_R_UNKNOWN_OBJECT_TYPE         162
01219 #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE        163
01220 #define ASN1_R_UNKNOWN_TAG           194
01221 #define ASN1_R_UNKOWN_FORMAT            195
01222 #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE      164
01223 #define ASN1_R_UNSUPPORTED_CIPHER          165
01224 #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM     166
01225 #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE       167
01226 #define ASN1_R_UNSUPPORTED_TYPE            196
01227 #define ASN1_R_WRONG_TAG             168
01228 #define ASN1_R_WRONG_TYPE            169
01229 
01230 #ifdef  __cplusplus
01231 }
01232 #endif
01233 #endif

Generated on Thu Aug 20 22:33:05 2009 for OpenXDAS by  doxygen 1.5.6