Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/openssl
File: asn1.h
/*
[0] Fix | Delete
* Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved.
[1] Fix | Delete
*
[2] Fix | Delete
* Licensed under the OpenSSL license (the "License"). You may not use
[3] Fix | Delete
* this file except in compliance with the License. You can obtain a copy
[4] Fix | Delete
* in the file LICENSE in the source distribution or at
[5] Fix | Delete
* https://www.openssl.org/source/license.html
[6] Fix | Delete
*/
[7] Fix | Delete
[8] Fix | Delete
#ifndef HEADER_ASN1_H
[9] Fix | Delete
# define HEADER_ASN1_H
[10] Fix | Delete
[11] Fix | Delete
# include <time.h>
[12] Fix | Delete
# include <openssl/e_os2.h>
[13] Fix | Delete
# include <openssl/opensslconf.h>
[14] Fix | Delete
# include <openssl/bio.h>
[15] Fix | Delete
# include <openssl/safestack.h>
[16] Fix | Delete
# include <openssl/asn1err.h>
[17] Fix | Delete
# include <openssl/symhacks.h>
[18] Fix | Delete
[19] Fix | Delete
# include <openssl/ossl_typ.h>
[20] Fix | Delete
# if OPENSSL_API_COMPAT < 0x10100000L
[21] Fix | Delete
# include <openssl/bn.h>
[22] Fix | Delete
# endif
[23] Fix | Delete
[24] Fix | Delete
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
[25] Fix | Delete
# undef OPENSSL_EXTERN
[26] Fix | Delete
# define OPENSSL_EXTERN OPENSSL_EXPORT
[27] Fix | Delete
# endif
[28] Fix | Delete
[29] Fix | Delete
#ifdef __cplusplus
[30] Fix | Delete
extern "C" {
[31] Fix | Delete
#endif
[32] Fix | Delete
[33] Fix | Delete
# define V_ASN1_UNIVERSAL 0x00
[34] Fix | Delete
# define V_ASN1_APPLICATION 0x40
[35] Fix | Delete
# define V_ASN1_CONTEXT_SPECIFIC 0x80
[36] Fix | Delete
# define V_ASN1_PRIVATE 0xc0
[37] Fix | Delete
[38] Fix | Delete
# define V_ASN1_CONSTRUCTED 0x20
[39] Fix | Delete
# define V_ASN1_PRIMITIVE_TAG 0x1f
[40] Fix | Delete
# define V_ASN1_PRIMATIVE_TAG /*compat*/ V_ASN1_PRIMITIVE_TAG
[41] Fix | Delete
[42] Fix | Delete
# define V_ASN1_APP_CHOOSE -2/* let the recipient choose */
[43] Fix | Delete
# define V_ASN1_OTHER -3/* used in ASN1_TYPE */
[44] Fix | Delete
# define V_ASN1_ANY -4/* used in ASN1 template code */
[45] Fix | Delete
[46] Fix | Delete
# define V_ASN1_UNDEF -1
[47] Fix | Delete
/* ASN.1 tag values */
[48] Fix | Delete
# define V_ASN1_EOC 0
[49] Fix | Delete
# define V_ASN1_BOOLEAN 1 /**/
[50] Fix | Delete
# define V_ASN1_INTEGER 2
[51] Fix | Delete
# define V_ASN1_BIT_STRING 3
[52] Fix | Delete
# define V_ASN1_OCTET_STRING 4
[53] Fix | Delete
# define V_ASN1_NULL 5
[54] Fix | Delete
# define V_ASN1_OBJECT 6
[55] Fix | Delete
# define V_ASN1_OBJECT_DESCRIPTOR 7
[56] Fix | Delete
# define V_ASN1_EXTERNAL 8
[57] Fix | Delete
# define V_ASN1_REAL 9
[58] Fix | Delete
# define V_ASN1_ENUMERATED 10
[59] Fix | Delete
# define V_ASN1_UTF8STRING 12
[60] Fix | Delete
# define V_ASN1_SEQUENCE 16
[61] Fix | Delete
# define V_ASN1_SET 17
[62] Fix | Delete
# define V_ASN1_NUMERICSTRING 18 /**/
[63] Fix | Delete
# define V_ASN1_PRINTABLESTRING 19
[64] Fix | Delete
# define V_ASN1_T61STRING 20
[65] Fix | Delete
# define V_ASN1_TELETEXSTRING 20/* alias */
[66] Fix | Delete
# define V_ASN1_VIDEOTEXSTRING 21 /**/
[67] Fix | Delete
# define V_ASN1_IA5STRING 22
[68] Fix | Delete
# define V_ASN1_UTCTIME 23
[69] Fix | Delete
# define V_ASN1_GENERALIZEDTIME 24 /**/
[70] Fix | Delete
# define V_ASN1_GRAPHICSTRING 25 /**/
[71] Fix | Delete
# define V_ASN1_ISO64STRING 26 /**/
[72] Fix | Delete
# define V_ASN1_VISIBLESTRING 26/* alias */
[73] Fix | Delete
# define V_ASN1_GENERALSTRING 27 /**/
[74] Fix | Delete
# define V_ASN1_UNIVERSALSTRING 28 /**/
[75] Fix | Delete
# define V_ASN1_BMPSTRING 30
[76] Fix | Delete
[77] Fix | Delete
/*
[78] Fix | Delete
* NB the constants below are used internally by ASN1_INTEGER
[79] Fix | Delete
* and ASN1_ENUMERATED to indicate the sign. They are *not* on
[80] Fix | Delete
* the wire tag values.
[81] Fix | Delete
*/
[82] Fix | Delete
[83] Fix | Delete
# define V_ASN1_NEG 0x100
[84] Fix | Delete
# define V_ASN1_NEG_INTEGER (2 | V_ASN1_NEG)
[85] Fix | Delete
# define V_ASN1_NEG_ENUMERATED (10 | V_ASN1_NEG)
[86] Fix | Delete
[87] Fix | Delete
/* For use with d2i_ASN1_type_bytes() */
[88] Fix | Delete
# define B_ASN1_NUMERICSTRING 0x0001
[89] Fix | Delete
# define B_ASN1_PRINTABLESTRING 0x0002
[90] Fix | Delete
# define B_ASN1_T61STRING 0x0004
[91] Fix | Delete
# define B_ASN1_TELETEXSTRING 0x0004
[92] Fix | Delete
# define B_ASN1_VIDEOTEXSTRING 0x0008
[93] Fix | Delete
# define B_ASN1_IA5STRING 0x0010
[94] Fix | Delete
# define B_ASN1_GRAPHICSTRING 0x0020
[95] Fix | Delete
# define B_ASN1_ISO64STRING 0x0040
[96] Fix | Delete
# define B_ASN1_VISIBLESTRING 0x0040
[97] Fix | Delete
# define B_ASN1_GENERALSTRING 0x0080
[98] Fix | Delete
# define B_ASN1_UNIVERSALSTRING 0x0100
[99] Fix | Delete
# define B_ASN1_OCTET_STRING 0x0200
[100] Fix | Delete
# define B_ASN1_BIT_STRING 0x0400
[101] Fix | Delete
# define B_ASN1_BMPSTRING 0x0800
[102] Fix | Delete
# define B_ASN1_UNKNOWN 0x1000
[103] Fix | Delete
# define B_ASN1_UTF8STRING 0x2000
[104] Fix | Delete
# define B_ASN1_UTCTIME 0x4000
[105] Fix | Delete
# define B_ASN1_GENERALIZEDTIME 0x8000
[106] Fix | Delete
# define B_ASN1_SEQUENCE 0x10000
[107] Fix | Delete
/* For use with ASN1_mbstring_copy() */
[108] Fix | Delete
# define MBSTRING_FLAG 0x1000
[109] Fix | Delete
# define MBSTRING_UTF8 (MBSTRING_FLAG)
[110] Fix | Delete
# define MBSTRING_ASC (MBSTRING_FLAG|1)
[111] Fix | Delete
# define MBSTRING_BMP (MBSTRING_FLAG|2)
[112] Fix | Delete
# define MBSTRING_UNIV (MBSTRING_FLAG|4)
[113] Fix | Delete
# define SMIME_OLDMIME 0x400
[114] Fix | Delete
# define SMIME_CRLFEOL 0x800
[115] Fix | Delete
# define SMIME_STREAM 0x1000
[116] Fix | Delete
struct X509_algor_st;
[117] Fix | Delete
DEFINE_STACK_OF(X509_ALGOR)
[118] Fix | Delete
[119] Fix | Delete
# define ASN1_STRING_FLAG_BITS_LEFT 0x08/* Set if 0x07 has bits left value */
[120] Fix | Delete
/*
[121] Fix | Delete
* This indicates that the ASN1_STRING is not a real value but just a place
[122] Fix | Delete
* holder for the location where indefinite length constructed data should be
[123] Fix | Delete
* inserted in the memory buffer
[124] Fix | Delete
*/
[125] Fix | Delete
# define ASN1_STRING_FLAG_NDEF 0x010
[126] Fix | Delete
[127] Fix | Delete
/*
[128] Fix | Delete
* This flag is used by the CMS code to indicate that a string is not
[129] Fix | Delete
* complete and is a place holder for content when it had all been accessed.
[130] Fix | Delete
* The flag will be reset when content has been written to it.
[131] Fix | Delete
*/
[132] Fix | Delete
[133] Fix | Delete
# define ASN1_STRING_FLAG_CONT 0x020
[134] Fix | Delete
/*
[135] Fix | Delete
* This flag is used by ASN1 code to indicate an ASN1_STRING is an MSTRING
[136] Fix | Delete
* type.
[137] Fix | Delete
*/
[138] Fix | Delete
# define ASN1_STRING_FLAG_MSTRING 0x040
[139] Fix | Delete
/* String is embedded and only content should be freed */
[140] Fix | Delete
# define ASN1_STRING_FLAG_EMBED 0x080
[141] Fix | Delete
/* String should be parsed in RFC 5280's time format */
[142] Fix | Delete
# define ASN1_STRING_FLAG_X509_TIME 0x100
[143] Fix | Delete
/* This is the base type that holds just about everything :-) */
[144] Fix | Delete
struct asn1_string_st {
[145] Fix | Delete
int length;
[146] Fix | Delete
int type;
[147] Fix | Delete
unsigned char *data;
[148] Fix | Delete
/*
[149] Fix | Delete
* The value of the following field depends on the type being held. It
[150] Fix | Delete
* is mostly being used for BIT_STRING so if the input data has a
[151] Fix | Delete
* non-zero 'unused bits' value, it will be handled correctly
[152] Fix | Delete
*/
[153] Fix | Delete
long flags;
[154] Fix | Delete
};
[155] Fix | Delete
[156] Fix | Delete
/*
[157] Fix | Delete
* ASN1_ENCODING structure: this is used to save the received encoding of an
[158] Fix | Delete
* ASN1 type. This is useful to get round problems with invalid encodings
[159] Fix | Delete
* which can break signatures.
[160] Fix | Delete
*/
[161] Fix | Delete
[162] Fix | Delete
typedef struct ASN1_ENCODING_st {
[163] Fix | Delete
unsigned char *enc; /* DER encoding */
[164] Fix | Delete
long len; /* Length of encoding */
[165] Fix | Delete
int modified; /* set to 1 if 'enc' is invalid */
[166] Fix | Delete
} ASN1_ENCODING;
[167] Fix | Delete
[168] Fix | Delete
/* Used with ASN1 LONG type: if a long is set to this it is omitted */
[169] Fix | Delete
# define ASN1_LONG_UNDEF 0x7fffffffL
[170] Fix | Delete
[171] Fix | Delete
# define STABLE_FLAGS_MALLOC 0x01
[172] Fix | Delete
/*
[173] Fix | Delete
* A zero passed to ASN1_STRING_TABLE_new_add for the flags is interpreted
[174] Fix | Delete
* as "don't change" and STABLE_FLAGS_MALLOC is always set. By setting
[175] Fix | Delete
* STABLE_FLAGS_MALLOC only we can clear the existing value. Use the alias
[176] Fix | Delete
* STABLE_FLAGS_CLEAR to reflect this.
[177] Fix | Delete
*/
[178] Fix | Delete
# define STABLE_FLAGS_CLEAR STABLE_FLAGS_MALLOC
[179] Fix | Delete
# define STABLE_NO_MASK 0x02
[180] Fix | Delete
# define DIRSTRING_TYPE \
[181] Fix | Delete
(B_ASN1_PRINTABLESTRING|B_ASN1_T61STRING|B_ASN1_BMPSTRING|B_ASN1_UTF8STRING)
[182] Fix | Delete
# define PKCS9STRING_TYPE (DIRSTRING_TYPE|B_ASN1_IA5STRING)
[183] Fix | Delete
[184] Fix | Delete
typedef struct asn1_string_table_st {
[185] Fix | Delete
int nid;
[186] Fix | Delete
long minsize;
[187] Fix | Delete
long maxsize;
[188] Fix | Delete
unsigned long mask;
[189] Fix | Delete
unsigned long flags;
[190] Fix | Delete
} ASN1_STRING_TABLE;
[191] Fix | Delete
[192] Fix | Delete
DEFINE_STACK_OF(ASN1_STRING_TABLE)
[193] Fix | Delete
[194] Fix | Delete
/* size limits: this stuff is taken straight from RFC2459 */
[195] Fix | Delete
[196] Fix | Delete
# define ub_name 32768
[197] Fix | Delete
# define ub_common_name 64
[198] Fix | Delete
# define ub_locality_name 128
[199] Fix | Delete
# define ub_state_name 128
[200] Fix | Delete
# define ub_organization_name 64
[201] Fix | Delete
# define ub_organization_unit_name 64
[202] Fix | Delete
# define ub_title 64
[203] Fix | Delete
# define ub_email_address 128
[204] Fix | Delete
[205] Fix | Delete
/*
[206] Fix | Delete
* Declarations for template structures: for full definitions see asn1t.h
[207] Fix | Delete
*/
[208] Fix | Delete
typedef struct ASN1_TEMPLATE_st ASN1_TEMPLATE;
[209] Fix | Delete
typedef struct ASN1_TLC_st ASN1_TLC;
[210] Fix | Delete
/* This is just an opaque pointer */
[211] Fix | Delete
typedef struct ASN1_VALUE_st ASN1_VALUE;
[212] Fix | Delete
[213] Fix | Delete
/* Declare ASN1 functions: the implement macro in in asn1t.h */
[214] Fix | Delete
[215] Fix | Delete
# define DECLARE_ASN1_FUNCTIONS(type) DECLARE_ASN1_FUNCTIONS_name(type, type)
[216] Fix | Delete
[217] Fix | Delete
# define DECLARE_ASN1_ALLOC_FUNCTIONS(type) \
[218] Fix | Delete
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, type)
[219] Fix | Delete
[220] Fix | Delete
# define DECLARE_ASN1_FUNCTIONS_name(type, name) \
[221] Fix | Delete
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
[222] Fix | Delete
DECLARE_ASN1_ENCODE_FUNCTIONS(type, name, name)
[223] Fix | Delete
[224] Fix | Delete
# define DECLARE_ASN1_FUNCTIONS_fname(type, itname, name) \
[225] Fix | Delete
DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
[226] Fix | Delete
DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name)
[227] Fix | Delete
[228] Fix | Delete
# define DECLARE_ASN1_ENCODE_FUNCTIONS(type, itname, name) \
[229] Fix | Delete
type *d2i_##name(type **a, const unsigned char **in, long len); \
[230] Fix | Delete
int i2d_##name(type *a, unsigned char **out); \
[231] Fix | Delete
DECLARE_ASN1_ITEM(itname)
[232] Fix | Delete
[233] Fix | Delete
# define DECLARE_ASN1_ENCODE_FUNCTIONS_const(type, name) \
[234] Fix | Delete
type *d2i_##name(type **a, const unsigned char **in, long len); \
[235] Fix | Delete
int i2d_##name(const type *a, unsigned char **out); \
[236] Fix | Delete
DECLARE_ASN1_ITEM(name)
[237] Fix | Delete
[238] Fix | Delete
# define DECLARE_ASN1_NDEF_FUNCTION(name) \
[239] Fix | Delete
int i2d_##name##_NDEF(name *a, unsigned char **out);
[240] Fix | Delete
[241] Fix | Delete
# define DECLARE_ASN1_FUNCTIONS_const(name) \
[242] Fix | Delete
DECLARE_ASN1_ALLOC_FUNCTIONS(name) \
[243] Fix | Delete
DECLARE_ASN1_ENCODE_FUNCTIONS_const(name, name)
[244] Fix | Delete
[245] Fix | Delete
# define DECLARE_ASN1_ALLOC_FUNCTIONS_name(type, name) \
[246] Fix | Delete
type *name##_new(void); \
[247] Fix | Delete
void name##_free(type *a);
[248] Fix | Delete
[249] Fix | Delete
# define DECLARE_ASN1_PRINT_FUNCTION(stname) \
[250] Fix | Delete
DECLARE_ASN1_PRINT_FUNCTION_fname(stname, stname)
[251] Fix | Delete
[252] Fix | Delete
# define DECLARE_ASN1_PRINT_FUNCTION_fname(stname, fname) \
[253] Fix | Delete
int fname##_print_ctx(BIO *out, stname *x, int indent, \
[254] Fix | Delete
const ASN1_PCTX *pctx);
[255] Fix | Delete
[256] Fix | Delete
# define D2I_OF(type) type *(*)(type **,const unsigned char **,long)
[257] Fix | Delete
# define I2D_OF(type) int (*)(type *,unsigned char **)
[258] Fix | Delete
# define I2D_OF_const(type) int (*)(const type *,unsigned char **)
[259] Fix | Delete
[260] Fix | Delete
# define CHECKED_D2I_OF(type, d2i) \
[261] Fix | Delete
((d2i_of_void*) (1 ? d2i : ((D2I_OF(type))0)))
[262] Fix | Delete
# define CHECKED_I2D_OF(type, i2d) \
[263] Fix | Delete
((i2d_of_void*) (1 ? i2d : ((I2D_OF(type))0)))
[264] Fix | Delete
# define CHECKED_NEW_OF(type, xnew) \
[265] Fix | Delete
((void *(*)(void)) (1 ? xnew : ((type *(*)(void))0)))
[266] Fix | Delete
# define CHECKED_PTR_OF(type, p) \
[267] Fix | Delete
((void*) (1 ? p : (type*)0))
[268] Fix | Delete
# define CHECKED_PPTR_OF(type, p) \
[269] Fix | Delete
((void**) (1 ? p : (type**)0))
[270] Fix | Delete
[271] Fix | Delete
# define TYPEDEF_D2I_OF(type) typedef type *d2i_of_##type(type **,const unsigned char **,long)
[272] Fix | Delete
# define TYPEDEF_I2D_OF(type) typedef int i2d_of_##type(type *,unsigned char **)
[273] Fix | Delete
# define TYPEDEF_D2I2D_OF(type) TYPEDEF_D2I_OF(type); TYPEDEF_I2D_OF(type)
[274] Fix | Delete
[275] Fix | Delete
TYPEDEF_D2I2D_OF(void);
[276] Fix | Delete
[277] Fix | Delete
/*-
[278] Fix | Delete
* The following macros and typedefs allow an ASN1_ITEM
[279] Fix | Delete
* to be embedded in a structure and referenced. Since
[280] Fix | Delete
* the ASN1_ITEM pointers need to be globally accessible
[281] Fix | Delete
* (possibly from shared libraries) they may exist in
[282] Fix | Delete
* different forms. On platforms that support it the
[283] Fix | Delete
* ASN1_ITEM structure itself will be globally exported.
[284] Fix | Delete
* Other platforms will export a function that returns
[285] Fix | Delete
* an ASN1_ITEM pointer.
[286] Fix | Delete
*
[287] Fix | Delete
* To handle both cases transparently the macros below
[288] Fix | Delete
* should be used instead of hard coding an ASN1_ITEM
[289] Fix | Delete
* pointer in a structure.
[290] Fix | Delete
*
[291] Fix | Delete
* The structure will look like this:
[292] Fix | Delete
*
[293] Fix | Delete
* typedef struct SOMETHING_st {
[294] Fix | Delete
* ...
[295] Fix | Delete
* ASN1_ITEM_EXP *iptr;
[296] Fix | Delete
* ...
[297] Fix | Delete
* } SOMETHING;
[298] Fix | Delete
*
[299] Fix | Delete
* It would be initialised as e.g.:
[300] Fix | Delete
*
[301] Fix | Delete
* SOMETHING somevar = {...,ASN1_ITEM_ref(X509),...};
[302] Fix | Delete
*
[303] Fix | Delete
* and the actual pointer extracted with:
[304] Fix | Delete
*
[305] Fix | Delete
* const ASN1_ITEM *it = ASN1_ITEM_ptr(somevar.iptr);
[306] Fix | Delete
*
[307] Fix | Delete
* Finally an ASN1_ITEM pointer can be extracted from an
[308] Fix | Delete
* appropriate reference with: ASN1_ITEM_rptr(X509). This
[309] Fix | Delete
* would be used when a function takes an ASN1_ITEM * argument.
[310] Fix | Delete
*
[311] Fix | Delete
*/
[312] Fix | Delete
[313] Fix | Delete
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
[314] Fix | Delete
[315] Fix | Delete
/* ASN1_ITEM pointer exported type */
[316] Fix | Delete
typedef const ASN1_ITEM ASN1_ITEM_EXP;
[317] Fix | Delete
[318] Fix | Delete
/* Macro to obtain ASN1_ITEM pointer from exported type */
[319] Fix | Delete
# define ASN1_ITEM_ptr(iptr) (iptr)
[320] Fix | Delete
[321] Fix | Delete
/* Macro to include ASN1_ITEM pointer from base type */
[322] Fix | Delete
# define ASN1_ITEM_ref(iptr) (&(iptr##_it))
[323] Fix | Delete
[324] Fix | Delete
# define ASN1_ITEM_rptr(ref) (&(ref##_it))
[325] Fix | Delete
[326] Fix | Delete
# define DECLARE_ASN1_ITEM(name) \
[327] Fix | Delete
OPENSSL_EXTERN const ASN1_ITEM name##_it;
[328] Fix | Delete
[329] Fix | Delete
# else
[330] Fix | Delete
[331] Fix | Delete
/*
[332] Fix | Delete
* Platforms that can't easily handle shared global variables are declared as
[333] Fix | Delete
* functions returning ASN1_ITEM pointers.
[334] Fix | Delete
*/
[335] Fix | Delete
[336] Fix | Delete
/* ASN1_ITEM pointer exported type */
[337] Fix | Delete
typedef const ASN1_ITEM *ASN1_ITEM_EXP (void);
[338] Fix | Delete
[339] Fix | Delete
/* Macro to obtain ASN1_ITEM pointer from exported type */
[340] Fix | Delete
# define ASN1_ITEM_ptr(iptr) (iptr())
[341] Fix | Delete
[342] Fix | Delete
/* Macro to include ASN1_ITEM pointer from base type */
[343] Fix | Delete
# define ASN1_ITEM_ref(iptr) (iptr##_it)
[344] Fix | Delete
[345] Fix | Delete
# define ASN1_ITEM_rptr(ref) (ref##_it())
[346] Fix | Delete
[347] Fix | Delete
# define DECLARE_ASN1_ITEM(name) \
[348] Fix | Delete
const ASN1_ITEM * name##_it(void);
[349] Fix | Delete
[350] Fix | Delete
# endif
[351] Fix | Delete
[352] Fix | Delete
/* Parameters used by ASN1_STRING_print_ex() */
[353] Fix | Delete
[354] Fix | Delete
/*
[355] Fix | Delete
* These determine which characters to escape: RFC2253 special characters,
[356] Fix | Delete
* control characters and MSB set characters
[357] Fix | Delete
*/
[358] Fix | Delete
[359] Fix | Delete
# define ASN1_STRFLGS_ESC_2253 1
[360] Fix | Delete
# define ASN1_STRFLGS_ESC_CTRL 2
[361] Fix | Delete
# define ASN1_STRFLGS_ESC_MSB 4
[362] Fix | Delete
[363] Fix | Delete
/*
[364] Fix | Delete
* This flag determines how we do escaping: normally RC2253 backslash only,
[365] Fix | Delete
* set this to use backslash and quote.
[366] Fix | Delete
*/
[367] Fix | Delete
[368] Fix | Delete
# define ASN1_STRFLGS_ESC_QUOTE 8
[369] Fix | Delete
[370] Fix | Delete
/* These three flags are internal use only. */
[371] Fix | Delete
[372] Fix | Delete
/* Character is a valid PrintableString character */
[373] Fix | Delete
# define CHARTYPE_PRINTABLESTRING 0x10
[374] Fix | Delete
/* Character needs escaping if it is the first character */
[375] Fix | Delete
# define CHARTYPE_FIRST_ESC_2253 0x20
[376] Fix | Delete
/* Character needs escaping if it is the last character */
[377] Fix | Delete
# define CHARTYPE_LAST_ESC_2253 0x40
[378] Fix | Delete
[379] Fix | Delete
/*
[380] Fix | Delete
* NB the internal flags are safely reused below by flags handled at the top
[381] Fix | Delete
* level.
[382] Fix | Delete
*/
[383] Fix | Delete
[384] Fix | Delete
/*
[385] Fix | Delete
* If this is set we convert all character strings to UTF8 first
[386] Fix | Delete
*/
[387] Fix | Delete
[388] Fix | Delete
# define ASN1_STRFLGS_UTF8_CONVERT 0x10
[389] Fix | Delete
[390] Fix | Delete
/*
[391] Fix | Delete
* If this is set we don't attempt to interpret content: just assume all
[392] Fix | Delete
* strings are 1 byte per character. This will produce some pretty odd
[393] Fix | Delete
* looking output!
[394] Fix | Delete
*/
[395] Fix | Delete
[396] Fix | Delete
# define ASN1_STRFLGS_IGNORE_TYPE 0x20
[397] Fix | Delete
[398] Fix | Delete
/* If this is set we include the string type in the output */
[399] Fix | Delete
# define ASN1_STRFLGS_SHOW_TYPE 0x40
[400] Fix | Delete
[401] Fix | Delete
/*
[402] Fix | Delete
* This determines which strings to display and which to 'dump' (hex dump of
[403] Fix | Delete
* content octets or DER encoding). We can only dump non character strings or
[404] Fix | Delete
* everything. If we don't dump 'unknown' they are interpreted as character
[405] Fix | Delete
* strings with 1 octet per character and are subject to the usual escaping
[406] Fix | Delete
* options.
[407] Fix | Delete
*/
[408] Fix | Delete
[409] Fix | Delete
# define ASN1_STRFLGS_DUMP_ALL 0x80
[410] Fix | Delete
# define ASN1_STRFLGS_DUMP_UNKNOWN 0x100
[411] Fix | Delete
[412] Fix | Delete
/*
[413] Fix | Delete
* These determine what 'dumping' does, we can dump the content octets or the
[414] Fix | Delete
* DER encoding: both use the RFC2253 #XXXXX notation.
[415] Fix | Delete
*/
[416] Fix | Delete
[417] Fix | Delete
# define ASN1_STRFLGS_DUMP_DER 0x200
[418] Fix | Delete
[419] Fix | Delete
/*
[420] Fix | Delete
* This flag specifies that RC2254 escaping shall be performed.
[421] Fix | Delete
*/
[422] Fix | Delete
#define ASN1_STRFLGS_ESC_2254 0x400
[423] Fix | Delete
[424] Fix | Delete
/*
[425] Fix | Delete
* All the string flags consistent with RFC2253, escaping control characters
[426] Fix | Delete
* isn't essential in RFC2253 but it is advisable anyway.
[427] Fix | Delete
*/
[428] Fix | Delete
[429] Fix | Delete
# define ASN1_STRFLGS_RFC2253 (ASN1_STRFLGS_ESC_2253 | \
[430] Fix | Delete
ASN1_STRFLGS_ESC_CTRL | \
[431] Fix | Delete
ASN1_STRFLGS_ESC_MSB | \
[432] Fix | Delete
ASN1_STRFLGS_UTF8_CONVERT | \
[433] Fix | Delete
ASN1_STRFLGS_DUMP_UNKNOWN | \
[434] Fix | Delete
ASN1_STRFLGS_DUMP_DER)
[435] Fix | Delete
[436] Fix | Delete
DEFINE_STACK_OF(ASN1_INTEGER)
[437] Fix | Delete
[438] Fix | Delete
DEFINE_STACK_OF(ASN1_GENERALSTRING)
[439] Fix | Delete
[440] Fix | Delete
DEFINE_STACK_OF(ASN1_UTF8STRING)
[441] Fix | Delete
[442] Fix | Delete
typedef struct asn1_type_st {
[443] Fix | Delete
int type;
[444] Fix | Delete
union {
[445] Fix | Delete
char *ptr;
[446] Fix | Delete
ASN1_BOOLEAN boolean;
[447] Fix | Delete
ASN1_STRING *asn1_string;
[448] Fix | Delete
ASN1_OBJECT *object;
[449] Fix | Delete
ASN1_INTEGER *integer;
[450] Fix | Delete
ASN1_ENUMERATED *enumerated;
[451] Fix | Delete
ASN1_BIT_STRING *bit_string;
[452] Fix | Delete
ASN1_OCTET_STRING *octet_string;
[453] Fix | Delete
ASN1_PRINTABLESTRING *printablestring;
[454] Fix | Delete
ASN1_T61STRING *t61string;
[455] Fix | Delete
ASN1_IA5STRING *ia5string;
[456] Fix | Delete
ASN1_GENERALSTRING *generalstring;
[457] Fix | Delete
ASN1_BMPSTRING *bmpstring;
[458] Fix | Delete
ASN1_UNIVERSALSTRING *universalstring;
[459] Fix | Delete
ASN1_UTCTIME *utctime;
[460] Fix | Delete
ASN1_GENERALIZEDTIME *generalizedtime;
[461] Fix | Delete
ASN1_VISIBLESTRING *visiblestring;
[462] Fix | Delete
ASN1_UTF8STRING *utf8string;
[463] Fix | Delete
/*
[464] Fix | Delete
* set and sequence are left complete and still contain the set or
[465] Fix | Delete
* sequence bytes
[466] Fix | Delete
*/
[467] Fix | Delete
ASN1_STRING *set;
[468] Fix | Delete
ASN1_STRING *sequence;
[469] Fix | Delete
ASN1_VALUE *asn1_value;
[470] Fix | Delete
} value;
[471] Fix | Delete
} ASN1_TYPE;
[472] Fix | Delete
[473] Fix | Delete
DEFINE_STACK_OF(ASN1_TYPE)
[474] Fix | Delete
[475] Fix | Delete
typedef STACK_OF(ASN1_TYPE) ASN1_SEQUENCE_ANY;
[476] Fix | Delete
[477] Fix | Delete
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SEQUENCE_ANY)
[478] Fix | Delete
DECLARE_ASN1_ENCODE_FUNCTIONS_const(ASN1_SEQUENCE_ANY, ASN1_SET_ANY)
[479] Fix | Delete
[480] Fix | Delete
/* This is used to contain a list of bit names */
[481] Fix | Delete
typedef struct BIT_STRING_BITNAME_st {
[482] Fix | Delete
int bitnum;
[483] Fix | Delete
const char *lname;
[484] Fix | Delete
const char *sname;
[485] Fix | Delete
} BIT_STRING_BITNAME;
[486] Fix | Delete
[487] Fix | Delete
# define B_ASN1_TIME \
[488] Fix | Delete
B_ASN1_UTCTIME | \
[489] Fix | Delete
B_ASN1_GENERALIZEDTIME
[490] Fix | Delete
[491] Fix | Delete
# define B_ASN1_PRINTABLE \
[492] Fix | Delete
B_ASN1_NUMERICSTRING| \
[493] Fix | Delete
B_ASN1_PRINTABLESTRING| \
[494] Fix | Delete
B_ASN1_T61STRING| \
[495] Fix | Delete
B_ASN1_IA5STRING| \
[496] Fix | Delete
B_ASN1_BIT_STRING| \
[497] Fix | Delete
B_ASN1_UNIVERSALSTRING|\
[498] Fix | Delete
B_ASN1_BMPSTRING|\
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function