15#ifndef OPENSSL_ASN1T_H
16# define OPENSSL_ASN1T_H
19# include <openssl/macros.h>
20# ifndef OPENSSL_NO_DEPRECATED_3_0
21# define HEADER_ASN1T_H
25# include <openssl/e_os2.h>
26# include <openssl/asn1.h>
28# ifdef OPENSSL_BUILD_SHLIBCRYPTO
30# define OPENSSL_EXTERN OPENSSL_EXPORT
80# define ASN1_ITYPE_PRIMITIVE 0x0
81# define ASN1_ITYPE_SEQUENCE 0x1
82# define ASN1_ITYPE_CHOICE 0x2
84# define ASN1_ITYPE_EXTERN 0x4
85# define ASN1_ITYPE_MSTRING 0x5
86# define ASN1_ITYPE_NDEF_SEQUENCE 0x6
89# define ASN1_ADB_ptr(iptr) ((const ASN1_ADB *)((iptr)()))
93# define ASN1_ITEM_start(itname) \
94 const ASN1_ITEM * itname##_it(void) \
96 static const ASN1_ITEM local_it = {
98# define static_ASN1_ITEM_start(itname) \
99 static ASN1_ITEM_start(itname)
101# define ASN1_ITEM_end(itname) \
108# define ASN1_ITEM_TEMPLATE(tname) \
109 static const ASN1_TEMPLATE tname##_item_tt
111# define ASN1_ITEM_TEMPLATE_END(tname) \
113 ASN1_ITEM_start(tname) \
114 ASN1_ITYPE_PRIMITIVE,\
122# define static_ASN1_ITEM_TEMPLATE_END(tname) \
124 static_ASN1_ITEM_start(tname) \
125 ASN1_ITYPE_PRIMITIVE,\
157# define ASN1_SEQUENCE(tname) \
158 static const ASN1_TEMPLATE tname##_seq_tt[]
160# define ASN1_SEQUENCE_END(stname) ASN1_SEQUENCE_END_name(stname, stname)
162# define static_ASN1_SEQUENCE_END(stname) static_ASN1_SEQUENCE_END_name(stname, stname)
164# define ASN1_SEQUENCE_END_name(stname, tname) \
166 ASN1_ITEM_start(tname) \
167 ASN1_ITYPE_SEQUENCE,\
170 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
176# define static_ASN1_SEQUENCE_END_name(stname, tname) \
178 static_ASN1_ITEM_start(tname) \
179 ASN1_ITYPE_SEQUENCE,\
182 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
188# define ASN1_NDEF_SEQUENCE(tname) \
191# define ASN1_NDEF_SEQUENCE_cb(tname, cb) \
192 ASN1_SEQUENCE_cb(tname, cb)
194# define ASN1_SEQUENCE_cb(tname, cb) \
195 static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
198# define ASN1_SEQUENCE_const_cb(tname, const_cb) \
199 static const ASN1_AUX tname##_aux = \
200 {NULL, ASN1_AFLG_CONST_CB, 0, 0, NULL, 0, const_cb}; \
203# define ASN1_SEQUENCE_cb_const_cb(tname, cb, const_cb) \
204 static const ASN1_AUX tname##_aux = \
205 {NULL, ASN1_AFLG_CONST_CB, 0, 0, cb, 0, const_cb}; \
208# define ASN1_SEQUENCE_ref(tname, cb) \
209 static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_REFCOUNT, offsetof(tname, references), offsetof(tname, lock), cb, 0, NULL}; \
212# define ASN1_SEQUENCE_enc(tname, enc, cb) \
213 static const ASN1_AUX tname##_aux = {NULL, ASN1_AFLG_ENCODING, 0, 0, cb, offsetof(tname, enc), NULL}; \
216# define ASN1_NDEF_SEQUENCE_END(tname) \
218 ASN1_ITEM_start(tname) \
219 ASN1_ITYPE_NDEF_SEQUENCE,\
222 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
227# define static_ASN1_NDEF_SEQUENCE_END(tname) \
229 static_ASN1_ITEM_start(tname) \
230 ASN1_ITYPE_NDEF_SEQUENCE,\
233 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
240# define ASN1_SEQUENCE_END_enc(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
242# define ASN1_SEQUENCE_END_cb(stname, tname) ASN1_SEQUENCE_END_ref(stname, tname)
243# define static_ASN1_SEQUENCE_END_cb(stname, tname) static_ASN1_SEQUENCE_END_ref(stname, tname)
245# define ASN1_SEQUENCE_END_ref(stname, tname) \
247 ASN1_ITEM_start(tname) \
248 ASN1_ITYPE_SEQUENCE,\
251 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
256# define static_ASN1_SEQUENCE_END_ref(stname, tname) \
258 static_ASN1_ITEM_start(tname) \
259 ASN1_ITYPE_SEQUENCE,\
262 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
268# define ASN1_NDEF_SEQUENCE_END_cb(stname, tname) \
270 ASN1_ITEM_start(tname) \
271 ASN1_ITYPE_NDEF_SEQUENCE,\
274 sizeof(tname##_seq_tt) / sizeof(ASN1_TEMPLATE),\
303# define ASN1_CHOICE(tname) \
304 static const ASN1_TEMPLATE tname##_ch_tt[]
306# define ASN1_CHOICE_cb(tname, cb) \
307 static const ASN1_AUX tname##_aux = {NULL, 0, 0, 0, cb, 0, NULL}; \
310# define ASN1_CHOICE_END(stname) ASN1_CHOICE_END_name(stname, stname)
312# define static_ASN1_CHOICE_END(stname) static_ASN1_CHOICE_END_name(stname, stname)
314# define ASN1_CHOICE_END_name(stname, tname) ASN1_CHOICE_END_selector(stname, tname, type)
316# define static_ASN1_CHOICE_END_name(stname, tname) static_ASN1_CHOICE_END_selector(stname, tname, type)
318# define ASN1_CHOICE_END_selector(stname, tname, selname) \
320 ASN1_ITEM_start(tname) \
322 offsetof(stname,selname) ,\
324 sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
330# define static_ASN1_CHOICE_END_selector(stname, tname, selname) \
332 static_ASN1_ITEM_start(tname) \
334 offsetof(stname,selname) ,\
336 sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
342# define ASN1_CHOICE_END_cb(stname, tname, selname) \
344 ASN1_ITEM_start(tname) \
346 offsetof(stname,selname) ,\
348 sizeof(tname##_ch_tt) / sizeof(ASN1_TEMPLATE),\
356# define ASN1_EX_TEMPLATE_TYPE(flags, tag, name, type) { \
358 #name, ASN1_ITEM_ref(type) }
364# define ASN1_EX_TYPE(flags, tag, stname, field, type) { \
365 (flags), (tag), offsetof(stname, field),\
366 #field, ASN1_ITEM_ref(type) }
370# define ASN1_IMP_EX(stname, field, type, tag, ex) \
371 ASN1_EX_TYPE(ASN1_TFLG_IMPLICIT | (ex), tag, stname, field, type)
373# define ASN1_EXP_EX(stname, field, type, tag, ex) \
374 ASN1_EX_TYPE(ASN1_TFLG_EXPLICIT | (ex), tag, stname, field, type)
378# define ASN1_ADB_OBJECT(tblname) { ASN1_TFLG_ADB_OID, -1, 0, #tblname, tblname##_adb }
379# define ASN1_ADB_INTEGER(tblname) { ASN1_TFLG_ADB_INT, -1, 0, #tblname, tblname##_adb }
382# define ASN1_SIMPLE(stname, field, type) ASN1_EX_TYPE(0,0, stname, field, type)
384# define ASN1_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_EMBED,0, stname, field, type)
387# define ASN1_OPT(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL, 0, stname, field, type)
388# define ASN1_OPT_EMBED(stname, field, type) ASN1_EX_TYPE(ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED, 0, stname, field, type)
391# define ASN1_IMP(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, 0)
392# define ASN1_IMP_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
395# define ASN1_IMP_OPT(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
396# define ASN1_IMP_OPT_EMBED(stname, field, type, tag) ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
400# define ASN1_EXP(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, 0)
401# define ASN1_EXP_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_EMBED)
402# define ASN1_EXP_OPT(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL)
403# define ASN1_EXP_OPT_EMBED(stname, field, type, tag) ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_EMBED)
406# define ASN1_SEQUENCE_OF(stname, field, type) \
407 ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, stname, field, type)
410# define ASN1_SEQUENCE_OF_OPT(stname, field, type) \
411 ASN1_EX_TYPE(ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
415# define ASN1_SET_OF(stname, field, type) \
416 ASN1_EX_TYPE(ASN1_TFLG_SET_OF, 0, stname, field, type)
418# define ASN1_SET_OF_OPT(stname, field, type) \
419 ASN1_EX_TYPE(ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL, 0, stname, field, type)
423# define ASN1_IMP_SET_OF(stname, field, type, tag) \
424 ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
426# define ASN1_EXP_SET_OF(stname, field, type, tag) \
427 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF)
429# define ASN1_IMP_SET_OF_OPT(stname, field, type, tag) \
430 ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
432# define ASN1_EXP_SET_OF_OPT(stname, field, type, tag) \
433 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SET_OF|ASN1_TFLG_OPTIONAL)
435# define ASN1_IMP_SEQUENCE_OF(stname, field, type, tag) \
436 ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
438# define ASN1_IMP_SEQUENCE_OF_OPT(stname, field, type, tag) \
439 ASN1_IMP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
441# define ASN1_EXP_SEQUENCE_OF(stname, field, type, tag) \
442 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF)
444# define ASN1_EXP_SEQUENCE_OF_OPT(stname, field, type, tag) \
445 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_SEQUENCE_OF|ASN1_TFLG_OPTIONAL)
448# define ASN1_NDEF_EXP(stname, field, type, tag) \
449 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_NDEF)
452# define ASN1_NDEF_EXP_OPT(stname, field, type, tag) \
453 ASN1_EXP_EX(stname, field, type, tag, ASN1_TFLG_OPTIONAL|ASN1_TFLG_NDEF)
457# define ASN1_ADB(name) \
458 static const ASN1_ADB_TABLE name##_adbtbl[]
460# define ASN1_ADB_END(name, flags, field, adb_cb, def, none) \
462 static const ASN1_ITEM *name##_adb(void) \
464 static const ASN1_ADB internal_adb = \
467 offsetof(name, field),\
470 sizeof(name##_adbtbl) / sizeof(ASN1_ADB_TABLE),\
474 return (const ASN1_ITEM *) &internal_adb; \
476 void dummy_function(void)
478# define ADB_ENTRY(val, template) {val, template}
480# define ASN1_ADB_TEMPLATE(name) \
481 static const ASN1_TEMPLATE name##_tt
492 unsigned long offset;
493 const char *field_name;
499# define ASN1_TEMPLATE_item(t) (t->item_ptr)
500# define ASN1_TEMPLATE_adb(t) (t->item_ptr)
507 unsigned long offset;
508 int (*adb_cb)(
long *psel);
523# define ASN1_TFLG_OPTIONAL (0x1)
526# define ASN1_TFLG_SET_OF (0x1 << 1)
529# define ASN1_TFLG_SEQUENCE_OF (0x2 << 1)
536# define ASN1_TFLG_SET_ORDER (0x3 << 1)
539# define ASN1_TFLG_SK_MASK (0x3 << 1)
547# define ASN1_TFLG_IMPTAG (0x1 << 3)
550# define ASN1_TFLG_EXPTAG (0x2 << 3)
552# define ASN1_TFLG_TAG_MASK (0x3 << 3)
555# define ASN1_TFLG_IMPLICIT (ASN1_TFLG_IMPTAG|ASN1_TFLG_CONTEXT)
558# define ASN1_TFLG_EXPLICIT (ASN1_TFLG_EXPTAG|ASN1_TFLG_CONTEXT)
567# define ASN1_TFLG_UNIVERSAL (0x0<<6)
569# define ASN1_TFLG_APPLICATION (0x1<<6)
571# define ASN1_TFLG_CONTEXT (0x2<<6)
573# define ASN1_TFLG_PRIVATE (0x3<<6)
575# define ASN1_TFLG_TAG_CLASS (0x3<<6)
583# define ASN1_TFLG_ADB_MASK (0x3<<8)
585# define ASN1_TFLG_ADB_OID (0x1<<8)
587# define ASN1_TFLG_ADB_INT (0x1<<9)
594# define ASN1_TFLG_NDEF (0x1<<11)
597# define ASN1_TFLG_EMBED (0x1 << 12)
629typedef int ASN1_ex_d2i(ASN1_VALUE **pval,
const unsigned char **in,
long len,
630 const ASN1_ITEM *it,
int tag,
int aclass,
char opt,
633typedef int ASN1_ex_d2i_ex(ASN1_VALUE **pval,
const unsigned char **in,
long len,
634 const ASN1_ITEM *it,
int tag,
int aclass,
char opt,
635 ASN1_TLC *ctx, OSSL_LIB_CTX *libctx,
637typedef int ASN1_ex_i2d(
const ASN1_VALUE **pval,
unsigned char **out,
638 const ASN1_ITEM *it,
int tag,
int aclass);
639typedef int ASN1_ex_new_func(ASN1_VALUE **pval,
const ASN1_ITEM *it);
640typedef int ASN1_ex_new_ex_func(ASN1_VALUE **pval,
const ASN1_ITEM *it,
641 OSSL_LIB_CTX *libctx,
const char *propq);
642typedef void ASN1_ex_free_func(ASN1_VALUE **pval,
const ASN1_ITEM *it);
644typedef int ASN1_ex_print_func(BIO *out,
const ASN1_VALUE **pval,
645 int indent,
const char *fname,
646 const ASN1_PCTX *pctx);
648typedef int ASN1_primitive_i2c(
const ASN1_VALUE **pval,
unsigned char *cont,
649 int *putype,
const ASN1_ITEM *it);
650typedef int ASN1_primitive_c2i(ASN1_VALUE **pval,
const unsigned char *cont,
651 int len,
int utype,
char *free_cont,
652 const ASN1_ITEM *it);
653typedef int ASN1_primitive_print(BIO *out,
const ASN1_VALUE **pval,
654 const ASN1_ITEM *it,
int indent,
655 const ASN1_PCTX *pctx);
659 ASN1_ex_new_func *asn1_ex_new;
660 ASN1_ex_free_func *asn1_ex_free;
661 ASN1_ex_free_func *asn1_ex_clear;
662 ASN1_ex_d2i *asn1_ex_d2i;
663 ASN1_ex_i2d *asn1_ex_i2d;
664 ASN1_ex_print_func *asn1_ex_print;
665 ASN1_ex_new_ex_func *asn1_ex_new_ex;
666 ASN1_ex_d2i_ex *asn1_ex_d2i_ex;
672 ASN1_ex_new_func *prim_new;
673 ASN1_ex_free_func *prim_free;
674 ASN1_ex_free_func *prim_clear;
675 ASN1_primitive_c2i *prim_c2i;
676 ASN1_primitive_i2c *prim_i2c;
677 ASN1_primitive_print *prim_print;
697typedef int ASN1_aux_cb(
int operation, ASN1_VALUE **in,
const ASN1_ITEM *it,
699typedef int ASN1_aux_const_cb(
int operation,
const ASN1_VALUE **in,
700 const ASN1_ITEM *it,
void *exarg);
707 ASN1_aux_cb *asn1_cb;
709 ASN1_aux_const_cb *asn1_const_cb;
716 const ASN1_PCTX *pctx;
726 unsigned char **boundary;
732# define ASN1_AFLG_REFCOUNT 1
734# define ASN1_AFLG_ENCODING 2
736# define ASN1_AFLG_BROKEN 4
738# define ASN1_AFLG_CONST_CB 8
742# define ASN1_OP_NEW_PRE 0
743# define ASN1_OP_NEW_POST 1
744# define ASN1_OP_FREE_PRE 2
745# define ASN1_OP_FREE_POST 3
746# define ASN1_OP_D2I_PRE 4
747# define ASN1_OP_D2I_POST 5
748# define ASN1_OP_I2D_PRE 6
749# define ASN1_OP_I2D_POST 7
750# define ASN1_OP_PRINT_PRE 8
751# define ASN1_OP_PRINT_POST 9
752# define ASN1_OP_STREAM_PRE 10
753# define ASN1_OP_STREAM_POST 11
754# define ASN1_OP_DETACHED_PRE 12
755# define ASN1_OP_DETACHED_POST 13
756# define ASN1_OP_DUP_PRE 14
757# define ASN1_OP_DUP_POST 15
758# define ASN1_OP_GET0_LIBCTX 16
759# define ASN1_OP_GET0_PROPQ 17
762# define IMPLEMENT_ASN1_TYPE(stname) IMPLEMENT_ASN1_TYPE_ex(stname, stname, 0)
763# define IMPLEMENT_ASN1_TYPE_ex(itname, vname, ex) \
764 ASN1_ITEM_start(itname) \
765 ASN1_ITYPE_PRIMITIVE, V_##vname, NULL, 0, NULL, ex, #itname \
766 ASN1_ITEM_end(itname)
769# define IMPLEMENT_ASN1_MSTRING(itname, mask) \
770 ASN1_ITEM_start(itname) \
771 ASN1_ITYPE_MSTRING, mask, NULL, 0, NULL, sizeof(ASN1_STRING), #itname \
772 ASN1_ITEM_end(itname)
774# define IMPLEMENT_EXTERN_ASN1(sname, tag, fptrs) \
775 ASN1_ITEM_start(sname) \
787# define IMPLEMENT_ASN1_FUNCTIONS(stname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, stname, stname)
789# define IMPLEMENT_ASN1_FUNCTIONS_name(stname, itname) IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, itname)
791# define IMPLEMENT_ASN1_FUNCTIONS_ENCODE_name(stname, itname) \
792 IMPLEMENT_ASN1_FUNCTIONS_ENCODE_fname(stname, itname, itname)
794# define IMPLEMENT_STATIC_ASN1_ALLOC_FUNCTIONS(stname) \
795 IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(static, stname, stname, stname)
797# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS(stname) \
798 IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, stname, stname)
800# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_pfname(pre, stname, itname, fname) \
801 pre stname *fname##_new(void) \
803 return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
805 pre void fname##_free(stname *a) \
807 ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
810# define IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname) \
811 stname *fname##_new(void) \
813 return (stname *)ASN1_item_new(ASN1_ITEM_rptr(itname)); \
815 void fname##_free(stname *a) \
817 ASN1_item_free((ASN1_VALUE *)a, ASN1_ITEM_rptr(itname)); \
820# define IMPLEMENT_ASN1_FUNCTIONS_fname(stname, itname, fname) \
821 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
822 IMPLEMENT_ASN1_ALLOC_FUNCTIONS_fname(stname, itname, fname)
824# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname) \
825 stname *d2i_##fname(stname **a, const unsigned char **in, long len) \
827 return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, ASN1_ITEM_rptr(itname));\
829 int i2d_##fname(const stname *a, unsigned char **out) \
831 return ASN1_item_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(itname));\
834# define IMPLEMENT_ASN1_NDEF_FUNCTION(stname) \
835 int i2d_##stname##_NDEF(const stname *a, unsigned char **out) \
837 return ASN1_item_ndef_i2d((const ASN1_VALUE *)a, out, ASN1_ITEM_rptr(stname));\
840# define IMPLEMENT_STATIC_ASN1_ENCODE_FUNCTIONS(stname) \
841 static stname *d2i_##stname(stname **a, \
842 const unsigned char **in, long len) \
844 return (stname *)ASN1_item_d2i((ASN1_VALUE **)a, in, len, \
845 ASN1_ITEM_rptr(stname)); \
847 static int i2d_##stname(const stname *a, unsigned char **out) \
849 return ASN1_item_i2d((const ASN1_VALUE *)a, out, \
850 ASN1_ITEM_rptr(stname)); \
853# define IMPLEMENT_ASN1_DUP_FUNCTION(stname) \
854 stname * stname##_dup(const stname *x) \
856 return ASN1_item_dup(ASN1_ITEM_rptr(stname), x); \
859# define IMPLEMENT_ASN1_PRINT_FUNCTION(stname) \
860 IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, stname, stname)
862# define IMPLEMENT_ASN1_PRINT_FUNCTION_fname(stname, itname, fname) \
863 int fname##_print_ctx(BIO *out, const stname *x, int indent, \
864 const ASN1_PCTX *pctx) \
866 return ASN1_item_print(out, (const ASN1_VALUE *)x, indent, \
867 ASN1_ITEM_rptr(itname), pctx); \
872DECLARE_ASN1_ITEM(ASN1_BOOLEAN)
873DECLARE_ASN1_ITEM(ASN1_TBOOLEAN)
874DECLARE_ASN1_ITEM(ASN1_FBOOLEAN)
875DECLARE_ASN1_ITEM(ASN1_SEQUENCE)
876DECLARE_ASN1_ITEM(CBIGNUM)
877DECLARE_ASN1_ITEM(BIGNUM)
878DECLARE_ASN1_ITEM(INT32)
879DECLARE_ASN1_ITEM(ZINT32)
880DECLARE_ASN1_ITEM(UINT32)
881DECLARE_ASN1_ITEM(ZUINT32)
882DECLARE_ASN1_ITEM(INT64)
883DECLARE_ASN1_ITEM(ZINT64)
884DECLARE_ASN1_ITEM(UINT64)
885DECLARE_ASN1_ITEM(ZUINT64)
887# ifndef OPENSSL_NO_DEPRECATED_3_0
893DECLARE_ASN1_ITEM(LONG)
894DECLARE_ASN1_ITEM(ZLONG)
897SKM_DEFINE_STACK_OF_INTERNAL(ASN1_VALUE, ASN1_VALUE, ASN1_VALUE)
898#define sk_ASN1_VALUE_num(sk) OPENSSL_sk_num(ossl_check_const_ASN1_VALUE_sk_type(sk))
899#define sk_ASN1_VALUE_value(sk, idx) ((ASN1_VALUE *)OPENSSL_sk_value(ossl_check_const_ASN1_VALUE_sk_type(sk), (idx)))
900#define sk_ASN1_VALUE_new(cmp) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new(ossl_check_ASN1_VALUE_compfunc_type(cmp)))
901#define sk_ASN1_VALUE_new_null() ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_null())
902#define sk_ASN1_VALUE_new_reserve(cmp, n) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_new_reserve(ossl_check_ASN1_VALUE_compfunc_type(cmp), (n)))
903#define sk_ASN1_VALUE_reserve(sk, n) OPENSSL_sk_reserve(ossl_check_ASN1_VALUE_sk_type(sk), (n))
904#define sk_ASN1_VALUE_free(sk) OPENSSL_sk_free(ossl_check_ASN1_VALUE_sk_type(sk))
905#define sk_ASN1_VALUE_zero(sk) OPENSSL_sk_zero(ossl_check_ASN1_VALUE_sk_type(sk))
906#define sk_ASN1_VALUE_delete(sk, i) ((ASN1_VALUE *)OPENSSL_sk_delete(ossl_check_ASN1_VALUE_sk_type(sk), (i)))
907#define sk_ASN1_VALUE_delete_ptr(sk, ptr) ((ASN1_VALUE *)OPENSSL_sk_delete_ptr(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr)))
908#define sk_ASN1_VALUE_push(sk, ptr) OPENSSL_sk_push(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
909#define sk_ASN1_VALUE_unshift(sk, ptr) OPENSSL_sk_unshift(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
910#define sk_ASN1_VALUE_pop(sk) ((ASN1_VALUE *)OPENSSL_sk_pop(ossl_check_ASN1_VALUE_sk_type(sk)))
911#define sk_ASN1_VALUE_shift(sk) ((ASN1_VALUE *)OPENSSL_sk_shift(ossl_check_ASN1_VALUE_sk_type(sk)))
912#define sk_ASN1_VALUE_pop_free(sk, freefunc) OPENSSL_sk_pop_free(ossl_check_ASN1_VALUE_sk_type(sk),ossl_check_ASN1_VALUE_freefunc_type(freefunc))
913#define sk_ASN1_VALUE_insert(sk, ptr, idx) OPENSSL_sk_insert(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), (idx))
914#define sk_ASN1_VALUE_set(sk, idx, ptr) ((ASN1_VALUE *)OPENSSL_sk_set(ossl_check_ASN1_VALUE_sk_type(sk), (idx), ossl_check_ASN1_VALUE_type(ptr)))
915#define sk_ASN1_VALUE_find(sk, ptr) OPENSSL_sk_find(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
916#define sk_ASN1_VALUE_find_ex(sk, ptr) OPENSSL_sk_find_ex(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr))
917#define sk_ASN1_VALUE_find_all(sk, ptr, pnum) OPENSSL_sk_find_all(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_type(ptr), pnum)
918#define sk_ASN1_VALUE_sort(sk) OPENSSL_sk_sort(ossl_check_ASN1_VALUE_sk_type(sk))
919#define sk_ASN1_VALUE_is_sorted(sk) OPENSSL_sk_is_sorted(ossl_check_const_ASN1_VALUE_sk_type(sk))
920#define sk_ASN1_VALUE_dup(sk) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_dup(ossl_check_const_ASN1_VALUE_sk_type(sk)))
921#define sk_ASN1_VALUE_deep_copy(sk, copyfunc, freefunc) ((STACK_OF(ASN1_VALUE) *)OPENSSL_sk_deep_copy(ossl_check_const_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_copyfunc_type(copyfunc), ossl_check_ASN1_VALUE_freefunc_type(freefunc)))
922#define sk_ASN1_VALUE_set_cmp_func(sk, cmp) ((sk_ASN1_VALUE_compfunc)OPENSSL_sk_set_cmp_func(ossl_check_ASN1_VALUE_sk_type(sk), ossl_check_ASN1_VALUE_compfunc_type(cmp)))
928int ASN1_item_ex_new(ASN1_VALUE **pval,
const ASN1_ITEM *it);
929void ASN1_item_ex_free(ASN1_VALUE **pval,
const ASN1_ITEM *it);
931int ASN1_item_ex_d2i(ASN1_VALUE **pval,
const unsigned char **in,
long len,
932 const ASN1_ITEM *it,
int tag,
int aclass,
char opt,
935int ASN1_item_ex_i2d(
const ASN1_VALUE **pval,
unsigned char **out,
936 const ASN1_ITEM *it,
int tag,
int aclass);
939# define IMPLEMENT_ASN1_FUNCTIONS_const(name) IMPLEMENT_ASN1_FUNCTIONS(name)
940# define IMPLEMENT_ASN1_ENCODE_FUNCTIONS_const_fname(stname, itname, fname) \
941 IMPLEMENT_ASN1_ENCODE_FUNCTIONS_fname(stname, itname, fname)