Edit File by line
/home/barbar84/www/wp-conte.../plugins/sujqvwi/ExeBy/exe_root.../usr/include/openssl
File: asn1t.h
/*
[0] Fix | Delete
* Copyright 2000-2016 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_ASN1T_H
[9] Fix | Delete
# define HEADER_ASN1T_H
[10] Fix | Delete
[11] Fix | Delete
# include <stddef.h>
[12] Fix | Delete
# include <openssl/e_os2.h>
[13] Fix | Delete
# include <openssl/asn1.h>
[14] Fix | Delete
[15] Fix | Delete
# ifdef OPENSSL_BUILD_SHLIBCRYPTO
[16] Fix | Delete
# undef OPENSSL_EXTERN
[17] Fix | Delete
# define OPENSSL_EXTERN OPENSSL_EXPORT
[18] Fix | Delete
# endif
[19] Fix | Delete
[20] Fix | Delete
/* ASN1 template defines, structures and functions */
[21] Fix | Delete
[22] Fix | Delete
#ifdef __cplusplus
[23] Fix | Delete
extern "C" {
[24] Fix | Delete
#endif
[25] Fix | Delete
[26] Fix | Delete
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
[27] Fix | Delete
[28] Fix | Delete
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
[29] Fix | Delete
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)(iptr))
[30] Fix | Delete
[31] Fix | Delete
/* Macros for start and end of ASN1_ITEM definition */
[32] Fix | Delete
[33] Fix | Delete
# define ASN1_ITEM_start(itname) \
[34] Fix | Delete
const ASN1_ITEM itname##_it = {
[35] Fix | Delete
[36] Fix | Delete
# define static_ASN1_ITEM_start(itname) \
[37] Fix | Delete
static const ASN1_ITEM itname##_it = {
[38] Fix | Delete
[39] Fix | Delete
# define ASN1_ITEM_end(itname) \
[40] Fix | Delete
};
[41] Fix | Delete
[42] Fix | Delete
# else
[43] Fix | Delete
[44] Fix | Delete
/* Macro to obtain ASN1_ADB pointer from a type (only used internally) */
[45] Fix | Delete
# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
[46] Fix | Delete
[47] Fix | Delete
/* Macros for start and end of ASN1_ITEM definition */
[48] Fix | Delete
[49] Fix | Delete
# define ASN1_ITEM_start(itname) \
[50] Fix | Delete
const ASN1_ITEM * itname##_it(void) \
[51] Fix | Delete
{ \
[52] Fix | Delete
static const ASN1_ITEM local_it = {
[53] Fix | Delete
[54] Fix | Delete
# define static_ASN1_ITEM_start(itname) \
[55] Fix | Delete
static ASN1_ITEM_start(itname)
[56] Fix | Delete
[57] Fix | Delete
# define ASN1_ITEM_end(itname) \
[58] Fix | Delete
}; \
[59] Fix | Delete
return &local_it; \
[60] Fix | Delete
}
[61] Fix | Delete
[62] Fix | Delete
# endif
[63] Fix | Delete
[64] Fix | Delete
/* Macros to aid ASN1 template writing */
[65] Fix | Delete
[66] Fix | Delete
# define ASN1_ITEM_TEMPLATE(tname) \
[67] Fix | Delete
static const ASN1_TEMPLATE tname##_item_tt
[68] Fix | Delete
[69] Fix | Delete
# define ASN1_ITEM_TEMPLATE_END(tname) \
[70] Fix | Delete
;\
[71] Fix | Delete
ASN1_ITEM_start(tname) \
[72] Fix | Delete
ASN1_ITYPE_PRIMITIVE,\
[73] Fix | Delete
-1,\
[74] Fix | Delete
&tname##_item_tt,\
[75] Fix | Delete
0,\
[76] Fix | Delete
NULL,\
[77] Fix | Delete
0,\
[78] Fix | Delete
#tname \
[79] Fix | Delete
ASN1_ITEM_end(tname)
[80] Fix | Delete
# define static_ASN1_ITEM_TEMPLATE_END(tname) \
[81] Fix | Delete
;\
[82] Fix | Delete
static_ASN1_ITEM_start(tname) \
[83] Fix | Delete
ASN1_ITYPE_PRIMITIVE,\
[84] Fix | Delete
-1,\
[85] Fix | Delete
&tname##_item_tt,\
[86] Fix | Delete
0,\
[87] Fix | Delete
NULL,\
[88] Fix | Delete
0,\
[89] Fix | Delete
#tname \
[90] Fix | Delete
ASN1_ITEM_end(tname)
[91] Fix | Delete
[92] Fix | Delete
/* This is a ASN1 type which just embeds a template */
[93] Fix | Delete
[94] Fix | Delete
/*-
[95] Fix | Delete
* This pair helps declare a SEQUENCE. We can do:
[96] Fix | Delete
*
[97] Fix | Delete
* ASN1_SEQUENCE(stname) = {
[98] Fix | Delete
* ... SEQUENCE components ...
[99] Fix | Delete
* } ASN1_SEQUENCE_END(stname)
[100] Fix | Delete
*
[101] Fix | Delete
* This will produce an ASN1_ITEM called stname_it
[102] Fix | Delete
* for a structure called stname.
[103] Fix | Delete
*
[104] Fix | Delete
* If you want the same structure but a different
[105] Fix | Delete
* name then use:
[106] Fix | Delete
*
[107] Fix | Delete
* ASN1_SEQUENCE(itname) = {
[108] Fix | Delete
* ... SEQUENCE components ...
[109] Fix | Delete
* } ASN1_SEQUENCE_END_name(stname, itname)
[110] Fix | Delete
*
[111] Fix | Delete
* This will create an item called itname_it using
[112] Fix | Delete
* a structure called stname.
[113] Fix | Delete
*/
[114] Fix | Delete
[115] Fix | Delete
# define ASN1_SEQUENCE(tname) \
[116] Fix | Delete
static const ASN1_TEMPLATE tname##_seq_tt[]
[117] Fix | Delete
[118] Fix | Delete
# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
[119] Fix | Delete
[120] Fix | Delete
# define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname)
[121] Fix | Delete
[122] Fix | Delete
# define ASN1_SEQUENCE_END_name(stname, tname) \
[123] Fix | Delete
;\
[124] Fix | Delete
ASN1_ITEM_start(tname) \
[125] Fix | Delete
ASN1_ITYPE_SEQUENCE,\
[126] Fix | Delete
V_ASN1_SEQUENCE,\
[127] Fix | Delete
tname##_seq_tt,\
[128] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[129] Fix | Delete
NULL,\
[130] Fix | Delete
sizeof(stname),\
[131] Fix | Delete
#tname \
[132] Fix | Delete
ASN1_ITEM_end(tname)
[133] Fix | Delete
[134] Fix | Delete
# define static_ASN1_SEQUENCE_END_name(stname, tname) \
[135] Fix | Delete
;\
[136] Fix | Delete
static_ASN1_ITEM_start(tname) \
[137] Fix | Delete
ASN1_ITYPE_SEQUENCE,\
[138] Fix | Delete
V_ASN1_SEQUENCE,\
[139] Fix | Delete
tname##_seq_tt,\
[140] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[141] Fix | Delete
NULL,\
[142] Fix | Delete
sizeof(stname),\
[143] Fix | Delete
#stname \
[144] Fix | Delete
ASN1_ITEM_end(tname)
[145] Fix | Delete
[146] Fix | Delete
# define ASN1_NDEF_SEQUENCE(tname) \
[147] Fix | Delete
ASN1_SEQUENCE(tname)
[148] Fix | Delete
[149] Fix | Delete
# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
[150] Fix | Delete
ASN1_SEQUENCE_cb(tname, cb)
[151] Fix | Delete
[152] Fix | Delete
# define ASN1_SEQUENCE_cb(tname, cb) \
[153] Fix | Delete
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
[154] Fix | Delete
ASN1_SEQUENCE(tname)
[155] Fix | Delete
[156] Fix | Delete
# define ASN1_BROKEN_SEQUENCE(tname) \
[157] Fix | Delete
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_BROKEN, 0, 0, 0, 0}; \
[158] Fix | Delete
ASN1_SEQUENCE(tname)
[159] Fix | Delete
[160] Fix | Delete
# define ASN1_SEQUENCE_ref(tname, cb) \
[161] Fix | Delete
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0}; \
[162] Fix | Delete
ASN1_SEQUENCE(tname)
[163] Fix | Delete
[164] Fix | Delete
# define ASN1_SEQUENCE_enc(tname, enc, cb) \
[165] Fix | Delete
static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc)}; \
[166] Fix | Delete
ASN1_SEQUENCE(tname)
[167] Fix | Delete
[168] Fix | Delete
# define ASN1_NDEF_SEQUENCE_END(tname) \
[169] Fix | Delete
;\
[170] Fix | Delete
ASN1_ITEM_start(tname) \
[171] Fix | Delete
ASN1_ITYPE_NDEF_SEQUENCE,\
[172] Fix | Delete
V_ASN1_SEQUENCE,\
[173] Fix | Delete
tname##_seq_tt,\
[174] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[175] Fix | Delete
NULL,\
[176] Fix | Delete
sizeof(tname),\
[177] Fix | Delete
#tname \
[178] Fix | Delete
ASN1_ITEM_end(tname)
[179] Fix | Delete
# define static_ASN1_NDEF_SEQUENCE_END(tname) \
[180] Fix | Delete
;\
[181] Fix | Delete
static_ASN1_ITEM_start(tname) \
[182] Fix | Delete
ASN1_ITYPE_NDEF_SEQUENCE,\
[183] Fix | Delete
V_ASN1_SEQUENCE,\
[184] Fix | Delete
tname##_seq_tt,\
[185] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[186] Fix | Delete
NULL,\
[187] Fix | Delete
sizeof(tname),\
[188] Fix | Delete
#tname \
[189] Fix | Delete
ASN1_ITEM_end(tname)
[190] Fix | Delete
[191] Fix | Delete
# define ASN1_BROKEN_SEQUENCE_END(stname) ASN1_SEQUENCE_END_ref(stname, stname)
[192] Fix | Delete
# define static_ASN1_BROKEN_SEQUENCE_END(stname) \
[193] Fix | Delete
static_ASN1_SEQUENCE_END_ref(stname, stname)
[194] Fix | Delete
[195] Fix | Delete
# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
[196] Fix | Delete
[197] Fix | Delete
# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
[198] Fix | Delete
# define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname)
[199] Fix | Delete
[200] Fix | Delete
# define ASN1_SEQUENCE_END_ref(stname, tname) \
[201] Fix | Delete
;\
[202] Fix | Delete
ASN1_ITEM_start(tname) \
[203] Fix | Delete
ASN1_ITYPE_SEQUENCE,\
[204] Fix | Delete
V_ASN1_SEQUENCE,\
[205] Fix | Delete
tname##_seq_tt,\
[206] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[207] Fix | Delete
&tname##_aux,\
[208] Fix | Delete
sizeof(stname),\
[209] Fix | Delete
#tname \
[210] Fix | Delete
ASN1_ITEM_end(tname)
[211] Fix | Delete
# define static_ASN1_SEQUENCE_END_ref(stname, tname) \
[212] Fix | Delete
;\
[213] Fix | Delete
static_ASN1_ITEM_start(tname) \
[214] Fix | Delete
ASN1_ITYPE_SEQUENCE,\
[215] Fix | Delete
V_ASN1_SEQUENCE,\
[216] Fix | Delete
tname##_seq_tt,\
[217] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[218] Fix | Delete
&tname##_aux,\
[219] Fix | Delete
sizeof(stname),\
[220] Fix | Delete
#stname \
[221] Fix | Delete
ASN1_ITEM_end(tname)
[222] Fix | Delete
[223] Fix | Delete
# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
[224] Fix | Delete
;\
[225] Fix | Delete
ASN1_ITEM_start(tname) \
[226] Fix | Delete
ASN1_ITYPE_NDEF_SEQUENCE,\
[227] Fix | Delete
V_ASN1_SEQUENCE,\
[228] Fix | Delete
tname##_seq_tt,\
[229] Fix | Delete
sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
[230] Fix | Delete
&tname##_aux,\
[231] Fix | Delete
sizeof(stname),\
[232] Fix | Delete
#stname \
[233] Fix | Delete
ASN1_ITEM_end(tname)
[234] Fix | Delete
[235] Fix | Delete
/*-
[236] Fix | Delete
* This pair helps declare a CHOICE type. We can do:
[237] Fix | Delete
*
[238] Fix | Delete
* ASN1_CHOICE(chname) = {
[239] Fix | Delete
* ... CHOICE options ...
[240] Fix | Delete
* ASN1_CHOICE_END(chname)
[241] Fix | Delete
*
[242] Fix | Delete
* This will produce an ASN1_ITEM called chname_it
[243] Fix | Delete
* for a structure called chname. The structure
[244] Fix | Delete
* definition must look like this:
[245] Fix | Delete
* typedef struct {
[246] Fix | Delete
* int type;
[247] Fix | Delete
* union {
[248] Fix | Delete
* ASN1_SOMETHING *opt1;
[249] Fix | Delete
* ASN1_SOMEOTHER *opt2;
[250] Fix | Delete
* } value;
[251] Fix | Delete
* } chname;
[252] Fix | Delete
*
[253] Fix | Delete
* the name of the selector must be 'type'.
[254] Fix | Delete
* to use an alternative selector name use the
[255] Fix | Delete
* ASN1_CHOICE_END_selector() version.
[256] Fix | Delete
*/
[257] Fix | Delete
[258] Fix | Delete
# define ASN1_CHOICE(tname) \
[259] Fix | Delete
static const ASN1_TEMPLATE tname##_ch_tt[]
[260] Fix | Delete
[261] Fix | Delete
# define ASN1_CHOICE_cb(tname, cb) \
[262] Fix | Delete
static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0}; \
[263] Fix | Delete
ASN1_CHOICE(tname)
[264] Fix | Delete
[265] Fix | Delete
# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
[266] Fix | Delete
[267] Fix | Delete
# define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname)
[268] Fix | Delete
[269] Fix | Delete
# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
[270] Fix | Delete
[271] Fix | Delete
# define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type)
[272] Fix | Delete
[273] Fix | Delete
# define ASN1_CHOICE_END_selector(stname, tname, selname) \
[274] Fix | Delete
;\
[275] Fix | Delete
ASN1_ITEM_start(tname) \
[276] Fix | Delete
ASN1_ITYPE_CHOICE,\
[277] Fix | Delete
offsetof(stname,selname) ,\
[278] Fix | Delete
tname##_ch_tt,\
[279] Fix | Delete
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
[280] Fix | Delete
NULL,\
[281] Fix | Delete
sizeof(stname),\
[282] Fix | Delete
#stname \
[283] Fix | Delete
ASN1_ITEM_end(tname)
[284] Fix | Delete
[285] Fix | Delete
# define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
[286] Fix | Delete
;\
[287] Fix | Delete
static_ASN1_ITEM_start(tname) \
[288] Fix | Delete
ASN1_ITYPE_CHOICE,\
[289] Fix | Delete
offsetof(stname,selname) ,\
[290] Fix | Delete
tname##_ch_tt,\
[291] Fix | Delete
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
[292] Fix | Delete
NULL,\
[293] Fix | Delete
sizeof(stname),\
[294] Fix | Delete
#stname \
[295] Fix | Delete
ASN1_ITEM_end(tname)
[296] Fix | Delete
[297] Fix | Delete
# define ASN1_CHOICE_END_cb(stname, tname, selname) \
[298] Fix | Delete
;\
[299] Fix | Delete
ASN1_ITEM_start(tname) \
[300] Fix | Delete
ASN1_ITYPE_CHOICE,\
[301] Fix | Delete
offsetof(stname,selname) ,\
[302] Fix | Delete
tname##_ch_tt,\
[303] Fix | Delete
sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
[304] Fix | Delete
&tname##_aux,\
[305] Fix | Delete
sizeof(stname),\
[306] Fix | Delete
#stname \
[307] Fix | Delete
ASN1_ITEM_end(tname)
[308] Fix | Delete
[309] Fix | Delete
/* This helps with the template wrapper form of ASN1_ITEM */
[310] Fix | Delete
[311] Fix | Delete
# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
[312] Fix | Delete
(flags), (tag), 0,\
[313] Fix | Delete
#name, ASN1_ITEM_ref(type) }
[314] Fix | Delete
[315] Fix | Delete
/* These help with SEQUENCE or CHOICE components */
[316] Fix | Delete
[317] Fix | Delete
/* used to declare other types */
[318] Fix | Delete
[319] Fix | Delete
# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
[320] Fix | Delete
(flags), (tag), offsetof(stname, field),\
[321] Fix | Delete
#field, ASN1_ITEM_ref(type) }
[322] Fix | Delete
[323] Fix | Delete
/* implicit and explicit helper macros */
[324] Fix | Delete
[325] Fix | Delete
# define ASN1_IMP_EX(stname, field, type, tag, ex) \
[326] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type)
[327] Fix | Delete
[328] Fix | Delete
# define ASN1_EXP_EX(stname, field, type, tag, ex) \
[329] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type)
[330] Fix | Delete
[331] Fix | Delete
/* Any defined by macros: the field used is in the table itself */
[332] Fix | Delete
[333] Fix | Delete
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
[334] Fix | Delete
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
[335] Fix | Delete
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, (const ASN1_ITEM *)&(tblname##_adb) }
[336] Fix | Delete
# else
[337] Fix | Delete
# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
[338] Fix | Delete
# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
[339] Fix | Delete
# endif
[340] Fix | Delete
/* Plain simple type */
[341] Fix | Delete
# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
[342] Fix | Delete
/* Embedded simple type */
[343] Fix | Delete
# define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED,0, stname, field, type)
[344] Fix | Delete
[345] Fix | Delete
/* OPTIONAL simple type */
[346] Fix | Delete
# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
[347] Fix | Delete
# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type)
[348] Fix | Delete
[349] Fix | Delete
/* IMPLICIT tagged simple type */
[350] Fix | Delete
# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
[351] Fix | Delete
# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
[352] Fix | Delete
[353] Fix | Delete
/* IMPLICIT tagged OPTIONAL simple type */
[354] Fix | Delete
# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
[355] Fix | Delete
# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
[356] Fix | Delete
[357] Fix | Delete
/* Same as above but EXPLICIT */
[358] Fix | Delete
[359] Fix | Delete
# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
[360] Fix | Delete
# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
[361] Fix | Delete
# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
[362] Fix | Delete
# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
[363] Fix | Delete
[364] Fix | Delete
/* SEQUENCE OF type */
[365] Fix | Delete
# define ASN1_SEQUENCE_OF(stname, field, type) \
[366] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
[367] Fix | Delete
[368] Fix | Delete
/* OPTIONAL SEQUENCE OF */
[369] Fix | Delete
# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
[370] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
[371] Fix | Delete
[372] Fix | Delete
/* Same as above but for SET OF */
[373] Fix | Delete
[374] Fix | Delete
# define ASN1_SET_OF(stname, field, type) \
[375] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
[376] Fix | Delete
[377] Fix | Delete
# define ASN1_SET_OF_OPT(stname, field, type) \
[378] Fix | Delete
ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
[379] Fix | Delete
[380] Fix | Delete
/* Finally compound types of SEQUENCE, SET, IMPLICIT, EXPLICIT and OPTIONAL */
[381] Fix | Delete
[382] Fix | Delete
# define ASN1_IMP_SET_OF(stname, field, type, tag) \
[383] Fix | Delete
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
[384] Fix | Delete
[385] Fix | Delete
# define ASN1_EXP_SET_OF(stname, field, type, tag) \
[386] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
[387] Fix | Delete
[388] Fix | Delete
# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
[389] Fix | Delete
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
[390] Fix | Delete
[391] Fix | Delete
# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
[392] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
[393] Fix | Delete
[394] Fix | Delete
# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
[395] Fix | Delete
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
[396] Fix | Delete
[397] Fix | Delete
# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
[398] Fix | Delete
ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
[399] Fix | Delete
[400] Fix | Delete
# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
[401] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
[402] Fix | Delete
[403] Fix | Delete
# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
[404] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
[405] Fix | Delete
[406] Fix | Delete
/* EXPLICIT using indefinite length constructed form */
[407] Fix | Delete
# define ASN1_NDEF_EXP(stname, field, type, tag) \
[408] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
[409] Fix | Delete
[410] Fix | Delete
/* EXPLICIT OPTIONAL using indefinite length constructed form */
[411] Fix | Delete
# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
[412] Fix | Delete
ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
[413] Fix | Delete
[414] Fix | Delete
/* Macros for the ASN1_ADB structure */
[415] Fix | Delete
[416] Fix | Delete
# define ASN1_ADB(name) \
[417] Fix | Delete
static const ASN1_ADB_TABLE name##_adbtbl[]
[418] Fix | Delete
[419] Fix | Delete
# ifndef OPENSSL_EXPORT_VAR_AS_FUNCTION
[420] Fix | Delete
[421] Fix | Delete
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
[422] Fix | Delete
;\
[423] Fix | Delete
static const ASN1_ADB name##_adb = {\
[424] Fix | Delete
flags,\
[425] Fix | Delete
offsetof(name, field),\
[426] Fix | Delete
adb_cb,\
[427] Fix | Delete
name##_adbtbl,\
[428] Fix | Delete
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
[429] Fix | Delete
def,\
[430] Fix | Delete
none\
[431] Fix | Delete
}
[432] Fix | Delete
[433] Fix | Delete
# else
[434] Fix | Delete
[435] Fix | Delete
# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
[436] Fix | Delete
;\
[437] Fix | Delete
static const ASN1_ITEM *name##_adb(void) \
[438] Fix | Delete
{ \
[439] Fix | Delete
static const ASN1_ADB internal_adb = \
[440] Fix | Delete
{\
[441] Fix | Delete
flags,\
[442] Fix | Delete
offsetof(name, field),\
[443] Fix | Delete
adb_cb,\
[444] Fix | Delete
name##_adbtbl,\
[445] Fix | Delete
sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
[446] Fix | Delete
def,\
[447] Fix | Delete
none\
[448] Fix | Delete
}; \
[449] Fix | Delete
return (const ASN1_ITEM *) &internal_adb; \
[450] Fix | Delete
} \
[451] Fix | Delete
void dummy_function(void)
[452] Fix | Delete
[453] Fix | Delete
# endif
[454] Fix | Delete
[455] Fix | Delete
# define ADB_ENTRY(val, template) {val, template}
[456] Fix | Delete
[457] Fix | Delete
# define ASN1_ADB_TEMPLATE(name) \
[458] Fix | Delete
static const ASN1_TEMPLATE name##_tt
[459] Fix | Delete
[460] Fix | Delete
/*
[461] Fix | Delete
* This is the ASN1 template structure that defines a wrapper round the
[462] Fix | Delete
* actual type. It determines the actual position of the field in the value
[463] Fix | Delete
* structure, various flags such as OPTIONAL and the field name.
[464] Fix | Delete
*/
[465] Fix | Delete
[466] Fix | Delete
struct ASN1_TEMPLATE_st {
[467] Fix | Delete
unsigned long flags; /* Various flags */
[468] Fix | Delete
long tag; /* tag, not used if no tagging */
[469] Fix | Delete
unsigned long offset; /* Offset of this field in structure */
[470] Fix | Delete
const char *field_name; /* Field name */
[471] Fix | Delete
ASN1_ITEM_EXP *item; /* Relevant ASN1_ITEM or ASN1_ADB */
[472] Fix | Delete
};
[473] Fix | Delete
[474] Fix | Delete
/* Macro to extract ASN1_ITEM and ASN1_ADB pointer from ASN1_TEMPLATE */
[475] Fix | Delete
[476] Fix | Delete
# define ASN1_TEMPLATE_item(t) (t->item_ptr)
[477] Fix | Delete
# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
[478] Fix | Delete
[479] Fix | Delete
typedef struct ASN1_ADB_TABLE_st ASN1_ADB_TABLE;
[480] Fix | Delete
typedef struct ASN1_ADB_st ASN1_ADB;
[481] Fix | Delete
[482] Fix | Delete
struct ASN1_ADB_st {
[483] Fix | Delete
unsigned long flags; /* Various flags */
[484] Fix | Delete
unsigned long offset; /* Offset of selector field */
[485] Fix | Delete
int (*adb_cb)(long *psel); /* Application callback */
[486] Fix | Delete
const ASN1_ADB_TABLE *tbl; /* Table of possible types */
[487] Fix | Delete
long tblcount; /* Number of entries in tbl */
[488] Fix | Delete
const ASN1_TEMPLATE *default_tt; /* Type to use if no match */
[489] Fix | Delete
const ASN1_TEMPLATE *null_tt; /* Type to use if selector is NULL */
[490] Fix | Delete
};
[491] Fix | Delete
[492] Fix | Delete
struct ASN1_ADB_TABLE_st {
[493] Fix | Delete
long value; /* NID for an object or value for an int */
[494] Fix | Delete
const ASN1_TEMPLATE tt; /* item for this value */
[495] Fix | Delete
};
[496] Fix | Delete
[497] Fix | Delete
/* template flags */
[498] Fix | Delete
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function