00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063 #ifndef HEADER_ASN1_H
00064 #define HEADER_ASN1_H
00065
00066 #if (defined(__SYMBIAN32__) && !defined(SYMBIAN))
00067 #define SYMBIAN
00068 #endif
00069
00070 #ifdef SYMBIAN
00071 #include <e32def.h>
00072 #endif
00073 #include <time.h>
00074 #include <openssl/e_os2.h>
00075 #ifndef OPENSSL_NO_BIO
00076 #include <openssl/bio.h>
00077 #endif
00078 #include <openssl/stack.h>
00079 #include <openssl/safestack.h>
00080
00081 #include <openssl/symhacks.h>
00082
00083 #include <openssl/ossl_typ.h>
00084 #ifndef OPENSSL_NO_DEPRECATED
00085 #include <openssl/bn.h>
00086 #endif
00087
00088 #ifdef OPENSSL_BUILD_SHLIBCRYPTO
00089 # undef OPENSSL_EXTERN
00090 # define OPENSSL_EXTERN OPENSSL_EXPORT
00091 #endif
00092
00093 #ifdef __cplusplus
00094 extern "C" {
00095 #endif
00096
00097 #define V_ASN1_UNIVERSAL 0x00
00098 #define V_ASN1_APPLICATION 0x40
00099 #define V_ASN1_CONTEXT_SPECIFIC 0x80
00100 #define V_ASN1_PRIVATE 0xc0
00101
00102 #define V_ASN1_CONSTRUCTED 0x20
00103 #define V_ASN1_PRIMITIVE_TAG 0x1f
00104 #define V_ASN1_PRIMATIVE_TAG 0x1f
00105
00106 #define V_ASN1_APP_CHOOSE -2
00107 #define V_ASN1_OTHER -3
00108 #define V_ASN1_ANY -4
00109
00110 #define V_ASN1_NEG 0x100
00111
00112 #define V_ASN1_UNDEF -1
00113 #define V_ASN1_EOC 0
00114 #define V_ASN1_BOOLEAN 1
00115 #define V_ASN1_INTEGER 2
00116 #define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
00117 #define V_ASN1_BIT_STRING 3
00118 #define V_ASN1_OCTET_STRING 4
00119 #define V_ASN1_NULL 5
00120 #define V_ASN1_OBJECT 6
00121 #define V_ASN1_OBJECT_DESCRIPTOR 7
00122 #define V_ASN1_EXTERNAL 8
00123 #define V_ASN1_REAL 9
00124 #define V_ASN1_ENUMERATED 10
00125 #define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
00126 #define V_ASN1_UTF8STRING 12
00127 #define V_ASN1_SEQUENCE 16
00128 #define V_ASN1_SET 17
00129 #define V_ASN1_NUMERICSTRING 18
00130 #define V_ASN1_PRINTABLESTRING 19
00131 #define V_ASN1_T61STRING 20
00132 #define V_ASN1_TELETEXSTRING 20
00133 #define V_ASN1_VIDEOTEXSTRING 21
00134 #define V_ASN1_IA5STRING 22
00135 #define V_ASN1_UTCTIME 23
00136 #define V_ASN1_GENERALIZEDTIME 24
00137 #define V_ASN1_GRAPHICSTRING 25
00138 #define V_ASN1_ISO64STRING 26
00139 #define V_ASN1_VISIBLESTRING 26
00140 #define V_ASN1_GENERALSTRING 27
00141 #define V_ASN1_UNIVERSALSTRING 28
00142 #define V_ASN1_BMPSTRING 30
00143
00144
00145 #define B_ASN1_NUMERICSTRING 0x0001
00146 #define B_ASN1_PRINTABLESTRING 0x0002
00147 #define B_ASN1_T61STRING 0x0004
00148 #define B_ASN1_TELETEXSTRING 0x0004
00149 #define B_ASN1_VIDEOTEXSTRING 0x0008
00150 #define B_ASN1_IA5STRING 0x0010
00151 #define B_ASN1_GRAPHICSTRING 0x0020
00152 #define B_ASN1_ISO64STRING 0x0040
00153 #define B_ASN1_VISIBLESTRING 0x0040
00154 #define B_ASN1_GENERALSTRING 0x0080
00155 #define B_ASN1_UNIVERSALSTRING 0x0100
00156 #define B_ASN1_OCTET_STRING 0x0200
00157 #define B_ASN1_BIT_STRING 0x0400
00158 #define B_ASN1_BMPSTRING 0x0800
00159 #define B_ASN1_UNKNOWN 0x1000
00160 #define B_ASN1_UTF8STRING 0x2000
00161 #define B_ASN1_UTCTIME 0x4000
00162 #define B_ASN1_GENERALIZEDTIME 0x8000
00163 #define B_ASN1_SEQUENCE 0x10000
00164
00165
00166 #define MBSTRING_FLAG 0x1000
00167 #define MBSTRING_UTF8 (MBSTRING_FLAG)
00168 #define MBSTRING_ASC (MBSTRING_FLAG|1)
00169 #define MBSTRING_BMP (MBSTRING_FLAG|2)
00170 #define MBSTRING_UNIV (MBSTRING_FLAG|4)
00171
00172 struct X509_algor_st;
00173
00174 #define DECLARE_ASN1_SET_OF(type)
00175 #define IMPLEMENT_ASN1_SET_OF(type)
00176
00177
00178
00179
00180
00181 typedef struct asn1_ctx_st
00182 {
00183 unsigned char *p;
00184 int eos;
00185 int error;
00186 int inf;
00187 int tag;
00188 int xclass;
00189 long slen;
00190 unsigned char *max;
00191 unsigned char *q;
00192 unsigned char **pp;
00193 int line;
00194 } ASN1_CTX;
00195
00196 typedef struct asn1_const_ctx_st
00197 {
00198 const unsigned char *p;
00199 int eos;
00200 int error;
00201 int inf;
00202 int tag;
00203 int xclass;
00204 long slen;
00205 const unsigned char *max;
00206 const unsigned char *q;
00207 const unsigned char **pp;
00208 int line;
00209 } ASN1_const_CTX;
00210
00211
00212
00213 #define ASN1_OBJECT_FLAG_DYNAMIC 0x01
00214 #define ASN1_OBJECT_FLAG_CRITICAL 0x02
00215 #define ASN1_OBJECT_FLAG_DYNAMIC_STRINGS 0x04
00216 #define ASN1_OBJECT_FLAG_DYNAMIC_DATA 0x08
00217 typedef struct asn1_object_st
00218 {
00219 const char *sn,*ln;
00220 int nid;
00221 int length;
00222 unsigned char *data;
00223 int flags;
00224 } ASN1_OBJECT;
00225
00226 #define ASN1_STRING_FLAG_BITS_LEFT 0x08
00227
00228
00229
00230
00231 #define ASN1_STRING_FLAG_NDEF 0x010
00232
00233 typedef struct asn1_string_st
00234 {
00235 int length;
00236 int type;
00237 unsigned char *data;
00238
00239
00240
00241
00242 long flags;
00243 } ASN1_STRING;
00244
00245
00246
00247
00248
00249
00250 typedef struct ASN1_ENCODING_st
00251 {
00252 unsigned char *enc;
00253 long len;
00254 int modified;
00255 } ASN1_ENCODING;
00256
00257
00258 #define ASN1_LONG_UNDEF 0x7fffffffL
00259
00260 #define STABLE_FLAGS_MALLOC 0x01
00261 #define STABLE_NO_MASK 0x02
00262 #define DIRSTRING_TYPE \
00263 (B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
00264 #define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
00265
00266 typedef struct asn1_string_table_st {
00267 int nid;
00268 long minsize;
00269 long maxsize;
00270 unsigned long mask;
00271 unsigned long flags;
00272 } ASN1_STRING_TABLE;
00273
00274 DECLARE_STACK_OF(ASN1_STRING_TABLE)
00275
00276
00277
00278 #define ub_name 32768
00279 #define ub_common_name 64
00280 #define ub_locality_name 128
00281 #define ub_state_name 128
00282 #define ub_organization_name 64
00283 #define ub_organization_unit_name 64
00284 #define ub_title 64
00285 #define ub_email_address 128
00286
00287
00288
00289
00290 typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
00291 typedef struct ASN1_ITEM_st ASN1_ITEM;
00292 typedef struct ASN1_TLC_st ASN1_TLC;
00293
00294 typedef struct ASN1_VALUE_st ASN1_VALUE;
00295
00296
00297
00298 #define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
00299
00300 #define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
00301 DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
00302
00303 #define DECLARE_ASN1_FUNCTIONS_name(type, name) \
00304 DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00305 DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
00306
00307 #define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
00308 DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00309 DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
00310
00311 #define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
00312 IMPORT_C type *d2i_##name(type **a, const unsigned char **in, long len); \
00313 IMPORT_C int i2d_##name(type *a, unsigned char **out); \
00314 DECLARE_ASN1_ITEM(itname)
00315
00316 #define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
00317 IMPORT_C type *d2i_##name(type **a, const unsigned char **in, long len); \
00318 IMPORT_C int i2d_##name(const type *a, unsigned char **out); \
00319 DECLARE_ASN1_ITEM(name)
00320
00321 #define DECLARE_ASN1_NDEF_FUNCTION(name) \
00322 IMPORT_C int i2d_##name##_NDEF(name *a, unsigned char **out);
00323
00324 #define DECLARE_ASN1_FUNCTIONS_const(name) \
00325 IMPORT_C name *name##_new(void); \
00326 IMPORT_C void name##_free(name *a);
00327
00328 #define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
00329 IMPORT_C type *name##_new(void); \
00330 IMPORT_C void name##_free(type *a);
00331
00332 #define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
00333 #define I2D_OF(type) int (*)(type *,unsigned char **)
00334 #define I2D_OF_const(type) int (*)(const type *,unsigned char **)
00335
00336 #define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
00337 #define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
00338 #define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
00339
00340 TYPEDEF_D2I2D_OF(void);
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373
00374
00375
00376
00377 #ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
00378
00379
00380 typedef const ASN1_ITEM ASN1_ITEM_EXP;
00381
00382
00383 #define ASN1_ITEM_ptr(iptr) (iptr)
00384
00385
00386 #define ASN1_ITEM_ref(iptr) (&(iptr##_it))
00387
00388 #define ASN1_ITEM_rptr(ref) (&(ref##_it))
00389
00390 #define DECLARE_ASN1_ITEM(name) \
00391 OPENSSL_EXTERN const ASN1_ITEM name##_it;
00392
00393 #else
00394
00395
00396
00397
00398
00399
00400 typedef const ASN1_ITEM * ASN1_ITEM_EXP(void);
00401
00402
00403 #define ASN1_ITEM_ptr(iptr) (iptr())
00404
00405
00406 #define ASN1_ITEM_ref(iptr) (iptr##_it)
00407
00408 #define ASN1_ITEM_rptr(ref) (ref##_it())
00409
00410 #define DECLARE_ASN1_ITEM(name) \
00411 IMPORT_C const ASN1_ITEM * name##_it(void);
00412
00413 #endif
00414
00415
00416
00417
00418
00419
00420
00421
00422 #define ASN1_STRFLGS_ESC_2253 1
00423 #define ASN1_STRFLGS_ESC_CTRL 2
00424 #define ASN1_STRFLGS_ESC_MSB 4
00425
00426
00427
00428
00429
00430
00431
00432 #define ASN1_STRFLGS_ESC_QUOTE 8
00433
00434
00435
00436
00437
00438 #define CHARTYPE_PRINTABLESTRING 0x10
00439
00440 #define CHARTYPE_FIRST_ESC_2253 0x20
00441
00442 #define CHARTYPE_LAST_ESC_2253 0x40
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452 #define ASN1_STRFLGS_UTF8_CONVERT 0x10
00453
00454
00455
00456
00457
00458
00459 #define ASN1_STRFLGS_IGNORE_TYPE 0x20
00460
00461
00462 #define ASN1_STRFLGS_SHOW_TYPE 0x40
00463
00464
00465
00466
00467
00468
00469
00470
00471
00472 #define ASN1_STRFLGS_DUMP_ALL 0x80
00473 #define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
00474
00475
00476
00477
00478
00479
00480 #define ASN1_STRFLGS_DUMP_DER 0x200
00481
00482
00483
00484
00485
00486
00487 #define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
00488 ASN1_STRFLGS_ESC_CTRL | \
00489 ASN1_STRFLGS_ESC_MSB | \
00490 ASN1_STRFLGS_UTF8_CONVERT | \
00491 ASN1_STRFLGS_DUMP_UNKNOWN | \
00492 ASN1_STRFLGS_DUMP_DER)
00493
00494 DECLARE_STACK_OF(ASN1_INTEGER)
00495 DECLARE_ASN1_SET_OF(ASN1_INTEGER)
00496
00497 DECLARE_STACK_OF(ASN1_GENERALSTRING)
00498
00499 typedef struct asn1_type_st
00500 {
00501 int type;
00502 union {
00503 char *ptr;
00504 ASN1_BOOLEAN boolean;
00505 ASN1_STRING * asn1_string;
00506 ASN1_OBJECT * object;
00507 ASN1_INTEGER * integer;
00508 ASN1_ENUMERATED * enumerated;
00509 ASN1_BIT_STRING * bit_string;
00510 ASN1_OCTET_STRING * octet_string;
00511 ASN1_PRINTABLESTRING * printablestring;
00512 ASN1_T61STRING * t61string;
00513 ASN1_IA5STRING * ia5string;
00514 ASN1_GENERALSTRING * generalstring;
00515 ASN1_BMPSTRING * bmpstring;
00516 ASN1_UNIVERSALSTRING * universalstring;
00517 ASN1_UTCTIME * utctime;
00518 ASN1_GENERALIZEDTIME * generalizedtime;
00519 ASN1_VISIBLESTRING * visiblestring;
00520 ASN1_UTF8STRING * utf8string;
00521
00522
00523 ASN1_STRING * set;
00524 ASN1_STRING * sequence;
00525 } value;
00526 } ASN1_TYPE;
00527
00528 DECLARE_STACK_OF(ASN1_TYPE)
00529 DECLARE_ASN1_SET_OF(ASN1_TYPE)
00530
00531 typedef struct asn1_method_st
00532 {
00533 i2d_of_void *i2d;
00534 d2i_of_void *d2i;
00535 void *(*create)(void);
00536 void (*destroy)(void *);
00537 } ASN1_METHOD;
00538
00539
00540 typedef struct asn1_header_st
00541 {
00542 ASN1_OCTET_STRING *header;
00543 void *data;
00544 ASN1_METHOD *meth;
00545 } ASN1_HEADER;
00546
00547
00548 typedef struct BIT_STRING_BITNAME_st {
00549 int bitnum;
00550 const char *lname;
00551 const char *sname;
00552 } BIT_STRING_BITNAME;
00553
00554
00555 #define M_ASN1_STRING_length(x) ((x)->length)
00556 #define M_ASN1_STRING_length_set(x, n) ((x)->length = (n))
00557 #define M_ASN1_STRING_type(x) ((x)->type)
00558 #define M_ASN1_STRING_data(x) ((x)->data)
00559
00560
00561 #define M_ASN1_BIT_STRING_new() (ASN1_BIT_STRING *)\
00562 ASN1_STRING_type_new(V_ASN1_BIT_STRING)
00563 #define M_ASN1_BIT_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00564 #define M_ASN1_BIT_STRING_dup(a) (ASN1_BIT_STRING *)\
00565 ASN1_STRING_dup((ASN1_STRING *)a)
00566 #define M_ASN1_BIT_STRING_cmp(a,b) ASN1_STRING_cmp(\
00567 (ASN1_STRING *)a,(ASN1_STRING *)b)
00568 #define M_ASN1_BIT_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
00569
00570 #define M_ASN1_INTEGER_new() (ASN1_INTEGER *)\
00571 ASN1_STRING_type_new(V_ASN1_INTEGER)
00572 #define M_ASN1_INTEGER_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00573 #define M_ASN1_INTEGER_dup(a) (ASN1_INTEGER *)ASN1_STRING_dup((ASN1_STRING *)a)
00574 #define M_ASN1_INTEGER_cmp(a,b) ASN1_STRING_cmp(\
00575 (ASN1_STRING *)a,(ASN1_STRING *)b)
00576
00577 #define M_ASN1_ENUMERATED_new() (ASN1_ENUMERATED *)\
00578 ASN1_STRING_type_new(V_ASN1_ENUMERATED)
00579 #define M_ASN1_ENUMERATED_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00580 #define M_ASN1_ENUMERATED_dup(a) (ASN1_ENUMERATED *)ASN1_STRING_dup((ASN1_STRING *)a)
00581 #define M_ASN1_ENUMERATED_cmp(a,b) ASN1_STRING_cmp(\
00582 (ASN1_STRING *)a,(ASN1_STRING *)b)
00583
00584 #define M_ASN1_OCTET_STRING_new() (ASN1_OCTET_STRING *)\
00585 ASN1_STRING_type_new(V_ASN1_OCTET_STRING)
00586 #define M_ASN1_OCTET_STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00587 #define M_ASN1_OCTET_STRING_dup(a) (ASN1_OCTET_STRING *)\
00588 ASN1_STRING_dup((ASN1_STRING *)a)
00589 #define M_ASN1_OCTET_STRING_cmp(a,b) ASN1_STRING_cmp(\
00590 (ASN1_STRING *)a,(ASN1_STRING *)b)
00591 #define M_ASN1_OCTET_STRING_set(a,b,c) ASN1_STRING_set((ASN1_STRING *)a,b,c)
00592 #define M_ASN1_OCTET_STRING_print(a,b) ASN1_STRING_print(a,(ASN1_STRING *)b)
00593 #define M_i2d_ASN1_OCTET_STRING(a,pp) \
00594 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_OCTET_STRING,\
00595 V_ASN1_UNIVERSAL)
00596
00597 #define B_ASN1_TIME \
00598 B_ASN1_UTCTIME | \
00599 B_ASN1_GENERALIZEDTIME
00600
00601 #define B_ASN1_PRINTABLE \
00602 B_ASN1_PRINTABLESTRING| \
00603 B_ASN1_T61STRING| \
00604 B_ASN1_IA5STRING| \
00605 B_ASN1_BIT_STRING| \
00606 B_ASN1_UNIVERSALSTRING|\
00607 B_ASN1_BMPSTRING|\
00608 B_ASN1_UTF8STRING|\
00609 B_ASN1_UNKNOWN
00610
00611 #define B_ASN1_DIRECTORYSTRING \
00612 B_ASN1_PRINTABLESTRING| \
00613 B_ASN1_TELETEXSTRING|\
00614 B_ASN1_BMPSTRING|\
00615 B_ASN1_UNIVERSALSTRING|\
00616 B_ASN1_UTF8STRING
00617
00618 #define B_ASN1_DISPLAYTEXT \
00619 B_ASN1_IA5STRING| \
00620 B_ASN1_VISIBLESTRING| \
00621 B_ASN1_BMPSTRING|\
00622 B_ASN1_UTF8STRING
00623
00624 #define M_ASN1_PRINTABLE_new() ASN1_STRING_type_new(V_ASN1_T61STRING)
00625 #define M_ASN1_PRINTABLE_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00626 #define M_i2d_ASN1_PRINTABLE(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00627 pp,a->type,V_ASN1_UNIVERSAL)
00628 #define M_d2i_ASN1_PRINTABLE(a,pp,l) \
00629 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00630 B_ASN1_PRINTABLE)
00631
00632 #define M_DIRECTORYSTRING_new() ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
00633 #define M_DIRECTORYSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00634 #define M_i2d_DIRECTORYSTRING(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00635 pp,a->type,V_ASN1_UNIVERSAL)
00636 #define M_d2i_DIRECTORYSTRING(a,pp,l) \
00637 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00638 B_ASN1_DIRECTORYSTRING)
00639
00640 #define M_DISPLAYTEXT_new() ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
00641 #define M_DISPLAYTEXT_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00642 #define M_i2d_DISPLAYTEXT(a,pp) i2d_ASN1_bytes((ASN1_STRING *)a,\
00643 pp,a->type,V_ASN1_UNIVERSAL)
00644 #define M_d2i_DISPLAYTEXT(a,pp,l) \
00645 d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l, \
00646 B_ASN1_DISPLAYTEXT)
00647
00648 #define M_ASN1_PRINTABLESTRING_new() (ASN1_PRINTABLESTRING *)\
00649 ASN1_STRING_type_new(V_ASN1_PRINTABLESTRING)
00650 #define M_ASN1_PRINTABLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00651 #define M_i2d_ASN1_PRINTABLESTRING(a,pp) \
00652 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_PRINTABLESTRING,\
00653 V_ASN1_UNIVERSAL)
00654 #define M_d2i_ASN1_PRINTABLESTRING(a,pp,l) \
00655 (ASN1_PRINTABLESTRING *)d2i_ASN1_type_bytes\
00656 ((ASN1_STRING **)a,pp,l,B_ASN1_PRINTABLESTRING)
00657
00658 #define M_ASN1_T61STRING_new() (ASN1_T61STRING *)\
00659 ASN1_STRING_type_new(V_ASN1_T61STRING)
00660 #define M_ASN1_T61STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00661 #define M_i2d_ASN1_T61STRING(a,pp) \
00662 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_T61STRING,\
00663 V_ASN1_UNIVERSAL)
00664 #define M_d2i_ASN1_T61STRING(a,pp,l) \
00665 (ASN1_T61STRING *)d2i_ASN1_type_bytes\
00666 ((ASN1_STRING **)a,pp,l,B_ASN1_T61STRING)
00667
00668 #define M_ASN1_IA5STRING_new() (ASN1_IA5STRING *)\
00669 ASN1_STRING_type_new(V_ASN1_IA5STRING)
00670 #define M_ASN1_IA5STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00671 #define M_ASN1_IA5STRING_dup(a) \
00672 (ASN1_IA5STRING *)ASN1_STRING_dup((ASN1_STRING *)a)
00673 #define M_i2d_ASN1_IA5STRING(a,pp) \
00674 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_IA5STRING,\
00675 V_ASN1_UNIVERSAL)
00676 #define M_d2i_ASN1_IA5STRING(a,pp,l) \
00677 (ASN1_IA5STRING *)d2i_ASN1_type_bytes((ASN1_STRING **)a,pp,l,\
00678 B_ASN1_IA5STRING)
00679
00680 #define M_ASN1_UTCTIME_new() (ASN1_UTCTIME *)\
00681 ASN1_STRING_type_new(V_ASN1_UTCTIME)
00682 #define M_ASN1_UTCTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00683 #define M_ASN1_UTCTIME_dup(a) (ASN1_UTCTIME *)ASN1_STRING_dup((ASN1_STRING *)a)
00684
00685 #define M_ASN1_GENERALIZEDTIME_new() (ASN1_GENERALIZEDTIME *)\
00686 ASN1_STRING_type_new(V_ASN1_GENERALIZEDTIME)
00687 #define M_ASN1_GENERALIZEDTIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00688 #define M_ASN1_GENERALIZEDTIME_dup(a) (ASN1_GENERALIZEDTIME *)ASN1_STRING_dup(\
00689 (ASN1_STRING *)a)
00690
00691 #define M_ASN1_TIME_new() (ASN1_TIME *)\
00692 ASN1_STRING_type_new(V_ASN1_UTCTIME)
00693 #define M_ASN1_TIME_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00694 #define M_ASN1_TIME_dup(a) (ASN1_TIME *)ASN1_STRING_dup((ASN1_STRING *)a)
00695
00696 #define M_ASN1_GENERALSTRING_new() (ASN1_GENERALSTRING *)\
00697 ASN1_STRING_type_new(V_ASN1_GENERALSTRING)
00698 #define M_ASN1_GENERALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00699 #define M_i2d_ASN1_GENERALSTRING(a,pp) \
00700 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_GENERALSTRING,\
00701 V_ASN1_UNIVERSAL)
00702 #define M_d2i_ASN1_GENERALSTRING(a,pp,l) \
00703 (ASN1_GENERALSTRING *)d2i_ASN1_type_bytes\
00704 ((ASN1_STRING **)a,pp,l,B_ASN1_GENERALSTRING)
00705
00706 #define M_ASN1_UNIVERSALSTRING_new() (ASN1_UNIVERSALSTRING *)\
00707 ASN1_STRING_type_new(V_ASN1_UNIVERSALSTRING)
00708 #define M_ASN1_UNIVERSALSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00709 #define M_i2d_ASN1_UNIVERSALSTRING(a,pp) \
00710 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UNIVERSALSTRING,\
00711 V_ASN1_UNIVERSAL)
00712 #define M_d2i_ASN1_UNIVERSALSTRING(a,pp,l) \
00713 (ASN1_UNIVERSALSTRING *)d2i_ASN1_type_bytes\
00714 ((ASN1_STRING **)a,pp,l,B_ASN1_UNIVERSALSTRING)
00715
00716 #define M_ASN1_BMPSTRING_new() (ASN1_BMPSTRING *)\
00717 ASN1_STRING_type_new(V_ASN1_BMPSTRING)
00718 #define M_ASN1_BMPSTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00719 #define M_i2d_ASN1_BMPSTRING(a,pp) \
00720 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_BMPSTRING,\
00721 V_ASN1_UNIVERSAL)
00722 #define M_d2i_ASN1_BMPSTRING(a,pp,l) \
00723 (ASN1_BMPSTRING *)d2i_ASN1_type_bytes\
00724 ((ASN1_STRING **)a,pp,l,B_ASN1_BMPSTRING)
00725
00726 #define M_ASN1_VISIBLESTRING_new() (ASN1_VISIBLESTRING *)\
00727 ASN1_STRING_type_new(V_ASN1_VISIBLESTRING)
00728 #define M_ASN1_VISIBLESTRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00729 #define M_i2d_ASN1_VISIBLESTRING(a,pp) \
00730 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_VISIBLESTRING,\
00731 V_ASN1_UNIVERSAL)
00732 #define M_d2i_ASN1_VISIBLESTRING(a,pp,l) \
00733 (ASN1_VISIBLESTRING *)d2i_ASN1_type_bytes\
00734 ((ASN1_STRING **)a,pp,l,B_ASN1_VISIBLESTRING)
00735
00736 #define M_ASN1_UTF8STRING_new() (ASN1_UTF8STRING *)\
00737 ASN1_STRING_type_new(V_ASN1_UTF8STRING)
00738 #define M_ASN1_UTF8STRING_free(a) ASN1_STRING_free((ASN1_STRING *)a)
00739 #define M_i2d_ASN1_UTF8STRING(a,pp) \
00740 i2d_ASN1_bytes((ASN1_STRING *)a,pp,V_ASN1_UTF8STRING,\
00741 V_ASN1_UNIVERSAL)
00742 #define M_d2i_ASN1_UTF8STRING(a,pp,l) \
00743 (ASN1_UTF8STRING *)d2i_ASN1_type_bytes\
00744 ((ASN1_STRING **)a,pp,l,B_ASN1_UTF8STRING)
00745
00746
00747 #define IS_SEQUENCE 0
00748 #define IS_SET 1
00749
00750 DECLARE_ASN1_FUNCTIONS_fname(ASN1_TYPE, ASN1_ANY, ASN1_TYPE)
00751
00752 IMPORT_C int ASN1_TYPE_get(ASN1_TYPE *a);
00753 IMPORT_C void ASN1_TYPE_set(ASN1_TYPE *a, int type, void *value);
00754
00755 IMPORT_C ASN1_OBJECT * ASN1_OBJECT_new(void );
00756 IMPORT_C void ASN1_OBJECT_free(ASN1_OBJECT *a);
00757 IMPORT_C int i2d_ASN1_OBJECT(ASN1_OBJECT *a,unsigned char **pp);
00758 IMPORT_C ASN1_OBJECT * c2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
00759 long length);
00760 IMPORT_C ASN1_OBJECT * d2i_ASN1_OBJECT(ASN1_OBJECT **a,const unsigned char **pp,
00761 long length);
00762
00763 DECLARE_ASN1_ITEM(ASN1_OBJECT)
00764
00765 DECLARE_STACK_OF(ASN1_OBJECT)
00766 DECLARE_ASN1_SET_OF(ASN1_OBJECT)
00767
00768 IMPORT_C ASN1_STRING * ASN1_STRING_new(void);
00769 IMPORT_C void ASN1_STRING_free(ASN1_STRING *a);
00770 IMPORT_C ASN1_STRING * ASN1_STRING_dup(ASN1_STRING *a);
00771 IMPORT_C ASN1_STRING * ASN1_STRING_type_new(int type );
00772 IMPORT_C int ASN1_STRING_cmp(ASN1_STRING *a, ASN1_STRING *b);
00773
00774
00775 IMPORT_C int ASN1_STRING_set(ASN1_STRING *str, const void *data, int len);
00776 IMPORT_C int ASN1_STRING_length(ASN1_STRING *x);
00777 IMPORT_C void ASN1_STRING_length_set(ASN1_STRING *x, int n);
00778 IMPORT_C int ASN1_STRING_type(ASN1_STRING *x);
00779 IMPORT_C unsigned char * ASN1_STRING_data(ASN1_STRING *x);
00780
00781 DECLARE_ASN1_FUNCTIONS(ASN1_BIT_STRING)
00782 IMPORT_C int i2c_ASN1_BIT_STRING(ASN1_BIT_STRING *a,unsigned char **pp);
00783 IMPORT_C ASN1_BIT_STRING *c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,const unsigned char **pp,
00784 long length);
00785 IMPORT_C int ASN1_BIT_STRING_set(ASN1_BIT_STRING *a, unsigned char *d,
00786 int length );
00787 IMPORT_C int ASN1_BIT_STRING_set_bit(ASN1_BIT_STRING *a, int n, int value);
00788 IMPORT_C int ASN1_BIT_STRING_get_bit(ASN1_BIT_STRING *a, int n);
00789
00790 #ifndef OPENSSL_NO_BIO
00791 IMPORT_C int ASN1_BIT_STRING_name_print(BIO *out, ASN1_BIT_STRING *bs,
00792 BIT_STRING_BITNAME *tbl, int indent);
00793 #endif
00794 IMPORT_C int ASN1_BIT_STRING_num_asc(char *name, BIT_STRING_BITNAME *tbl);
00795 IMPORT_C int ASN1_BIT_STRING_set_asc(ASN1_BIT_STRING *bs, char *name, int value,
00796 BIT_STRING_BITNAME *tbl);
00797
00798 IMPORT_C int i2d_ASN1_BOOLEAN(int a,unsigned char **pp);
00799 IMPORT_C int d2i_ASN1_BOOLEAN(int *a,const unsigned char **pp,long length);
00800
00801 DECLARE_ASN1_FUNCTIONS(ASN1_INTEGER)
00802 IMPORT_C int i2c_ASN1_INTEGER(ASN1_INTEGER *a,unsigned char **pp);
00803 IMPORT_C ASN1_INTEGER *c2i_ASN1_INTEGER(ASN1_INTEGER **a,const unsigned char **pp,
00804 long length);
00805 IMPORT_C ASN1_INTEGER *d2i_ASN1_UINTEGER(ASN1_INTEGER **a,const unsigned char **pp,
00806 long length);
00807 IMPORT_C ASN1_INTEGER * ASN1_INTEGER_dup(ASN1_INTEGER *x);
00808 IMPORT_C int ASN1_INTEGER_cmp(ASN1_INTEGER *x, ASN1_INTEGER *y);
00809
00810 DECLARE_ASN1_FUNCTIONS(ASN1_ENUMERATED)
00811
00812 IMPORT_C int ASN1_UTCTIME_check(ASN1_UTCTIME *a);
00813 IMPORT_C ASN1_UTCTIME *ASN1_UTCTIME_set(ASN1_UTCTIME *s,time_t t);
00814 IMPORT_C int ASN1_UTCTIME_set_string(ASN1_UTCTIME *s, const char *str);
00815 IMPORT_C int ASN1_UTCTIME_cmp_time_t(const ASN1_UTCTIME *s, time_t t);
00816 #if 0
00817 time_t ASN1_UTCTIME_get(const ASN1_UTCTIME *s);
00818 #endif
00819
00820 IMPORT_C int ASN1_GENERALIZEDTIME_check(ASN1_GENERALIZEDTIME *a);
00821 IMPORT_C ASN1_GENERALIZEDTIME *ASN1_GENERALIZEDTIME_set(ASN1_GENERALIZEDTIME *s,time_t t);
00822 IMPORT_C int ASN1_GENERALIZEDTIME_set_string(ASN1_GENERALIZEDTIME *s, const char *str);
00823
00824 DECLARE_ASN1_FUNCTIONS(ASN1_OCTET_STRING)
00825 IMPORT_C ASN1_OCTET_STRING * ASN1_OCTET_STRING_dup(ASN1_OCTET_STRING *a);
00826 IMPORT_C int ASN1_OCTET_STRING_cmp(ASN1_OCTET_STRING *a, ASN1_OCTET_STRING *b);
00827 IMPORT_C int ASN1_OCTET_STRING_set(ASN1_OCTET_STRING *str, const unsigned char *data, int len);
00828
00829 DECLARE_ASN1_FUNCTIONS(ASN1_VISIBLESTRING)
00830 DECLARE_ASN1_FUNCTIONS(ASN1_UNIVERSALSTRING)
00831 DECLARE_ASN1_FUNCTIONS(ASN1_UTF8STRING)
00832 DECLARE_ASN1_FUNCTIONS(ASN1_NULL)
00833 DECLARE_ASN1_FUNCTIONS(ASN1_BMPSTRING)
00834
00835 IMPORT_C int UTF8_getc(const unsigned char *str, int len, unsigned long *val);
00836 IMPORT_C int UTF8_putc(unsigned char *str, int len, unsigned long value);
00837
00838 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, ASN1_PRINTABLE)
00839
00840 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DIRECTORYSTRING)
00841 DECLARE_ASN1_FUNCTIONS_name(ASN1_STRING, DISPLAYTEXT)
00842 DECLARE_ASN1_FUNCTIONS(ASN1_PRINTABLESTRING)
00843 DECLARE_ASN1_FUNCTIONS(ASN1_T61STRING)
00844 DECLARE_ASN1_FUNCTIONS(ASN1_IA5STRING)
00845 DECLARE_ASN1_FUNCTIONS(ASN1_GENERALSTRING)
00846 DECLARE_ASN1_FUNCTIONS(ASN1_UTCTIME)
00847 DECLARE_ASN1_FUNCTIONS(ASN1_GENERALIZEDTIME)
00848 DECLARE_ASN1_FUNCTIONS(ASN1_TIME)
00849
00850 DECLARE_ASN1_ITEM(ASN1_OCTET_STRING_NDEF)
00851
00852 IMPORT_C ASN1_TIME *ASN1_TIME_set(ASN1_TIME *s,time_t t);
00853 IMPORT_C int ASN1_TIME_check(ASN1_TIME *t);
00854 IMPORT_C ASN1_GENERALIZEDTIME *ASN1_TIME_to_generalizedtime(ASN1_TIME *t, ASN1_GENERALIZEDTIME **out);
00855
00856 IMPORT_C int i2d_ASN1_SET(STACK *a, unsigned char **pp,
00857 i2d_of_void *i2d, int ex_tag, int ex_class, int is_set);
00858 IMPORT_C STACK * d2i_ASN1_SET(STACK **a, const unsigned char **pp, long length,
00859 d2i_of_void *d2i, void (*free_func)(void *),
00860 int ex_tag, int ex_class);
00861
00862 #ifndef OPENSSL_NO_BIO
00863 IMPORT_C int i2a_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *a);
00864 IMPORT_C int a2i_ASN1_INTEGER(BIO *bp,ASN1_INTEGER *bs,char *buf,int size);
00865 IMPORT_C int i2a_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *a);
00866 IMPORT_C int a2i_ASN1_ENUMERATED(BIO *bp,ASN1_ENUMERATED *bs,char *buf,int size);
00867 IMPORT_C int i2a_ASN1_OBJECT(BIO *bp,ASN1_OBJECT *a);
00868 IMPORT_C int a2i_ASN1_STRING(BIO *bp,ASN1_STRING *bs,char *buf,int size);
00869 IMPORT_C int i2a_ASN1_STRING(BIO *bp, ASN1_STRING *a, int type);
00870 #endif
00871 IMPORT_C int i2t_ASN1_OBJECT(char *buf,int buf_len,ASN1_OBJECT *a);
00872
00873 IMPORT_C int a2d_ASN1_OBJECT(unsigned char *out,int olen, const char *buf, int num);
00874 IMPORT_C ASN1_OBJECT *ASN1_OBJECT_create(int nid, unsigned char *data,int len,
00875 const char *sn, const char *ln);
00876
00877 IMPORT_C int ASN1_INTEGER_set(ASN1_INTEGER *a, long v);
00878 IMPORT_C long ASN1_INTEGER_get(ASN1_INTEGER *a);
00879 IMPORT_C ASN1_INTEGER *BN_to_ASN1_INTEGER(BIGNUM *bn, ASN1_INTEGER *ai);
00880 IMPORT_C BIGNUM *ASN1_INTEGER_to_BN(ASN1_INTEGER *ai,BIGNUM *bn);
00881
00882 IMPORT_C int ASN1_ENUMERATED_set(ASN1_ENUMERATED *a, long v);
00883 IMPORT_C long ASN1_ENUMERATED_get(ASN1_ENUMERATED *a);
00884 IMPORT_C ASN1_ENUMERATED *BN_to_ASN1_ENUMERATED(BIGNUM *bn, ASN1_ENUMERATED *ai);
00885 IMPORT_C BIGNUM *ASN1_ENUMERATED_to_BN(ASN1_ENUMERATED *ai,BIGNUM *bn);
00886
00887
00888
00889 IMPORT_C int ASN1_PRINTABLE_type(const unsigned char *s, int max);
00890
00891 IMPORT_C int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass);
00892 IMPORT_C ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp,
00893 long length, int Ptag, int Pclass);
00894 IMPORT_C unsigned long ASN1_tag2bit(int tag);
00895
00896 IMPORT_C ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a,const unsigned char **pp,
00897 long length,int type);
00898
00899
00900 IMPORT_C int asn1_Finish(ASN1_CTX *c);
00901 IMPORT_C int asn1_const_Finish(ASN1_const_CTX *c);
00902
00903
00904 IMPORT_C int ASN1_get_object(const unsigned char **pp, long *plength, int *ptag,
00905 int *pclass, long omax);
00906 IMPORT_C int ASN1_check_infinite_end(unsigned char **p,long len);
00907 IMPORT_C int ASN1_const_check_infinite_end(const unsigned char **p,long len);
00908 IMPORT_C void ASN1_put_object(unsigned char **pp, int constructed, int length,
00909 int tag, int xclass);
00910 IMPORT_C int ASN1_put_eoc(unsigned char **pp);
00911 IMPORT_C int ASN1_object_size(int constructed, int length, int tag);
00912
00913
00914 IMPORT_C void *ASN1_dup(i2d_of_void *i2d, d2i_of_void *d2i, char *x);
00915 #define ASN1_dup_of(type,i2d,d2i,x) \
00916 ((type *(*)(I2D_OF(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
00917 #define ASN1_dup_of_const(type,i2d,d2i,x) \
00918 ((type *(*)(I2D_OF_const(type),D2I_OF(type),type *))openssl_fcast(ASN1_dup))(i2d,d2i,x)
00919
00920 IMPORT_C void *ASN1_item_dup(const ASN1_ITEM *it, void *x);
00921
00922 #ifndef OPENSSL_NO_FP_API
00923 IMPORT_C void *ASN1_d2i_fp(void *(*xnew)(void), d2i_of_void *d2i, FILE *in, void **x);
00924 #define ASN1_d2i_fp_of(type,xnew,d2i,in,x) \
00925 ((type *(*)(type *(*)(void),D2I_OF(type),FILE *,type **))openssl_fcast(ASN1_d2i_fp))(xnew,d2i,in,x)
00926 void *ASN1_item_d2i_fp(const ASN1_ITEM *it, FILE *in, void *x);
00927 IMPORT_C int ASN1_i2d_fp(i2d_of_void *i2d,FILE *out,void *x);
00928 #define ASN1_i2d_fp_of(type,i2d,out,x) \
00929 ((int (*)(I2D_OF(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
00930 #define ASN1_i2d_fp_of_const(type,i2d,out,x) \
00931 ((int (*)(I2D_OF_const(type),FILE *,type *))openssl_fcast(ASN1_i2d_fp))(i2d,out,x)
00932 IMPORT_C int ASN1_item_i2d_fp(const ASN1_ITEM *it, FILE *out, void *x);
00933 IMPORT_C int ASN1_STRING_print_ex_fp(FILE *fp, ASN1_STRING *str, unsigned long flags);
00934 #endif
00935
00936 IMPORT_C int ASN1_STRING_to_UTF8(unsigned char **out, ASN1_STRING *in);
00937
00938 #ifndef OPENSSL_NO_BIO
00939 IMPORT_C void *ASN1_d2i_bio(void *(*xnew)(void), d2i_of_void *d2i, BIO *in, void **x);
00940 #define ASN1_d2i_bio_of(type,xnew,d2i,in,x) \
00941 ((type *(*)(type *(*)(void),D2I_OF(type),BIO *,type **))openssl_fcast(ASN1_d2i_bio))(xnew,d2i,in,x)
00942 void *ASN1_item_d2i_bio(const ASN1_ITEM *it, BIO *in, void *x);
00943 IMPORT_C int ASN1_i2d_bio(i2d_of_void *i2d,BIO *out, unsigned char *x);
00944 #define ASN1_i2d_bio_of(type,i2d,out,x) \
00945 ((int (*)(I2D_OF(type),BIO *,type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
00946 #define ASN1_i2d_bio_of_const(type,i2d,out,x) \
00947 ((int (*)(I2D_OF_const(type),BIO *,const type *))openssl_fcast(ASN1_i2d_bio))(i2d,out,x)
00948 IMPORT_C int ASN1_item_i2d_bio(const ASN1_ITEM *it, BIO *out, void *x);
00949 IMPORT_C int ASN1_UTCTIME_print(BIO *fp,ASN1_UTCTIME *a);
00950 IMPORT_C int ASN1_GENERALIZEDTIME_print(BIO *fp,ASN1_GENERALIZEDTIME *a);
00951 IMPORT_C int ASN1_TIME_print(BIO *fp,ASN1_TIME *a);
00952 IMPORT_C int ASN1_STRING_print(BIO *bp,ASN1_STRING *v);
00953 IMPORT_C int ASN1_STRING_print_ex(BIO *out, ASN1_STRING *str, unsigned long flags);
00954 IMPORT_C int ASN1_parse(BIO *bp,const unsigned char *pp,long len,int indent);
00955 IMPORT_C int ASN1_parse_dump(BIO *bp,const unsigned char *pp,long len,int indent,int dump);
00956 #endif
00957 IMPORT_C const char *ASN1_tag2str(int tag);
00958
00959
00960 IMPORT_C int i2d_ASN1_HEADER(ASN1_HEADER *a,unsigned char **pp);
00961 IMPORT_C ASN1_HEADER *d2i_ASN1_HEADER(ASN1_HEADER **a,const unsigned char **pp, long length);
00962 IMPORT_C ASN1_HEADER *ASN1_HEADER_new(void );
00963 IMPORT_C void ASN1_HEADER_free(ASN1_HEADER *a);
00964
00965 IMPORT_C int ASN1_UNIVERSALSTRING_to_string(ASN1_UNIVERSALSTRING *s);
00966
00967
00968 IMPORT_C ASN1_METHOD *X509_asn1_meth(void);
00969 IMPORT_C ASN1_METHOD *RSAPrivateKey_asn1_meth(void);
00970 IMPORT_C ASN1_METHOD *ASN1_IA5STRING_asn1_meth(void);
00971 IMPORT_C ASN1_METHOD *ASN1_BIT_STRING_asn1_meth(void);
00972
00973 IMPORT_C int ASN1_TYPE_set_octetstring(ASN1_TYPE *a,
00974 unsigned char *data, int len);
00975 IMPORT_C int ASN1_TYPE_get_octetstring(ASN1_TYPE *a,
00976 unsigned char *data, int max_len);
00977 IMPORT_C int ASN1_TYPE_set_int_octetstring(ASN1_TYPE *a, long num,
00978 unsigned char *data, int len);
00979 IMPORT_C int ASN1_TYPE_get_int_octetstring(ASN1_TYPE *a,long *num,
00980 unsigned char *data, int max_len);
00981
00982 IMPORT_C STACK *ASN1_seq_unpack(const unsigned char *buf, int len,
00983 d2i_of_void *d2i, void (*free_func)(void *));
00984 IMPORT_C unsigned char *ASN1_seq_pack(STACK *safes, i2d_of_void *i2d,
00985 unsigned char **buf, int *len );
00986 IMPORT_C void *ASN1_unpack_string(ASN1_STRING *oct, d2i_of_void *d2i);
00987 IMPORT_C void *ASN1_item_unpack(ASN1_STRING *oct, const ASN1_ITEM *it);
00988 IMPORT_C ASN1_STRING *ASN1_pack_string(void *obj, i2d_of_void *i2d,
00989 ASN1_OCTET_STRING **oct);
00990 #define ASN1_pack_string_of(type,obj,i2d,oct) \
00991 ((ASN1_STRING *(*)(type *,I2D_OF(type),ASN1_OCTET_STRING **))openssl_fcast(ASN1_pack_string))(obj,i2d,oct)
00992 IMPORT_C ASN1_STRING *ASN1_item_pack(void *obj, const ASN1_ITEM *it, ASN1_OCTET_STRING **oct);
00993
00994 IMPORT_C void ASN1_STRING_set_default_mask(unsigned long mask);
00995 IMPORT_C int ASN1_STRING_set_default_mask_asc(char *p);
00996 IMPORT_C unsigned long ASN1_STRING_get_default_mask(void);
00997 IMPORT_C int ASN1_mbstring_copy(ASN1_STRING **out, const unsigned char *in, int len,
00998 int inform, unsigned long mask);
00999 IMPORT_C int ASN1_mbstring_ncopy(ASN1_STRING **out, const unsigned char *in, int len,
01000 int inform, unsigned long mask,
01001 long minsize, long maxsize);
01002
01003 IMPORT_C ASN1_STRING *ASN1_STRING_set_by_NID(ASN1_STRING **out,
01004 const unsigned char *in, int inlen, int inform, int nid);
01005 IMPORT_C ASN1_STRING_TABLE *ASN1_STRING_TABLE_get(int nid);
01006 IMPORT_C int ASN1_STRING_TABLE_add(int, long, long, unsigned long, unsigned long);
01007 IMPORT_C void ASN1_STRING_TABLE_cleanup(void);
01008
01009
01010
01011
01012 IMPORT_C ASN1_VALUE *ASN1_item_new(const ASN1_ITEM *it);
01013 IMPORT_C void ASN1_item_free(ASN1_VALUE *val, const ASN1_ITEM *it);
01014 IMPORT_C ASN1_VALUE * ASN1_item_d2i(ASN1_VALUE **val, const unsigned char **in, long len, const ASN1_ITEM *it);
01015 IMPORT_C int ASN1_item_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
01016 IMPORT_C int ASN1_item_ndef_i2d(ASN1_VALUE *val, unsigned char **out, const ASN1_ITEM *it);
01017
01018 IMPORT_C void ASN1_add_oid_module(void);
01019
01020 IMPORT_C ASN1_TYPE *ASN1_generate_nconf(char *str, CONF *nconf);
01021 IMPORT_C ASN1_TYPE *ASN1_generate_v3(char *str, X509V3_CTX *cnf);
01022
01023
01024
01025
01026
01027 IMPORT_C void ERR_load_ASN1_strings(void);
01028
01029
01030
01031
01032 #define ASN1_F_A2D_ASN1_OBJECT 100
01033 #define ASN1_F_A2I_ASN1_ENUMERATED 101
01034 #define ASN1_F_A2I_ASN1_INTEGER 102
01035 #define ASN1_F_A2I_ASN1_STRING 103
01036 #define ASN1_F_APPEND_EXP 176
01037 #define ASN1_F_ASN1_BIT_STRING_SET_BIT 183
01038 #define ASN1_F_ASN1_CB 177
01039 #define ASN1_F_ASN1_CHECK_TLEN 104
01040 #define ASN1_F_ASN1_COLLATE_PRIMITIVE 105
01041 #define ASN1_F_ASN1_COLLECT 106
01042 #define ASN1_F_ASN1_D2I_EX_PRIMITIVE 108
01043 #define ASN1_F_ASN1_D2I_FP 109
01044 #define ASN1_F_ASN1_D2I_READ_BIO 107
01045 #define ASN1_F_ASN1_DIGEST 184
01046 #define ASN1_F_ASN1_DO_ADB 110
01047 #define ASN1_F_ASN1_DUP 111
01048 #define ASN1_F_ASN1_ENUMERATED_SET 112
01049 #define ASN1_F_ASN1_ENUMERATED_TO_BN 113
01050 #define ASN1_F_ASN1_EX_C2I 204
01051 #define ASN1_F_ASN1_FIND_END 190
01052 #define ASN1_F_ASN1_GENERALIZEDTIME_SET 185
01053 #define ASN1_F_ASN1_GENERATE_V3 178
01054 #define ASN1_F_ASN1_GET_OBJECT 114
01055 #define ASN1_F_ASN1_HEADER_NEW 115
01056 #define ASN1_F_ASN1_I2D_BIO 116
01057 #define ASN1_F_ASN1_I2D_FP 117
01058 #define ASN1_F_ASN1_INTEGER_SET 118
01059 #define ASN1_F_ASN1_INTEGER_TO_BN 119
01060 #define ASN1_F_ASN1_ITEM_D2I_FP 190
01061 #define ASN1_F_ASN1_ITEM_DUP 191
01062 #define ASN1_F_ASN1_ITEM_EX_COMBINE_NEW 121
01063 #define ASN1_F_ASN1_ITEM_EX_D2I 120
01064 #define ASN1_F_ASN1_ITEM_I2D_BIO 192
01065 #define ASN1_F_ASN1_ITEM_I2D_FP 193
01066 #define ASN1_F_ASN1_ITEM_PACK 198
01067 #define ASN1_F_ASN1_ITEM_SIGN 195
01068 #define ASN1_F_ASN1_ITEM_UNPACK 199
01069 #define ASN1_F_ASN1_ITEM_VERIFY 197
01070 #define ASN1_F_ASN1_MBSTRING_NCOPY 122
01071 #define ASN1_F_ASN1_OBJECT_NEW 123
01072 #define ASN1_F_ASN1_PACK_STRING 124
01073 #define ASN1_F_ASN1_PCTX_NEW 205
01074 #define ASN1_F_ASN1_PKCS5_PBE_SET 125
01075 #define ASN1_F_ASN1_SEQ_PACK 126
01076 #define ASN1_F_ASN1_SEQ_UNPACK 127
01077 #define ASN1_F_ASN1_SIGN 128
01078 #define ASN1_F_ASN1_STR2TYPE 179
01079 #define ASN1_F_ASN1_STRING_SET 186
01080 #define ASN1_F_ASN1_STRING_TABLE_ADD 129
01081 #define ASN1_F_ASN1_STRING_TYPE_NEW 130
01082 #define ASN1_F_ASN1_TEMPLATE_EX_D2I 132
01083 #define ASN1_F_ASN1_TEMPLATE_NEW 133
01084 #define ASN1_F_ASN1_TEMPLATE_NOEXP_D2I 131
01085 #define ASN1_F_ASN1_TIME_SET 175
01086 #define ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING 134
01087 #define ASN1_F_ASN1_TYPE_GET_OCTETSTRING 135
01088 #define ASN1_F_ASN1_UNPACK_STRING 136
01089 #define ASN1_F_ASN1_UTCTIME_SET 187
01090 #define ASN1_F_ASN1_VERIFY 137
01091 #define ASN1_F_BITSTR_CB 180
01092 #define ASN1_F_BN_TO_ASN1_ENUMERATED 138
01093 #define ASN1_F_BN_TO_ASN1_INTEGER 139
01094 #define ASN1_F_C2I_ASN1_BIT_STRING 189
01095 #define ASN1_F_C2I_ASN1_INTEGER 194
01096 #define ASN1_F_C2I_ASN1_OBJECT 196
01097 #define ASN1_F_COLLECT_DATA 140
01098 #define ASN1_F_D2I_ASN1_BIT_STRING 141
01099 #define ASN1_F_D2I_ASN1_BOOLEAN 142
01100 #define ASN1_F_D2I_ASN1_BYTES 143
01101 #define ASN1_F_D2I_ASN1_GENERALIZEDTIME 144
01102 #define ASN1_F_D2I_ASN1_HEADER 145
01103 #define ASN1_F_D2I_ASN1_INTEGER 146
01104 #define ASN1_F_D2I_ASN1_OBJECT 147
01105 #define ASN1_F_D2I_ASN1_SET 148
01106 #define ASN1_F_D2I_ASN1_TYPE_BYTES 149
01107 #define ASN1_F_D2I_ASN1_UINTEGER 150
01108 #define ASN1_F_D2I_ASN1_UTCTIME 151
01109 #define ASN1_F_D2I_NETSCAPE_RSA 152
01110 #define ASN1_F_D2I_NETSCAPE_RSA_2 153
01111 #define ASN1_F_D2I_PRIVATEKEY 154
01112 #define ASN1_F_D2I_PUBLICKEY 155
01113 #define ASN1_F_D2I_RSA_NET 200
01114 #define ASN1_F_D2I_RSA_NET_2 201
01115 #define ASN1_F_D2I_X509 156
01116 #define ASN1_F_D2I_X509_CINF 157
01117 #define ASN1_F_D2I_X509_PKEY 159
01118 #define ASN1_F_I2D_ASN1_SET 188
01119 #define ASN1_F_I2D_ASN1_TIME 160
01120 #define ASN1_F_I2D_DSA_PUBKEY 161
01121 #define ASN1_F_I2D_EC_PUBKEY 181
01122 #define ASN1_F_I2D_PRIVATEKEY 163
01123 #define ASN1_F_I2D_PUBLICKEY 164
01124 #define ASN1_F_I2D_RSA_NET 162
01125 #define ASN1_F_I2D_RSA_PUBKEY 165
01126 #define ASN1_F_LONG_C2I 166
01127 #define ASN1_F_OID_MODULE_INIT 174
01128 #define ASN1_F_PARSE_TAGGING 182
01129 #define ASN1_F_PKCS5_PBE2_SET 167
01130 #define ASN1_F_PKCS5_PBE_SET 202
01131 #define ASN1_F_X509_CINF_NEW 168
01132 #define ASN1_F_X509_CRL_ADD0_REVOKED 169
01133 #define ASN1_F_X509_INFO_NEW 170
01134 #define ASN1_F_X509_NAME_ENCODE 203
01135 #define ASN1_F_X509_NAME_EX_D2I 158
01136 #define ASN1_F_X509_NAME_EX_NEW 171
01137 #define ASN1_F_X509_NEW 172
01138 #define ASN1_F_X509_PKEY_NEW 173
01139
01140
01141 #define ASN1_R_ADDING_OBJECT 171
01142 #define ASN1_R_AUX_ERROR 100
01143 #define ASN1_R_BAD_CLASS 101
01144 #define ASN1_R_BAD_OBJECT_HEADER 102
01145 #define ASN1_R_BAD_PASSWORD_READ 103
01146 #define ASN1_R_BAD_TAG 104
01147 #define ASN1_R_BN_LIB 105
01148 #define ASN1_R_BOOLEAN_IS_WRONG_LENGTH 106
01149 #define ASN1_R_BUFFER_TOO_SMALL 107
01150 #define ASN1_R_CIPHER_HAS_NO_OBJECT_IDENTIFIER 108
01151 #define ASN1_R_DATA_IS_WRONG 109
01152 #define ASN1_R_DECODE_ERROR 110
01153 #define ASN1_R_DECODING_ERROR 111
01154 #define ASN1_R_DEPTH_EXCEEDED 174
01155 #define ASN1_R_ENCODE_ERROR 112
01156 #define ASN1_R_ERROR_GETTING_TIME 173
01157 #define ASN1_R_ERROR_LOADING_SECTION 172
01158 #define ASN1_R_ERROR_PARSING_SET_ELEMENT 113
01159 #define ASN1_R_ERROR_SETTING_CIPHER_PARAMS 114
01160 #define ASN1_R_EXPECTING_AN_INTEGER 115
01161 #define ASN1_R_EXPECTING_AN_OBJECT 116
01162 #define ASN1_R_EXPECTING_A_BOOLEAN 117
01163 #define ASN1_R_EXPECTING_A_TIME 118
01164 #define ASN1_R_EXPLICIT_LENGTH_MISMATCH 119
01165 #define ASN1_R_EXPLICIT_TAG_NOT_CONSTRUCTED 120
01166 #define ASN1_R_FIELD_MISSING 121
01167 #define ASN1_R_FIRST_NUM_TOO_LARGE 122
01168 #define ASN1_R_HEADER_TOO_LONG 123
01169 #define ASN1_R_ILLEGAL_BITSTRING_FORMAT 175
01170 #define ASN1_R_ILLEGAL_BOOLEAN 176
01171 #define ASN1_R_ILLEGAL_CHARACTERS 124
01172 #define ASN1_R_ILLEGAL_FORMAT 177
01173 #define ASN1_R_ILLEGAL_HEX 178
01174 #define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
01175 #define ASN1_R_ILLEGAL_INTEGER 180
01176 #define ASN1_R_ILLEGAL_NESTED_TAGGING 181
01177 #define ASN1_R_ILLEGAL_NULL 125
01178 #define ASN1_R_ILLEGAL_NULL_VALUE 182
01179 #define ASN1_R_ILLEGAL_OBJECT 183
01180 #define ASN1_R_ILLEGAL_OPTIONAL_ANY 126
01181 #define ASN1_R_ILLEGAL_OPTIONS_ON_ITEM_TEMPLATE 170
01182 #define ASN1_R_ILLEGAL_TAGGED_ANY 127
01183 #define ASN1_R_ILLEGAL_TIME_VALUE 184
01184 #define ASN1_R_INTEGER_NOT_ASCII_FORMAT 185
01185 #define ASN1_R_INTEGER_TOO_LARGE_FOR_LONG 128
01186 #define ASN1_R_INVALID_BMPSTRING_LENGTH 129
01187 #define ASN1_R_INVALID_DIGIT 130
01188 #define ASN1_R_INVALID_MODIFIER 186
01189 #define ASN1_R_INVALID_NUMBER 187
01190 #define ASN1_R_INVALID_SEPARATOR 131
01191 #define ASN1_R_INVALID_TIME_FORMAT 132
01192 #define ASN1_R_INVALID_UNIVERSALSTRING_LENGTH 133
01193 #define ASN1_R_INVALID_UTF8STRING 134
01194 #define ASN1_R_IV_TOO_LARGE 135
01195 #define ASN1_R_LENGTH_ERROR 136
01196 #define ASN1_R_LIST_ERROR 188
01197 #define ASN1_R_MISSING_EOC 137
01198 #define ASN1_R_MISSING_SECOND_NUMBER 138
01199 #define ASN1_R_MISSING_VALUE 189
01200 #define ASN1_R_MSTRING_NOT_UNIVERSAL 139
01201 #define ASN1_R_MSTRING_WRONG_TAG 140
01202 #define ASN1_R_NESTED_ASN1_STRING 197
01203 #define ASN1_R_NON_HEX_CHARACTERS 141
01204 #define ASN1_R_NOT_ASCII_FORMAT 190
01205 #define ASN1_R_NOT_ENOUGH_DATA 142
01206 #define ASN1_R_NO_MATCHING_CHOICE_TYPE 143
01207 #define ASN1_R_NULL_IS_WRONG_LENGTH 144
01208 #define ASN1_R_OBJECT_NOT_ASCII_FORMAT 191
01209 #define ASN1_R_ODD_NUMBER_OF_CHARS 145
01210 #define ASN1_R_PRIVATE_KEY_HEADER_MISSING 146
01211 #define ASN1_R_SECOND_NUMBER_TOO_LARGE 147
01212 #define ASN1_R_SEQUENCE_LENGTH_MISMATCH 148
01213 #define ASN1_R_SEQUENCE_NOT_CONSTRUCTED 149
01214 #define ASN1_R_SEQUENCE_OR_SET_NEEDS_CONFIG 192
01215 #define ASN1_R_SHORT_LINE 150
01216 #define ASN1_R_STRING_TOO_LONG 151
01217 #define ASN1_R_STRING_TOO_SHORT 152
01218 #define ASN1_R_TAG_VALUE_TOO_HIGH 153
01219 #define ASN1_R_THE_ASN1_OBJECT_IDENTIFIER_IS_NOT_KNOWN_FOR_THIS_MD 154
01220 #define ASN1_R_TIME_NOT_ASCII_FORMAT 193
01221 #define ASN1_R_TOO_LONG 155
01222 #define ASN1_R_TYPE_NOT_CONSTRUCTED 156
01223 #define ASN1_R_UNABLE_TO_DECODE_RSA_KEY 157
01224 #define ASN1_R_UNABLE_TO_DECODE_RSA_PRIVATE_KEY 158
01225 #define ASN1_R_UNEXPECTED_EOC 159
01226 #define ASN1_R_UNKNOWN_FORMAT 160
01227 #define ASN1_R_UNKNOWN_MESSAGE_DIGEST_ALGORITHM 161
01228 #define ASN1_R_UNKNOWN_OBJECT_TYPE 162
01229 #define ASN1_R_UNKNOWN_PUBLIC_KEY_TYPE 163
01230 #define ASN1_R_UNKNOWN_TAG 194
01231 #define ASN1_R_UNKOWN_FORMAT 195
01232 #define ASN1_R_UNSUPPORTED_ANY_DEFINED_BY_TYPE 164
01233 #define ASN1_R_UNSUPPORTED_CIPHER 165
01234 #define ASN1_R_UNSUPPORTED_ENCRYPTION_ALGORITHM 166
01235 #define ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE 167
01236 #define ASN1_R_UNSUPPORTED_TYPE 196
01237 #define ASN1_R_WRONG_TAG 168
01238 #define ASN1_R_WRONG_TYPE 169
01239
01240 #ifdef __cplusplus
01241 }
01242 #endif
01243 #endif