inner structures tagging fix. see 0.9.5 comment in ChangeLog

git-svn-id: https://asn1c.svn.sourceforge.net/svnroot/asn1c/trunk@311 59561ff5-6e30-0410-9f3c-9617f08c8826
This commit is contained in:
vlm 2004-09-13 08:31:01 +00:00
parent 83204112b9
commit 72425de1aa
43 changed files with 588 additions and 150 deletions

View File

@ -15,7 +15,7 @@ uint8_t buf1[] = {
2, /* L */
150,
70,
/* b BOOLEAN */
/* b [2] IMPLICIT BOOLEAN */
128 | 2, /* [2] */
1, /* L */
0xff,
@ -26,30 +26,35 @@ uint8_t buf1[] = {
10, /* [UNIVERSAL 10] */
1, /* L */
222,
/* e OCTET STRING */
4, /* [UNIVERSAL 4] */
3, /* L */
'x',
'y',
'z',
/* f OCTET STRING */
32 | 4, /* [UNIVERSAL 4], constructed */
/*
* X.690 specifies that inner structures must be tagged by
* stripping off the outer tag for each subsequent level.
*/
/* f [5] IMPLICIT VisibleString */
128 | 32 | 5, /* [5], constructed */
128, /* L indefinite */
4, /* [UNIVERSAL 4], primitive */
26, /* [UNIVERSAL 26] (VisibleString), primitive */
2,
'l',
'o',
32 | 4, /* [UNIVERSAL 4], recursively constructed */
32 | 26, /* [UNIVERSAL 26], recursively constructed */
128,
4,
4, /* [UNIVERSAL 4] (OCTET STRING), primitive */
1,
'v',
4,
4, /* [UNIVERSAL 4], primitive */
2,
'e',
'_',
0,
0,
4, /* [UNIVERSAL 4], primitive */
26, /* [UNIVERSAL 26], primitive */
2,
'i',
't',
@ -61,8 +66,8 @@ uint8_t buf1[] = {
2, /* Skip 2 bits */
147,
150, /* => 148 */
/* h BIT STRING */
32 | 3, /* [UNIVERSAL 3], constructed */
/* h [7] BIT STRING */
128 | 32 | 7, /* [7], constructed */
128, /* L indefinite */
3, /* [UNIVERSAL 3], primitive */
3, /* L */
@ -73,7 +78,7 @@ uint8_t buf1[] = {
2, /* L */
1, /* Skip 1 bit */
143, /* => 142 */
0, /* End of f */
0, /* End of h */
0,
0, /* End of the whole structure */
0,

View File

@ -29,9 +29,15 @@ static int check_if_extensible(asn1p_expr_t *expr);
static int expr_better_indirect(arg_t *arg, asn1p_expr_t *expr);
static int expr_elements_count(arg_t *arg, asn1p_expr_t *expr);
static int emit_member_table(arg_t *arg, asn1p_expr_t *expr);
static int emit_tags_vector(arg_t *arg, asn1p_expr_t *expr);
static int emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count);
enum tvm_compat {
_TVM_SAME = 0, /* tags and all_tags are same */
_TVM_SUBSET = 1, /* tags are subset of all_tags */
_TVM_DIFFERENT = 2, /* tags and all_tags are different */
};
static enum tvm_compat emit_tags_vectors(arg_t *arg, asn1p_expr_t *expr, int *tc, int *atc);
enum etd_cp {
ETD_CP_UNKNOWN = -2,
ETD_CP_EITHER = -1,
@ -42,7 +48,7 @@ enum etd_spec {
ETD_NO_SPECIFICS,
ETD_HAS_SPECIFICS
};
static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int elements_count, enum etd_cp, enum etd_spec);
static int emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_cp, enum etd_spec);
#define C99_MODE (!(arg->flags & A1C_NO_C99))
#define UNNAMED_UNIONS (arg->flags & A1C_UNNAMED_UNIONS)
@ -175,6 +181,8 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
tag2el_t *tag2el = NULL;
int tag2el_count = 0;
int tags_count;
int all_tags_count;
enum tvm_compat tv_mode;
char *p;
/*
@ -212,9 +220,9 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
OUT("};\n");
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_[all_]tags[] vectors.
*/
tags_count = emit_tags_vector(arg, expr);
tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count);
/*
* Tags to elements map.
@ -238,7 +246,7 @@ asn1c_lang_C_type_SEQUENCE_def(arg_t *arg) {
/*
* Emit asn1_DEF_xxx table.
*/
emit_type_DEF(arg, expr, tags_count, elements,
emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, elements,
ETD_CP_CONSTRUCTED, ETD_HAS_SPECIFICS);
REDIR(OT_TYPE_DECLS);
@ -322,6 +330,8 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
tag2el_t *tag2el = NULL;
int tag2el_count = 0;
int tags_count;
int all_tags_count;
enum tvm_compat tv_mode;
char *p;
/*
@ -359,9 +369,9 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
OUT("};\n");
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_[all_]tags[] vectors.
*/
tags_count = emit_tags_vector(arg, expr);
tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count);
/*
* Tags to elements map.
@ -417,7 +427,7 @@ asn1c_lang_C_type_SET_def(arg_t *arg) {
/*
* Emit asn1_DEF_xxx table.
*/
emit_type_DEF(arg, expr, tags_count, elements,
emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, elements,
ETD_CP_CONSTRUCTED, ETD_HAS_SPECIFICS);
REDIR(OT_TYPE_DECLS);
@ -483,6 +493,8 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
asn1p_expr_t *expr = arg->expr;
asn1p_expr_t *v;
int tags_count;
int all_tags_count;
enum tvm_compat tv_mode;
char *p;
/*
@ -511,9 +523,9 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
OUT("};\n");
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_[all_]tags[] vectors.
*/
tags_count = emit_tags_vector(arg, expr);
tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count);
p = MKID(expr->Identifier);
OUT("static asn1_SET_OF_specifics_t asn1_DEF_%s_specs = {\n", p);
@ -526,7 +538,7 @@ asn1c_lang_C_type_SEx_OF_def(arg_t *arg, int seq_of) {
/*
* Emit asn1_DEF_xxx table.
*/
emit_type_DEF(arg, expr, tags_count, 1,
emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, 1,
ETD_CP_CONSTRUCTED, ETD_HAS_SPECIFICS);
REDIR(OT_TYPE_DECLS);
@ -600,6 +612,8 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
tag2el_t *tag2el = NULL;
int tag2el_count = 0;
int tags_count;
int all_tags_count;
enum tvm_compat tv_mode;
char *p;
/*
@ -641,9 +655,11 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
/*
* Our parent structure has already taken this into account.
*/
tags_count = 0;
tv_mode = _TVM_SAME;
tags_count = all_tags_count = 0;
} else {
tags_count = emit_tags_vector(arg, expr);
tv_mode = emit_tags_vectors(arg, expr,
&tags_count, &all_tags_count);
}
/*
@ -668,7 +684,7 @@ asn1c_lang_C_type_CHOICE_def(arg_t *arg) {
/*
* Emit asn1_DEF_xxx table.
*/
emit_type_DEF(arg, expr, tags_count, elements,
emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, elements,
ETD_CP_CONSTRUCTED /*either?!*/, ETD_HAS_SPECIFICS);
REDIR(OT_TYPE_DECLS);
@ -724,6 +740,8 @@ int
asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
asn1p_expr_t *expr = arg->expr;
int tags_count;
int all_tags_count;
enum tvm_compat tv_mode;
char *p;
if(arg->embed) {
@ -754,11 +772,11 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
REDIR(OT_STAT_DEFS);
/*
* Print out asn1_DEF_<type>_tags[] vector.
* Print out asn1_DEF_<type>_[all_]tags[] vectors.
*/
tags_count = emit_tags_vector(arg, expr);
tv_mode = emit_tags_vectors(arg, expr, &tags_count, &all_tags_count);
emit_type_DEF(arg, expr, tags_count, 0,
emit_type_DEF(arg, expr, tv_mode, tags_count, all_tags_count, 0,
ETD_CP_UNKNOWN, ETD_NO_SPECIFICS);
REDIR(OT_CODE);
@ -816,9 +834,11 @@ asn1c_lang_C_type_SIMPLE_TYPE(arg_t *arg) {
OUT("td->free_struct = asn1_DEF_%s.free_struct;\n", type_name);
OUT("td->print_struct = asn1_DEF_%s.print_struct;\n", type_name);
if(!terminal && !tags_count) {
OUT("/* The next two lines are because of -fknown-extern-type */\n");
OUT("/* The next four lines are here because of -fknown-extern-type */\n");
OUT("td->tags = asn1_DEF_%s.tags;\n", type_name);
OUT("td->tags_count = asn1_DEF_%s.tags_count;\n", type_name);
OUT("td->all_tags = asn1_DEF_%s.all_tags;\n", type_name);
OUT("td->all_tags_count = asn1_DEF_%s.all_tags_count;\n",type_name);
OUT("/* End of these lines */\n");
}
OUT("td->last_tag_form = asn1_DEF_%s.last_tag_form;\n", type_name);
@ -1122,33 +1142,77 @@ emit_tag2member_map(arg_t *arg, tag2el_t *tag2el, int tag2el_count) {
return 0;;
}
static int
emit_tags_vector(arg_t *arg, asn1p_expr_t *expr) {
struct asn1p_type_tag_s *tags = 0;
static enum tvm_compat
emit_tags_vectors(arg_t *arg, asn1p_expr_t *expr, int *tags_count_r, int *all_tags_count_r) {
struct asn1p_type_tag_s *tags = 0; /* Effective tags */
struct asn1p_type_tag_s *all_tags = 0; /* The full array */
int tags_count = 0;
int all_tags_count = 0;
enum tvm_compat tv_mode = _TVM_SAME;
int i;
/* Fetch a chain of tags */
tags_count = asn1f_fetch_tags(arg->asn, arg->mod, expr, &tags, 0);
if(tags_count <= 0)
return 0;
if(tags_count < 0) return -1;
OUT("static ber_tlv_tag_t asn1_DEF_%s_tags[] = {\n",
MKID(expr->Identifier));
INDENT(+1);
/* Print the array of collected tags */
for(i = 0; i < tags_count; i++) {
if(i) OUT(",\n");
_print_tag(arg, &tags[i]);
/* Fetch a chain of tags */
all_tags_count = asn1f_fetch_tags(arg->asn, arg->mod, expr,
&all_tags, AFT_FULL_COLLECT);
if(all_tags_count < 0) {
if(tags) free(tags);
return -1;
}
OUT("\n");
INDENT(-1);
OUT("};\n");
assert(tags_count <= all_tags_count);
assert((tags_count?0:1) == (all_tags_count?0:1));
free(tags);
return tags_count;
if(tags_count <= all_tags_count) {
for(i = 0; i < tags_count; i++) {
if(tags[i].tag_value != all_tags[i].tag_value
|| tags[i].tag_class != all_tags[i].tag_class) {
tv_mode = _TVM_DIFFERENT;
break;
}
}
if(i == tags_count && tags_count < all_tags_count)
tv_mode = _TVM_SUBSET;
} else {
tv_mode = _TVM_DIFFERENT;
}
#define EMIT_TAGS_TABLE(name, tags, tags_count) do { \
OUT("static ber_tlv_tag_t asn1_DEF_%s%s_tags[] = {\n", \
MKID(expr->Identifier), name); \
INDENT(+1); \
/* Print the array of collected tags */ \
for(i = 0; i < tags_count; i++) { \
if(i) OUT(",\n"); \
_print_tag(arg, &tags[i]); \
} \
OUT("\n"); \
INDENT(-1); \
OUT("};\n"); \
} while(0)
if(tags_count) {
if(tv_mode == _TVM_SUBSET)
EMIT_TAGS_TABLE("", all_tags, all_tags_count);
else
EMIT_TAGS_TABLE("", tags, tags_count);
}
if(all_tags_count) {
if(tv_mode == _TVM_DIFFERENT)
EMIT_TAGS_TABLE("_all", all_tags, all_tags_count);
}
if(tags) free(tags);
if(all_tags) free(all_tags);
*tags_count_r = tags_count;
*all_tags_count_r = all_tags_count;
return tv_mode;
}
static int
@ -1293,14 +1357,14 @@ emit_member_table(arg_t *arg, asn1p_expr_t *expr) {
}
static int
emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int elements_count, enum etd_cp cp, enum etd_spec spec) {
emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, enum tvm_compat tv_mode, int tags_count, int all_tags_count, int elements_count, enum etd_cp cp, enum etd_spec spec) {
char *p;
p = MKID(expr->Identifier);
if(HIDE_INNER_DEFS)
OUT("static /* Use -fall-defs-global to expose */\n");
OUT("asn1_TYPE_descriptor_t asn1_DEF_%s = {\n", p);
INDENTED(
INDENT(+1);
OUT("\"%s\",\n", expr->_anonymous_type?"":expr->Identifier);
if(expr->expr_type & ASN_CONSTR_MASK) {
@ -1324,11 +1388,29 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int elements_count
if(tags_count) {
OUT("asn1_DEF_%s_tags,\n", p);
OUT("sizeof(asn1_DEF_%s_tags)\n", p);
OUT("\t/sizeof(asn1_DEF_%s_tags[0]), /* %d */\n",
p, tags_count);
OUT("\t/sizeof(asn1_DEF_%s_tags[0])", p);
if(tv_mode == _TVM_SUBSET
&& tags_count != all_tags_count)
OUT(" - %d", all_tags_count - tags_count);
OUT(", /* %d */\n", tags_count);
} else {
OUT("0,\t/* No explicit tags (pointer) */\n");
OUT("0,\t/* No explicit tags (count) */\n");
OUT("0,\t/* No effective tags (pointer) */\n");
OUT("0,\t/* No effective tags (count) */\n");
}
if(all_tags_count && tv_mode == _TVM_DIFFERENT) {
OUT("asn1_DEF_%s_all_tags,\n", p);
OUT("sizeof(asn1_DEF_%s_all_tags)\n", p);
OUT("\t/sizeof(asn1_DEF_%s_all_tags[0]), /* %d */\n",
p, all_tags_count);
} else if(all_tags_count) {
OUT("asn1_DEF_%s_tags,\t/* Same as above */\n", p);
OUT("sizeof(asn1_DEF_%s_tags)\n", p);
OUT("\t/sizeof(asn1_DEF_%s_tags[0]), /* %d */\n",
p, all_tags_count);
} else {
OUT("0,\t/* No tags (pointer) */\n");
OUT("0,\t/* No tags (count) */\n");
}
switch(cp) {
@ -1371,7 +1453,7 @@ emit_type_DEF(arg_t *arg, asn1p_expr_t *expr, int tags_count, int elements_count
case ETD_HAS_SPECIFICS:
OUT("&asn1_DEF_%s_specs\t/* Additional specs */\n", p);
}
);
INDENT(-1);
OUT("};\n");
OUT("\n");

View File

@ -2,7 +2,7 @@
#define ADD_TAG(skip, newtag) do { \
void *__p; \
if(skip) { \
if(skip && !(flags & AFT_FULL_COLLECT)) { \
if(newtag.tag_mode != TM_IMPLICIT) \
skip--; \
break; \

View File

@ -4,6 +4,7 @@
enum asn1f_aft_flags_e {
AFT_IMAGINARY_ANY = 0x01, /* Treat ANY tag as [IMAGINARY ANY] */
AFT_FETCH_OUTMOST = 0x02, /* Fetch only outmost tag */
AFT_FULL_COLLECT = 0x04, /* Collect all tags */
};
/*

View File

@ -19,6 +19,9 @@ asn1_TYPE_descriptor_t asn1_DEF_BIT_STRING = {
OCTET_STRING_free, /* Implemented in terms of OCTET STRING */
0, /* Use generic outmost tag fetcher */
asn1_DEF_BIT_STRING_tags,
sizeof(asn1_DEF_BIT_STRING_tags)
/ sizeof(asn1_DEF_BIT_STRING_tags[0]),
asn1_DEF_BIT_STRING_tags, /* Same as above */
sizeof(asn1_DEF_BIT_STRING_tags)
/ sizeof(asn1_DEF_BIT_STRING_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* BMPString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_BMPString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (30 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (30 << 2)), /* [UNIVERSAL 30] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_BMPString = {
"BMPString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_BMPString = {
OCTET_STRING_free, /* -//- */
0, /* Use generic outmost tag fetcher */
asn1_DEF_BMPString_tags,
sizeof(asn1_DEF_BMPString_tags)
/ sizeof(asn1_DEF_BMPString_tags[0]) - 1,
asn1_DEF_BMPString_tags,
sizeof(asn1_DEF_BMPString_tags)
/ sizeof(asn1_DEF_BMPString_tags[0]),
-1, /* Both ways are fine */

View File

@ -19,7 +19,9 @@ asn1_TYPE_descriptor_t asn1_DEF_BOOLEAN = {
BOOLEAN_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_BOOLEAN_tags,
sizeof(asn1_DEF_BOOLEAN_tags)/sizeof(asn1_DEF_BOOLEAN_tags[0]),
sizeof(asn1_DEF_BOOLEAN_tags) / sizeof(asn1_DEF_BOOLEAN_tags[0]),
asn1_DEF_BOOLEAN_tags, /* Same as above */
sizeof(asn1_DEF_BOOLEAN_tags) / sizeof(asn1_DEF_BOOLEAN_tags[0]),
0, /* Always in primitive form */
0, 0, /* No members */
0 /* No specifics */

View File

@ -19,7 +19,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ENUMERATED = {
INTEGER_free, /* Implemented in terms of INTEGER */
0, /* Use generic outmost tag fetcher */
asn1_DEF_ENUMERATED_tags,
sizeof(asn1_DEF_ENUMERATED_tags)/sizeof(asn1_DEF_ENUMERATED_tags[0]),
sizeof(asn1_DEF_ENUMERATED_tags) / sizeof(asn1_DEF_ENUMERATED_tags[0]),
asn1_DEF_ENUMERATED_tags, /* Same as above */
sizeof(asn1_DEF_ENUMERATED_tags) / sizeof(asn1_DEF_ENUMERATED_tags[0]),
0, /* Primitive */
0, 0, /* No members */
0 /* No specifics */

View File

@ -8,7 +8,8 @@
* GeneralString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_GeneralString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (27 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (27 << 2)), /* [UNIVERSAL 27] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_GeneralString = {
"GeneralString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_GeneralString_tags,
sizeof(asn1_DEF_GeneralString_tags)
/ sizeof(asn1_DEF_GeneralString_tags[0]) - 1,
asn1_DEF_GeneralString_tags,
sizeof(asn1_DEF_GeneralString_tags)
/ sizeof(asn1_DEF_GeneralString_tags[0]),
-1, /* Both ways are fine */

View File

@ -83,6 +83,9 @@ asn1_TYPE_descriptor_t asn1_DEF_GeneralizedTime = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_GeneralizedTime_tags,
sizeof(asn1_DEF_GeneralizedTime_tags)
/ sizeof(asn1_DEF_GeneralizedTime_tags[0]),
asn1_DEF_GeneralizedTime_tags, /* Same as above */
sizeof(asn1_DEF_GeneralizedTime_tags)
/ sizeof(asn1_DEF_GeneralizedTime_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* GraphicString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_GraphicString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (25 << 2)), /* [UNIVERSAL 25] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_GraphicString = {
"GraphicString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_GraphicString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_GraphicString_tags,
sizeof(asn1_DEF_GraphicString_tags)
/ sizeof(asn1_DEF_GraphicString_tags[0]) - 1,
asn1_DEF_GraphicString_tags,
sizeof(asn1_DEF_GraphicString_tags)
/ sizeof(asn1_DEF_GraphicString_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* IA5String basic type description.
*/
static ber_tlv_tag_t asn1_DEF_IA5String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (22 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (22 << 2)), /* [UNIVERSAL 22] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_IA5String = {
"IA5String",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_IA5String = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_IA5String_tags,
sizeof(asn1_DEF_IA5String_tags)
/ sizeof(asn1_DEF_IA5String_tags[0]) - 1,
asn1_DEF_IA5String_tags,
sizeof(asn1_DEF_IA5String_tags)
/ sizeof(asn1_DEF_IA5String_tags[0]),
-1, /* Both ways are fine */

View File

@ -21,7 +21,9 @@ asn1_TYPE_descriptor_t asn1_DEF_INTEGER = {
INTEGER_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_INTEGER_tags,
sizeof(asn1_DEF_INTEGER_tags)/sizeof(asn1_DEF_INTEGER_tags[0]),
sizeof(asn1_DEF_INTEGER_tags) / sizeof(asn1_DEF_INTEGER_tags[0]),
asn1_DEF_INTEGER_tags, /* Same as above */
sizeof(asn1_DEF_INTEGER_tags) / sizeof(asn1_DEF_INTEGER_tags[0]),
0, /* Always in primitive form */
0, 0, /* No members */
0 /* No specifics */

View File

@ -8,7 +8,8 @@
* ISO646String basic type description.
*/
static ber_tlv_tag_t asn1_DEF_ISO646String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_ISO646String = {
"ISO646String",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ISO646String = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_ISO646String_tags,
sizeof(asn1_DEF_ISO646String_tags)
/ sizeof(asn1_DEF_ISO646String_tags[0]) - 1,
asn1_DEF_ISO646String_tags,
sizeof(asn1_DEF_ISO646String_tags)
/ sizeof(asn1_DEF_ISO646String_tags[0]),
-1, /* Both ways are fine */

View File

@ -20,7 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_NULL = {
BOOLEAN_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_NULL_tags,
sizeof(asn1_DEF_NULL_tags)/sizeof(asn1_DEF_NULL_tags[0]),
sizeof(asn1_DEF_NULL_tags) / sizeof(asn1_DEF_NULL_tags[0]),
asn1_DEF_NULL_tags, /* Same as above */
sizeof(asn1_DEF_NULL_tags) / sizeof(asn1_DEF_NULL_tags[0]),
0, /* Always in primitive form */
0, 0, /* No members */
0 /* No specifics */

View File

@ -26,7 +26,9 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeEnumerated = {
NativeInteger_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_NativeEnumerated_tags,
sizeof(asn1_DEF_NativeEnumerated_tags)/sizeof(asn1_DEF_NativeEnumerated_tags[0]),
sizeof(asn1_DEF_NativeEnumerated_tags) / sizeof(asn1_DEF_NativeEnumerated_tags[0]),
asn1_DEF_NativeEnumerated_tags, /* Same as above */
sizeof(asn1_DEF_NativeEnumerated_tags) / sizeof(asn1_DEF_NativeEnumerated_tags[0]),
0, /* Always in primitive form */
0, 0, /* No members */
0 /* No specifics */

View File

@ -28,7 +28,9 @@ asn1_TYPE_descriptor_t asn1_DEF_NativeInteger = {
NativeInteger_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_NativeInteger_tags,
sizeof(asn1_DEF_NativeInteger_tags)/sizeof(asn1_DEF_NativeInteger_tags[0]),
sizeof(asn1_DEF_NativeInteger_tags) / sizeof(asn1_DEF_NativeInteger_tags[0]),
asn1_DEF_NativeInteger_tags, /* Same as above */
sizeof(asn1_DEF_NativeInteger_tags) / sizeof(asn1_DEF_NativeInteger_tags[0]),
0, /* Always in primitive form */
0, 0, /* No members */
0 /* No specifics */

View File

@ -8,7 +8,8 @@
* NumericString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_NumericString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (18 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (18 << 2)), /* [UNIVERSAL 18] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_NumericString = {
"NumericString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_NumericString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_NumericString_tags,
sizeof(asn1_DEF_NumericString_tags)
/ sizeof(asn1_DEF_NumericString_tags[0]) - 1,
asn1_DEF_NumericString_tags,
sizeof(asn1_DEF_NumericString_tags)
/ sizeof(asn1_DEF_NumericString_tags[0]),
-1, /* Both ways are fine */

View File

@ -22,6 +22,9 @@ asn1_TYPE_descriptor_t asn1_DEF_OBJECT_IDENTIFIER = {
INTEGER_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_OBJECT_IDENTIFIER_tags,
sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags)
/ sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags[0]),
asn1_DEF_OBJECT_IDENTIFIER_tags, /* Same as above */
sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags)
/ sizeof(asn1_DEF_OBJECT_IDENTIFIER_tags[0]),
0, /* Always in primitive form */
@ -98,7 +101,7 @@ OBJECT_IDENTIFIER_constraint(asn1_TYPE_descriptor_t *td, const void *sptr,
int
OBJECT_IDENTIFIER_get_single_arc(uint8_t *arcbuf, unsigned int arclen, signed int add, void *rvbuf, unsigned int rvsize) {
unsigned LE = 1; /* Little endian (x86) */
unsigned LE __attribute__ ((unused)) = 1; /* Little endian (x86) */
uint8_t *arcend = arcbuf + arclen; /* End of arc */
void *rvstart = rvbuf; /* Original start of the value buffer */
unsigned int cache = 0; /* No more than 14 significant bits */

View File

@ -1,5 +1,5 @@
/*-
* Copyright (c) 2003 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Copyright (c) 2003, 2004 Lev Walkin <vlm@lionet.info>. All rights reserved.
* Redistribution and modifications are permitted subject to BSD license.
*/
#include <OCTET_STRING.h>
@ -21,6 +21,9 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_OCTET_STRING_tags,
sizeof(asn1_DEF_OCTET_STRING_tags)
/ sizeof(asn1_DEF_OCTET_STRING_tags[0]),
asn1_DEF_OCTET_STRING_tags, /* Same as above */
sizeof(asn1_DEF_OCTET_STRING_tags)
/ sizeof(asn1_DEF_OCTET_STRING_tags[0]),
-1, /* Both ways are fine (primitive and constructed) */
@ -54,6 +57,7 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
size_t _ns = ctx->step; /* Allocated */ \
if(_ns <= (size_t)(st->size + _bs)) { \
void *ptr; \
/* Be nice and round to the memory allocator */ \
do { _ns = _ns ? _ns<<2 : 16; } \
while(_ns <= (size_t)(st->size + _bs)); \
ptr = REALLOC(st->buf, _ns); \
@ -81,6 +85,7 @@ asn1_TYPE_descriptor_t asn1_DEF_OCTET_STRING = {
*/
struct _stack_el {
ber_tlv_len_t left; /* What's left to read */
int cont_level; /* Depth of subcontainment */
int want_nulls; /* Want null "end of content" octets? */
int bits_chopped; /* Flag in BIT STRING mode */
struct _stack_el *prev;
@ -95,17 +100,23 @@ static struct _stack_el *
_add_stack_el(struct _stack *st) {
struct _stack_el *nel;
/*
* Reuse the old stack frame or allocate a new one.
*/
if(st->cur_ptr && st->cur_ptr->next) {
nel = st->cur_ptr->next;
nel->left = 0;
nel->want_nulls = 0;
nel->bits_chopped = 0;
/* Retain nel->cont_level, it's correct. */
} else {
(void *)nel = CALLOC(1, sizeof(struct _stack_el));
if(nel == NULL)
return NULL;
if(st->tail) {
/* Increase a subcontainment depth */
nel->cont_level = st->tail->cont_level + 1;
st->tail->next = nel;
}
nel->prev = st->tail;
@ -136,13 +147,16 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
OCTET_STRING_t *st = (OCTET_STRING_t *)*os_structure;
ber_dec_rval_t rval;
ber_dec_ctx_t *ctx;
ber_tlv_tag_t terminal_tag; /* Inner tag for constructed types */
ssize_t consumed_myself = 0;
struct _stack *stck; /* A stack structure */
struct _stack_el *sel; /* Stack element */
int tlv_constr;
int is_bit_str = 0; /* See below under switch(td->specifics) */
int is_ANY_type = 0; /* See below under switch(td->specifics) */
enum type_type_e {
_TT_GENERIC = 0, /* Just a random OCTET STRING */
_TT_BIT_STRING = -1, /* BIT STRING type, a special case */
_TT_ANY = 1, /* ANY type, a special case too */
} type_type
= (enum type_type_e)(int)td->specifics; /* An ugly hack */
ASN_DEBUG("Decoding %s as %s (%ld)",
td->name, "OCTET STRING", (long)size);
@ -159,25 +173,6 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
/* Restore parsing context */
ctx = &st->_ber_dec_ctx;
switch((int)td->specifics) {
case 0:
terminal_tag = asn1_DEF_OCTET_STRING_tags[0]; /* [U4] */
break;
case -1: /* BIT STRING */
/*
* This is some sort of a hack.
* The OCTET STRING decoder is being used in BIT STRING mode.
*/
is_bit_str = 1;
terminal_tag = ASN_TAG_CLASS_UNIVERSAL | (3 << 2);
break;
default: /* Just in case; fall through */
case 1: /* ANY type */
is_ANY_type = 1;
terminal_tag = -1;
break;
}
switch(ctx->phase) {
case 0:
/*
@ -212,7 +207,7 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
stck->cur_ptr->left,
stck->cur_ptr->want_nulls);
#endif
if(is_bit_str) {
if(type_type == _TT_BIT_STRING) {
/* Number of meaningless tail bits */
APPEND("\0", 1);
}
@ -224,7 +219,8 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
* Jump into stackless primitive decoding.
*/
_CH_PHASE(ctx, 3);
if(is_ANY_type) APPEND(buf_ptr, rval.consumed);
if(type_type == _TT_ANY)
APPEND(buf_ptr, rval.consumed);
ADVANCE(rval.consumed);
goto phase3;
}
@ -241,6 +237,7 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
do {
ber_tlv_tag_t tlv_tag;
ber_tlv_len_t tlv_len;
ber_tlv_tag_t expected_tag;
ssize_t tl, ll;
ASN_DEBUG("fetch tag(size=%d), %sstack, left=%d, want0=%d",
@ -271,7 +268,7 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
&& ((uint8_t *)buf_ptr)[1] == 0)
{
ADVANCE(2);
if(is_ANY_type) APPEND("\0\0", 2);
if(type_type == _TT_ANY) APPEND("\0\0", 2);
ASN_DEBUG("Eat EOC; wn=%d--", sel->want_nulls);
@ -294,8 +291,38 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
}
continue;
} else if(tlv_tag != terminal_tag
&& terminal_tag != (ber_tlv_tag_t)-1) {
}
/*
* Set up expected tags,
* depending on ASN.1 type being decoded.
*/
switch(type_type) {
case _TT_BIT_STRING:
/* X.690: 8.6.4.1, NOTE 2 */
/* Fall through */
case _TT_GENERIC:
default:
if(sel) {
int level = sel->cont_level;
if(level < td->all_tags_count) {
expected_tag = td->all_tags[level];
break;
} else if(td->all_tags_count) {
expected_tag = td->all_tags
[td->all_tags_count - 1];
break;
}
/* else, Fall through */
}
/* Fall through */
case _TT_ANY:
expected_tag = tlv_tag;
break;
}
if(tlv_tag != expected_tag) {
char buf[2][32];
ber_tlv_tag_snprint(tlv_tag,
buf[0], sizeof(buf[0]));
@ -313,17 +340,18 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
if(sel) {
sel->want_nulls = (tlv_len==-1);
sel->left = tlv_len;
ASN_DEBUG("+EXPECT2 left=%d wn=%d",
sel->left, sel->want_nulls);
ASN_DEBUG("+EXPECT2 left=%d wn=%d, clvl=%d",
sel->left, sel->want_nulls, sel->cont_level);
} else {
RETURN(RC_FAIL);
}
if(is_ANY_type) APPEND(buf_ptr, tl + ll);
if(type_type == _TT_ANY) APPEND(buf_ptr, tl + ll);
ADVANCE(tl+ll);
} while(tlv_constr);
if(sel == NULL) {
/* Finished operation, "phase out" */
ASN_DEBUG("Phase out");
_CH_PHASE(ctx, +3);
break;
}
@ -343,7 +371,8 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
len = ((ber_tlv_len_t)size < sel->left)
? (ber_tlv_len_t)size : sel->left;
if(len > 0) {
if(is_bit_str && sel->bits_chopped == 0) {
if(type_type == _TT_BIT_STRING
&& sel->bits_chopped == 0) {
/*
* Finalize the previous chunk:
* strip down unused bits.
@ -394,7 +423,7 @@ OCTET_STRING_decode_ber(asn1_TYPE_descriptor_t *td,
/*
* BIT STRING-specific processing.
*/
if(is_bit_str && st->size >= 2) {
if(type_type == _TT_BIT_STRING && st->size >= 2) {
/* Finalize BIT STRING: zero out unused bits. */
st->buf[st->size-1] &= 0xff << st->buf[0];
}

View File

@ -8,7 +8,8 @@
* ObjectDescriptor basic type description.
*/
static ber_tlv_tag_t asn1_DEF_ObjectDescriptor_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (7 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (7 << 2)), /* [UNIVERSAL 7] IMPLICIT ... */
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor = {
"ObjectDescriptor",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ObjectDescriptor = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_ObjectDescriptor_tags,
sizeof(asn1_DEF_ObjectDescriptor_tags)
/ sizeof(asn1_DEF_ObjectDescriptor_tags[0]) - 1,
asn1_DEF_ObjectDescriptor_tags,
sizeof(asn1_DEF_ObjectDescriptor_tags)
/ sizeof(asn1_DEF_ObjectDescriptor_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* PrintableString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_PrintableString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (19 << 2)), /* [UNIVERSAL 19] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_PrintableString = {
"PrintableString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_PrintableString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_PrintableString_tags,
sizeof(asn1_DEF_PrintableString_tags)
/ sizeof(asn1_DEF_PrintableString_tags[0]) - 1,
asn1_DEF_PrintableString_tags,
sizeof(asn1_DEF_PrintableString_tags)
/ sizeof(asn1_DEF_PrintableString_tags[0]),
-1, /* Both ways are fine */

View File

@ -22,6 +22,9 @@ asn1_TYPE_descriptor_t asn1_DEF_RELATIVE_OID = {
INTEGER_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_RELATIVE_OID_tags,
sizeof(asn1_DEF_RELATIVE_OID_tags)
/ sizeof(asn1_DEF_RELATIVE_OID_tags[0]),
asn1_DEF_RELATIVE_OID_tags, /* Same as above */
sizeof(asn1_DEF_RELATIVE_OID_tags)
/ sizeof(asn1_DEF_RELATIVE_OID_tags[0]),
0, /* Always in primitive form */

View File

@ -8,7 +8,8 @@
* T61String basic type description.
*/
static ber_tlv_tag_t asn1_DEF_T61String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_T61String = {
"T61String",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T61String = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T61String_tags,
sizeof(asn1_DEF_T61String_tags)
/ sizeof(asn1_DEF_T61String_tags[0]) - 1,
asn1_DEF_T61String_tags,
sizeof(asn1_DEF_T61String_tags)
/ sizeof(asn1_DEF_T61String_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* TeletexString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_TeletexString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (20 << 2)), /* [UNIVERSAL 20] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_TeletexString = {
"TeletexString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_TeletexString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_TeletexString_tags,
sizeof(asn1_DEF_TeletexString_tags)
/ sizeof(asn1_DEF_TeletexString_tags[0]) - 1,
asn1_DEF_TeletexString_tags,
sizeof(asn1_DEF_TeletexString_tags)
/ sizeof(asn1_DEF_TeletexString_tags[0]),
-1, /* Both ways are fine */

View File

@ -25,6 +25,9 @@ asn1_TYPE_descriptor_t asn1_DEF_UTCTime = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_UTCTime_tags,
sizeof(asn1_DEF_UTCTime_tags)
/ sizeof(asn1_DEF_UTCTime_tags[0]),
asn1_DEF_UTCTime_tags, /* Same as above */
sizeof(asn1_DEF_UTCTime_tags)
/ sizeof(asn1_DEF_UTCTime_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* UTF8String basic type description.
*/
static ber_tlv_tag_t asn1_DEF_UTF8String_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (12 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (12 << 2)), /* [UNIVERSAL 12] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)), /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_UTF8String = {
"UTF8String",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_UTF8String = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_UTF8String_tags,
sizeof(asn1_DEF_UTF8String_tags)
/ sizeof(asn1_DEF_UTF8String_tags[0]) - 1,
asn1_DEF_UTF8String_tags,
sizeof(asn1_DEF_UTF8String_tags)
/ sizeof(asn1_DEF_UTF8String_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* UniversalString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_UniversalString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (28 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (28 << 2)), /* [UNIVERSAL 28] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_UniversalString = {
"UniversalString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_UniversalString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_UniversalString_tags,
sizeof(asn1_DEF_UniversalString_tags)
/ sizeof(asn1_DEF_UniversalString_tags[0]) - 1,
asn1_DEF_UniversalString_tags,
sizeof(asn1_DEF_UniversalString_tags)
/ sizeof(asn1_DEF_UniversalString_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* VideotexString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_VideotexString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (21 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (21 << 2)), /* [UNIVERSAL 21] IMPLICIT */
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_VideotexString = {
"VideotexString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_VideotexString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_VideotexString_tags,
sizeof(asn1_DEF_VideotexString_tags)
/ sizeof(asn1_DEF_VideotexString_tags[0]) - 1,
asn1_DEF_VideotexString_tags,
sizeof(asn1_DEF_VideotexString_tags)
/ sizeof(asn1_DEF_VideotexString_tags[0]),
-1, /* Both ways are fine */

View File

@ -8,7 +8,8 @@
* VisibleString basic type description.
*/
static ber_tlv_tag_t asn1_DEF_VisibleString_tags[] = {
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2))
(ASN_TAG_CLASS_UNIVERSAL | (26 << 2)), /* [UNIVERSAL 26] IMPLICIT ...*/
(ASN_TAG_CLASS_UNIVERSAL | (4 << 2)) /* ... OCTET STRING */
};
asn1_TYPE_descriptor_t asn1_DEF_VisibleString = {
"VisibleString",
@ -19,6 +20,9 @@ asn1_TYPE_descriptor_t asn1_DEF_VisibleString = {
OCTET_STRING_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_VisibleString_tags,
sizeof(asn1_DEF_VisibleString_tags)
/ sizeof(asn1_DEF_VisibleString_tags[0]) - 1,
asn1_DEF_VisibleString_tags,
sizeof(asn1_DEF_VisibleString_tags)
/ sizeof(asn1_DEF_VisibleString_tags[0]),
-1, /* Both ways are fine */

View File

@ -70,10 +70,13 @@ typedef struct asn1_TYPE_descriptor_s {
asn_outmost_tag_f *outmost_tag; /* <optional, internal> */
/*
* Tags that are expected, with some of their vital properties.
* Tags that are expected to occur.
*/
ber_tlv_tag_t *tags; /* At least one tag must be specified */
ber_tlv_tag_t *tags; /* Effective tags sequence for this type */
int tags_count; /* Number of tags which are expected */
ber_tlv_tag_t *all_tags;/* Every tag for BER/containment */
int all_tags_count; /* Number of tags */
int last_tag_form; /* Acceptable form of the tag (prim, constr) */
/*
@ -92,12 +95,13 @@ typedef struct asn1_TYPE_descriptor_s {
/*
* An element of the constructed type, i.e. SEQUENCE, SET, CHOICE.
*/
enum asn1_TYPE_flags_e {
ATF_NOFLAGS,
ATF_POINTER = 0x01, /* Represented by the pointer */
ATF_OPEN_TYPE = 0x02, /* ANY type, without meaningful tag */
};
typedef struct asn1_TYPE_member_s {
enum asn1_TYPE_flags_e {
ATF_NOFLAGS,
ATF_POINTER = 0x01, /* Represented by the pointer */
ATF_OPEN_TYPE = 0x02, /* ANY type, without meaningful tag */
} flags; /* Element's presentation flags */
enum asn1_TYPE_flags_e flags; /* Element's presentation flags */
int optional; /* Following optional members, including current */
int memb_offset; /* Offset of the element */
ber_tlv_tag_t tag; /* Outmost (most immediate) tag */

View File

@ -115,6 +115,9 @@ asn1_TYPE_descriptor_t asn1_DEF_toBeSigned = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_toBeSigned_tags,
sizeof(asn1_DEF_toBeSigned_tags)
/sizeof(asn1_DEF_toBeSigned_tags[0]), /* 1 */
asn1_DEF_toBeSigned_tags, /* Same as above */
sizeof(asn1_DEF_toBeSigned_tags)
/sizeof(asn1_DEF_toBeSigned_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -171,6 +174,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Certificate = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Certificate_tags,
sizeof(asn1_DEF_Certificate_tags)
/sizeof(asn1_DEF_Certificate_tags[0]), /* 1 */
asn1_DEF_Certificate_tags, /* Same as above */
sizeof(asn1_DEF_Certificate_tags)
/sizeof(asn1_DEF_Certificate_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -227,6 +233,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Name = {
SEQUENCE_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Name_tags,
sizeof(asn1_DEF_Name_tags)
/sizeof(asn1_DEF_Name_tags[0]), /* 1 */
asn1_DEF_Name_tags, /* Same as above */
sizeof(asn1_DEF_Name_tags)
/sizeof(asn1_DEF_Name_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -338,6 +347,9 @@ asn1_TYPE_descriptor_t asn1_DEF_RelativeDistinguishedName = {
SET_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_RelativeDistinguishedName_tags,
sizeof(asn1_DEF_RelativeDistinguishedName_tags)
/sizeof(asn1_DEF_RelativeDistinguishedName_tags[0]), /* 1 */
asn1_DEF_RelativeDistinguishedName_tags, /* Same as above */
sizeof(asn1_DEF_RelativeDistinguishedName_tags)
/sizeof(asn1_DEF_RelativeDistinguishedName_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */

View File

@ -20,9 +20,9 @@ BEGIN
a(1), b(2)
},
e OCTET STRING,
f OCTET STRING,
f [5] VisibleString,
g BIT STRING,
h BIT STRING,
h [7] BIT STRING,
...
}

View File

@ -46,6 +46,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Forest = {
SET_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Forest_tags,
sizeof(asn1_DEF_Forest_tags)
/sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
asn1_DEF_Forest_tags, /* Same as above */
sizeof(asn1_DEF_Forest_tags)
/sizeof(asn1_DEF_Forest_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -117,6 +120,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Tree = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Tree_tags,
sizeof(asn1_DEF_Tree_tags)
/sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
asn1_DEF_Tree_tags, /* Same as above */
sizeof(asn1_DEF_Tree_tags)
/sizeof(asn1_DEF_Tree_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -193,7 +199,8 @@ static asn1_TYPE_member_t asn1_MBR_trees[] = {
},
};
static ber_tlv_tag_t asn1_DEF_trees_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2))
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn1_SET_OF_specifics_t asn1_DEF_trees_specs = {
sizeof(struct trees),
@ -210,7 +217,10 @@ asn1_TYPE_descriptor_t asn1_DEF_trees = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_trees_tags,
sizeof(asn1_DEF_trees_tags)
/sizeof(asn1_DEF_trees_tags[0]), /* 1 */
/sizeof(asn1_DEF_trees_tags[0]) - 1, /* 1 */
asn1_DEF_trees_tags, /* Same as above */
sizeof(asn1_DEF_trees_tags)
/sizeof(asn1_DEF_trees_tags[0]), /* 2 */
1, /* Whether CONSTRUCTED */
asn1_MBR_trees,
1, /* Single element */
@ -250,6 +260,9 @@ asn1_TYPE_descriptor_t asn1_DEF_anything_member = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_anything_member_tags,
sizeof(asn1_DEF_anything_member_tags)
/sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
asn1_DEF_anything_member_tags, /* Same as above */
sizeof(asn1_DEF_anything_member_tags)
/sizeof(asn1_DEF_anything_member_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -268,7 +281,8 @@ static asn1_TYPE_member_t asn1_MBR_anything[] = {
},
};
static ber_tlv_tag_t asn1_DEF_anything_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (1 << 2))
(ASN_TAG_CLASS_CONTEXT | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn1_SET_OF_specifics_t asn1_DEF_anything_specs = {
sizeof(struct anything),
@ -285,7 +299,10 @@ asn1_TYPE_descriptor_t asn1_DEF_anything = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_anything_tags,
sizeof(asn1_DEF_anything_tags)
/sizeof(asn1_DEF_anything_tags[0]), /* 1 */
/sizeof(asn1_DEF_anything_tags[0]) - 1, /* 1 */
asn1_DEF_anything_tags, /* Same as above */
sizeof(asn1_DEF_anything_tags)
/sizeof(asn1_DEF_anything_tags[0]), /* 2 */
1, /* Whether CONSTRUCTED */
asn1_MBR_anything,
1, /* Single element */
@ -336,6 +353,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Stuff = {
SET_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Stuff_tags,
sizeof(asn1_DEF_Stuff_tags)
/sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
asn1_DEF_Stuff_tags, /* Same as above */
sizeof(asn1_DEF_Stuff_tags)
/sizeof(asn1_DEF_Stuff_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */

View File

@ -55,6 +55,9 @@ asn1_TYPE_descriptor_t asn1_DEF_collection = {
SEQUENCE_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_collection_tags,
sizeof(asn1_DEF_collection_tags)
/sizeof(asn1_DEF_collection_tags[0]), /* 1 */
asn1_DEF_collection_tags, /* Same as above */
sizeof(asn1_DEF_collection_tags)
/sizeof(asn1_DEF_collection_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -103,6 +106,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
asn1_DEF_T_tags, /* Same as above */
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -175,6 +181,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
asn1_DEF_T2_tags, /* Same as above */
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */

View File

@ -91,6 +91,9 @@ asn1_TYPE_descriptor_t asn1_DEF_varsets = {
SEQUENCE_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_varsets_tags,
sizeof(asn1_DEF_varsets_tags)
/sizeof(asn1_DEF_varsets_tags[0]), /* 1 */
asn1_DEF_varsets_tags, /* Same as above */
sizeof(asn1_DEF_varsets_tags)
/sizeof(asn1_DEF_varsets_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -139,6 +142,9 @@ asn1_TYPE_descriptor_t asn1_DEF_LogLine = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_LogLine_tags,
sizeof(asn1_DEF_LogLine_tags)
/sizeof(asn1_DEF_LogLine_tags[0]), /* 1 */
asn1_DEF_LogLine_tags, /* Same as above */
sizeof(asn1_DEF_LogLine_tags)
/sizeof(asn1_DEF_LogLine_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -231,6 +237,9 @@ asn1_TYPE_descriptor_t asn1_DEF_vparts = {
SEQUENCE_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_vparts_tags,
sizeof(asn1_DEF_vparts_tags)
/sizeof(asn1_DEF_vparts_tags[0]), /* 1 */
asn1_DEF_vparts_tags, /* Same as above */
sizeof(asn1_DEF_vparts_tags)
/sizeof(asn1_DEF_vparts_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -279,6 +288,9 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePartSet = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_VariablePartSet_tags,
sizeof(asn1_DEF_VariablePartSet_tags)
/sizeof(asn1_DEF_VariablePartSet_tags[0]), /* 1 */
asn1_DEF_VariablePartSet_tags, /* Same as above */
sizeof(asn1_DEF_VariablePartSet_tags)
/sizeof(asn1_DEF_VariablePartSet_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -399,6 +411,9 @@ asn1_TYPE_descriptor_t asn1_DEF_vset = {
SET_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_vset_tags,
sizeof(asn1_DEF_vset_tags)
/sizeof(asn1_DEF_vset_tags[0]), /* 1 */
asn1_DEF_vset_tags, /* Same as above */
sizeof(asn1_DEF_vset_tags)
/sizeof(asn1_DEF_vset_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -448,6 +463,9 @@ asn1_TYPE_descriptor_t asn1_DEF_vrange = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_vrange_tags,
sizeof(asn1_DEF_vrange_tags)
/sizeof(asn1_DEF_vrange_tags[0]), /* 1 */
asn1_DEF_vrange_tags, /* Same as above */
sizeof(asn1_DEF_vrange_tags)
/sizeof(asn1_DEF_vrange_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -493,8 +511,10 @@ asn1_TYPE_descriptor_t asn1_DEF_VariablePart = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_VariablePart,
2, /* Elements count */
@ -581,6 +601,9 @@ asn1_TYPE_descriptor_t asn1_DEF_email = {
SET_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_email_tags,
sizeof(asn1_DEF_email_tags)
/sizeof(asn1_DEF_email_tags[0]), /* 1 */
asn1_DEF_email_tags, /* Same as above */
sizeof(asn1_DEF_email_tags)
/sizeof(asn1_DEF_email_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -630,6 +653,9 @@ asn1_TYPE_descriptor_t asn1_DEF_notify = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_notify_tags,
sizeof(asn1_DEF_notify_tags)
/sizeof(asn1_DEF_notify_tags[0]), /* 1 */
asn1_DEF_notify_tags, /* Same as above */
sizeof(asn1_DEF_notify_tags)
/sizeof(asn1_DEF_notify_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -678,6 +704,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ActionItem = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_ActionItem_tags,
sizeof(asn1_DEF_ActionItem_tags)
/sizeof(asn1_DEF_ActionItem_tags[0]), /* 1 */
asn1_DEF_ActionItem_tags, /* Same as above */
sizeof(asn1_DEF_ActionItem_tags)
/sizeof(asn1_DEF_ActionItem_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */

View File

@ -64,6 +64,9 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member1 = {
SET_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_t_member1_tags,
sizeof(asn1_DEF_t_member1_tags)
/sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
asn1_DEF_t_member1_tags, /* Same as above */
sizeof(asn1_DEF_t_member1_tags)
/sizeof(asn1_DEF_t_member1_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -98,6 +101,9 @@ asn1_TYPE_descriptor_t asn1_DEF_t_member2 = {
SEQUENCE_OF_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_t_member2_tags,
sizeof(asn1_DEF_t_member2_tags)
/sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
asn1_DEF_t_member2_tags, /* Same as above */
sizeof(asn1_DEF_t_member2_tags)
/sizeof(asn1_DEF_t_member2_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -162,6 +168,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Test_structure_1 = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Test_structure_1_tags,
sizeof(asn1_DEF_Test_structure_1_tags)
/sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
asn1_DEF_Test_structure_1_tags, /* Same as above */
sizeof(asn1_DEF_Test_structure_1_tags)
/sizeof(asn1_DEF_Test_structure_1_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -223,7 +232,8 @@ static asn1_TYPE_member_t asn1_MBR_or[] = {
},
};
static ber_tlv_tag_t asn1_DEF_or_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (2 << 2))
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (17 << 2))
};
static asn1_SET_OF_specifics_t asn1_DEF_or_specs = {
sizeof(struct or),
@ -240,7 +250,10 @@ asn1_TYPE_descriptor_t asn1_DEF_or = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_or_tags,
sizeof(asn1_DEF_or_tags)
/sizeof(asn1_DEF_or_tags[0]), /* 1 */
/sizeof(asn1_DEF_or_tags[0]) - 1, /* 1 */
asn1_DEF_or_tags, /* Same as above */
sizeof(asn1_DEF_or_tags)
/sizeof(asn1_DEF_or_tags[0]), /* 2 */
1, /* Whether CONSTRUCTED */
asn1_MBR_or,
1, /* Single element */
@ -300,8 +313,10 @@ asn1_TYPE_descriptor_t asn1_DEF_Choice_1 = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_Choice_1,
4, /* Elements count */

View File

@ -106,8 +106,10 @@ asn1_TYPE_descriptor_t asn1_DEF_e = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_e,
2, /* Elements count */
@ -152,8 +154,10 @@ asn1_TYPE_descriptor_t asn1_DEF_h = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_h,
2, /* Elements count */
@ -215,8 +219,10 @@ asn1_TYPE_descriptor_t asn1_DEF_b = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_b,
4, /* Elements count */
@ -240,7 +246,8 @@ static asn1_TYPE_member_t asn1_MBR_T[] = {
},
};
static ber_tlv_tag_t asn1_DEF_T_tags[] = {
(ASN_TAG_CLASS_PRIVATE | (1 << 2))
(ASN_TAG_CLASS_PRIVATE | (1 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn1_TYPE_tag2member_t asn1_DEF_T_tag2el[] = {
{ (ASN_TAG_CLASS_PRIVATE | (2 << 2)), 0, 0, 0 }, /* a at 15 */
@ -268,7 +275,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]) - 1, /* 1 */
asn1_DEF_T_tags, /* Same as above */
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 2 */
1, /* Whether CONSTRUCTED */
asn1_MBR_T,
2, /* Elements count */

View File

@ -89,6 +89,9 @@ asn1_TYPE_descriptor_t asn1_DEF_PrimitiveType = {
PrimitiveType_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_PrimitiveType_tags,
sizeof(asn1_DEF_PrimitiveType_tags)
/sizeof(asn1_DEF_PrimitiveType_tags[0]), /* 1 */
asn1_DEF_PrimitiveType_tags, /* Same as above */
sizeof(asn1_DEF_PrimitiveType_tags)
/sizeof(asn1_DEF_PrimitiveType_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -150,6 +153,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ConstructedType = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_ConstructedType_tags,
sizeof(asn1_DEF_ConstructedType_tags)
/sizeof(asn1_DEF_ConstructedType_tags[0]), /* 1 */
asn1_DEF_ConstructedType_tags, /* Same as above */
sizeof(asn1_DEF_ConstructedType_tags)
/sizeof(asn1_DEF_ConstructedType_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -238,7 +244,8 @@ T_free(asn1_TYPE_descriptor_t *td,
/*** <<< STAT-DEFS [T] >>> ***/
static ber_tlv_tag_t asn1_DEF_T_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (3 << 2))
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T = {
"T",
@ -250,7 +257,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]) - 1, /* 1 */
asn1_DEF_T_tags, /* Same as above */
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 2 */
-0, /* Unknown yet */
0, 0, /* Defined elsewhere */
0 /* No specifics */

View File

@ -71,6 +71,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
SET_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
asn1_DEF_T1_tags, /* Same as above */
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -152,6 +155,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
SET_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
asn1_DEF_T2_tags, /* Same as above */
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -223,8 +229,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T3 = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_T3,
1, /* Elements count */
@ -294,8 +302,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T4 = {
CHOICE_print,
CHOICE_free,
CHOICE_outmost_tag,
0, /* No explicit tags (pointer) */
0, /* No explicit tags (count) */
0, /* No effective tags (pointer) */
0, /* No effective tags (count) */
0, /* No tags (pointer) */
0, /* No tags (count) */
1, /* Whether CONSTRUCTED */
asn1_MBR_T4,
1, /* Elements count */

View File

@ -89,6 +89,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Int1 = {
Int1_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Int1_tags,
sizeof(asn1_DEF_Int1_tags)
/sizeof(asn1_DEF_Int1_tags[0]), /* 1 */
asn1_DEF_Int1_tags, /* Same as above */
sizeof(asn1_DEF_Int1_tags)
/sizeof(asn1_DEF_Int1_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -205,6 +208,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Int2 = {
Int2_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Int2_tags,
sizeof(asn1_DEF_Int2_tags)
/sizeof(asn1_DEF_Int2_tags[0]), /* 1 */
asn1_DEF_Int2_tags, /* Same as above */
sizeof(asn1_DEF_Int2_tags)
/sizeof(asn1_DEF_Int2_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -325,6 +331,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Int3 = {
Int3_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Int3_tags,
sizeof(asn1_DEF_Int3_tags)
/sizeof(asn1_DEF_Int3_tags[0]), /* 1 */
asn1_DEF_Int3_tags, /* Same as above */
sizeof(asn1_DEF_Int3_tags)
/sizeof(asn1_DEF_Int3_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -445,6 +454,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Int4 = {
Int4_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Int4_tags,
sizeof(asn1_DEF_Int4_tags)
/sizeof(asn1_DEF_Int4_tags[0]), /* 1 */
asn1_DEF_Int4_tags, /* Same as above */
sizeof(asn1_DEF_Int4_tags)
/sizeof(asn1_DEF_Int4_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -565,6 +577,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Int5 = {
Int5_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Int5_tags,
sizeof(asn1_DEF_Int5_tags)
/sizeof(asn1_DEF_Int5_tags[0]), /* 1 */
asn1_DEF_Int5_tags, /* Same as above */
sizeof(asn1_DEF_Int5_tags)
/sizeof(asn1_DEF_Int5_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -685,6 +700,9 @@ asn1_TYPE_descriptor_t asn1_DEF_ExtensibleExtensions = {
ExtensibleExtensions_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_ExtensibleExtensions_tags,
sizeof(asn1_DEF_ExtensibleExtensions_tags)
/sizeof(asn1_DEF_ExtensibleExtensions_tags[0]), /* 1 */
asn1_DEF_ExtensibleExtensions_tags, /* Same as above */
sizeof(asn1_DEF_ExtensibleExtensions_tags)
/sizeof(asn1_DEF_ExtensibleExtensions_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -783,6 +801,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Str1 = {
Str1_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Str1_tags,
sizeof(asn1_DEF_Str1_tags)
/sizeof(asn1_DEF_Str1_tags[0]), /* 1 */
asn1_DEF_Str1_tags, /* Same as above */
sizeof(asn1_DEF_Str1_tags)
/sizeof(asn1_DEF_Str1_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -915,6 +936,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Str2 = {
Str2_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Str2_tags,
sizeof(asn1_DEF_Str2_tags)
/sizeof(asn1_DEF_Str2_tags[0]), /* 1 */
asn1_DEF_Str2_tags, /* Same as above */
sizeof(asn1_DEF_Str2_tags)
/sizeof(asn1_DEF_Str2_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1058,6 +1082,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Str3 = {
Str3_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Str3_tags,
sizeof(asn1_DEF_Str3_tags)
/sizeof(asn1_DEF_Str3_tags[0]), /* 1 */
asn1_DEF_Str3_tags, /* Same as above */
sizeof(asn1_DEF_Str3_tags)
/sizeof(asn1_DEF_Str3_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1187,6 +1214,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Str4 = {
Str4_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Str4_tags,
sizeof(asn1_DEF_Str4_tags)
/sizeof(asn1_DEF_Str4_tags[0]), /* 1 */
asn1_DEF_Str4_tags, /* Same as above */
sizeof(asn1_DEF_Str4_tags)
/sizeof(asn1_DEF_Str4_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1316,6 +1346,9 @@ asn1_TYPE_descriptor_t asn1_DEF_PER_Visible = {
PER_Visible_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_PER_Visible_tags,
sizeof(asn1_DEF_PER_Visible_tags)
/sizeof(asn1_DEF_PER_Visible_tags[0]), /* 1 */
asn1_DEF_PER_Visible_tags, /* Same as above */
sizeof(asn1_DEF_PER_Visible_tags)
/sizeof(asn1_DEF_PER_Visible_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1445,6 +1478,9 @@ asn1_TYPE_descriptor_t asn1_DEF_PER_Visible_2 = {
PER_Visible_2_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_PER_Visible_2_tags,
sizeof(asn1_DEF_PER_Visible_2_tags)
/sizeof(asn1_DEF_PER_Visible_2_tags[0]), /* 1 */
asn1_DEF_PER_Visible_2_tags, /* Same as above */
sizeof(asn1_DEF_PER_Visible_2_tags)
/sizeof(asn1_DEF_PER_Visible_2_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1574,6 +1610,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Not_PER_Visible_1 = {
Not_PER_Visible_1_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Not_PER_Visible_1_tags,
sizeof(asn1_DEF_Not_PER_Visible_1_tags)
/sizeof(asn1_DEF_Not_PER_Visible_1_tags[0]), /* 1 */
asn1_DEF_Not_PER_Visible_1_tags, /* Same as above */
sizeof(asn1_DEF_Not_PER_Visible_1_tags)
/sizeof(asn1_DEF_Not_PER_Visible_1_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1703,6 +1742,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Not_PER_Visible_2 = {
Not_PER_Visible_2_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Not_PER_Visible_2_tags,
sizeof(asn1_DEF_Not_PER_Visible_2_tags)
/sizeof(asn1_DEF_Not_PER_Visible_2_tags[0]), /* 1 */
asn1_DEF_Not_PER_Visible_2_tags, /* Same as above */
sizeof(asn1_DEF_Not_PER_Visible_2_tags)
/sizeof(asn1_DEF_Not_PER_Visible_2_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1832,6 +1874,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Not_PER_Visible_3 = {
Not_PER_Visible_3_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Not_PER_Visible_3_tags,
sizeof(asn1_DEF_Not_PER_Visible_3_tags)
/sizeof(asn1_DEF_Not_PER_Visible_3_tags[0]), /* 1 */
asn1_DEF_Not_PER_Visible_3_tags, /* Same as above */
sizeof(asn1_DEF_Not_PER_Visible_3_tags)
/sizeof(asn1_DEF_Not_PER_Visible_3_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -1964,6 +2009,9 @@ asn1_TYPE_descriptor_t asn1_DEF_SIZE_but_not_FROM = {
SIZE_but_not_FROM_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_SIZE_but_not_FROM_tags,
sizeof(asn1_DEF_SIZE_but_not_FROM_tags)
/sizeof(asn1_DEF_SIZE_but_not_FROM_tags[0]), /* 1 */
asn1_DEF_SIZE_but_not_FROM_tags, /* Same as above */
sizeof(asn1_DEF_SIZE_but_not_FROM_tags)
/sizeof(asn1_DEF_SIZE_but_not_FROM_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -2096,6 +2144,9 @@ asn1_TYPE_descriptor_t asn1_DEF_SIZE_and_FROM = {
SIZE_and_FROM_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_SIZE_and_FROM_tags,
sizeof(asn1_DEF_SIZE_and_FROM_tags)
/sizeof(asn1_DEF_SIZE_and_FROM_tags[0]), /* 1 */
asn1_DEF_SIZE_and_FROM_tags, /* Same as above */
sizeof(asn1_DEF_SIZE_and_FROM_tags)
/sizeof(asn1_DEF_SIZE_and_FROM_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -2225,6 +2276,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Neither_SIZE_nor_FROM = {
Neither_SIZE_nor_FROM_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Neither_SIZE_nor_FROM_tags,
sizeof(asn1_DEF_Neither_SIZE_nor_FROM_tags)
/sizeof(asn1_DEF_Neither_SIZE_nor_FROM_tags[0]), /* 1 */
asn1_DEF_Neither_SIZE_nor_FROM_tags, /* Same as above */
sizeof(asn1_DEF_Neither_SIZE_nor_FROM_tags)
/sizeof(asn1_DEF_Neither_SIZE_nor_FROM_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -2371,6 +2425,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Utf8_3 = {
Utf8_3_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Utf8_3_tags,
sizeof(asn1_DEF_Utf8_3_tags)
/sizeof(asn1_DEF_Utf8_3_tags[0]), /* 1 */
asn1_DEF_Utf8_3_tags, /* Same as above */
sizeof(asn1_DEF_Utf8_3_tags)
/sizeof(asn1_DEF_Utf8_3_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -2487,6 +2544,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Utf8_2 = {
Utf8_2_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Utf8_2_tags,
sizeof(asn1_DEF_Utf8_2_tags)
/sizeof(asn1_DEF_Utf8_2_tags[0]), /* 1 */
asn1_DEF_Utf8_2_tags, /* Same as above */
sizeof(asn1_DEF_Utf8_2_tags)
/sizeof(asn1_DEF_Utf8_2_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -2585,6 +2645,9 @@ asn1_TYPE_descriptor_t asn1_DEF_Utf8_1 = {
Utf8_1_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_Utf8_1_tags,
sizeof(asn1_DEF_Utf8_1_tags)
/sizeof(asn1_DEF_Utf8_1_tags[0]), /* 1 */
asn1_DEF_Utf8_1_tags, /* Same as above */
sizeof(asn1_DEF_Utf8_1_tags)
/sizeof(asn1_DEF_Utf8_1_tags[0]), /* 1 */
-0, /* Unknown yet */

View File

@ -61,6 +61,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
asn1_DEF_T1_tags, /* Same as above */
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */
@ -133,6 +136,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
SEQUENCE_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
asn1_DEF_T2_tags, /* Same as above */
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 1 */
1, /* Whether CONSTRUCTED */

View File

@ -83,6 +83,14 @@ static ber_tlv_tag_t asn1_DEF_T1_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T1_all_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (2 << 2)),
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T1 = {
"T1",
T1_constraint,
@ -94,6 +102,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T1 = {
asn1_DEF_T1_tags,
sizeof(asn1_DEF_T1_tags)
/sizeof(asn1_DEF_T1_tags[0]), /* 4 */
asn1_DEF_T1_all_tags,
sizeof(asn1_DEF_T1_all_tags)
/sizeof(asn1_DEF_T1_all_tags[0]), /* 6 */
-0, /* Unknown yet */
0, 0, /* No members */
0 /* No specifics */
@ -183,6 +194,13 @@ static ber_tlv_tag_t asn1_DEF_T2_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T2_all_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (3 << 2)),
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T2 = {
"T2",
T2_constraint,
@ -194,6 +212,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T2 = {
asn1_DEF_T2_tags,
sizeof(asn1_DEF_T2_tags)
/sizeof(asn1_DEF_T2_tags[0]), /* 3 */
asn1_DEF_T2_all_tags,
sizeof(asn1_DEF_T2_all_tags)
/sizeof(asn1_DEF_T2_all_tags[0]), /* 5 */
-0, /* Unknown yet */
0, 0, /* No members */
0 /* No specifics */
@ -282,6 +303,12 @@ static ber_tlv_tag_t asn1_DEF_T3_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2))
};
static ber_tlv_tag_t asn1_DEF_T3_all_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (4 << 2)),
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T3 = {
"T3",
T3_constraint,
@ -293,6 +320,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T3 = {
asn1_DEF_T3_tags,
sizeof(asn1_DEF_T3_tags)
/sizeof(asn1_DEF_T3_tags[0]), /* 2 */
asn1_DEF_T3_all_tags,
sizeof(asn1_DEF_T3_all_tags)
/sizeof(asn1_DEF_T3_all_tags[0]), /* 4 */
-0, /* Unknown yet */
0, 0, /* No members */
0 /* No specifics */
@ -379,7 +409,8 @@ T4_free(asn1_TYPE_descriptor_t *td,
static ber_tlv_tag_t asn1_DEF_T4_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (5 << 2)),
(ASN_TAG_CLASS_CONTEXT | (6 << 2))
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T4 = {
"T4",
@ -391,7 +422,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T4 = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_T4_tags,
sizeof(asn1_DEF_T4_tags)
/sizeof(asn1_DEF_T4_tags[0]), /* 2 */
/sizeof(asn1_DEF_T4_tags[0]) - 1, /* 2 */
asn1_DEF_T4_tags, /* Same as above */
sizeof(asn1_DEF_T4_tags)
/sizeof(asn1_DEF_T4_tags[0]), /* 3 */
-0, /* Unknown yet */
0, 0, /* No members */
0 /* No specifics */
@ -477,7 +511,8 @@ T5_free(asn1_TYPE_descriptor_t *td,
/*** <<< STAT-DEFS [T5] >>> ***/
static ber_tlv_tag_t asn1_DEF_T5_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (6 << 2))
(ASN_TAG_CLASS_CONTEXT | (6 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (2 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T5 = {
"T5",
@ -489,7 +524,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T5 = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_T5_tags,
sizeof(asn1_DEF_T5_tags)
/sizeof(asn1_DEF_T5_tags[0]), /* 1 */
/sizeof(asn1_DEF_T5_tags[0]) - 1, /* 1 */
asn1_DEF_T5_tags, /* Same as above */
sizeof(asn1_DEF_T5_tags)
/sizeof(asn1_DEF_T5_tags[0]), /* 2 */
-0, /* Unknown yet */
0, 0, /* No members */
0 /* No specifics */
@ -586,6 +624,9 @@ asn1_TYPE_descriptor_t asn1_DEF_T6 = {
T6_free,
0, /* Use generic outmost tag fetcher */
asn1_DEF_T6_tags,
sizeof(asn1_DEF_T6_tags)
/sizeof(asn1_DEF_T6_tags[0]), /* 1 */
asn1_DEF_T6_tags, /* Same as above */
sizeof(asn1_DEF_T6_tags)
/sizeof(asn1_DEF_T6_tags[0]), /* 1 */
-0, /* Unknown yet */
@ -673,7 +714,9 @@ T_free(asn1_TYPE_descriptor_t *td,
/*** <<< STAT-DEFS [T] >>> ***/
static ber_tlv_tag_t asn1_DEF_T_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (0 << 2))
(ASN_TAG_CLASS_CONTEXT | (0 << 2)),
(ASN_TAG_CLASS_CONTEXT | (123 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
asn1_TYPE_descriptor_t asn1_DEF_T = {
"T",
@ -685,7 +728,10 @@ asn1_TYPE_descriptor_t asn1_DEF_T = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_T_tags,
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 1 */
/sizeof(asn1_DEF_T_tags[0]) - 2, /* 1 */
asn1_DEF_T_tags, /* Same as above */
sizeof(asn1_DEF_T_tags)
/sizeof(asn1_DEF_T_tags[0]), /* 3 */
-0, /* Unknown yet */
0, 0, /* Defined elsewhere */
0 /* No specifics */
@ -740,7 +786,8 @@ static asn1_TYPE_member_t asn1_MBR_Ts[] = {
},
};
static ber_tlv_tag_t asn1_DEF_Ts_tags[] = {
(ASN_TAG_CLASS_CONTEXT | (123 << 2))
(ASN_TAG_CLASS_CONTEXT | (123 << 2)),
(ASN_TAG_CLASS_UNIVERSAL | (16 << 2))
};
static asn1_TYPE_tag2member_t asn1_DEF_Ts_tag2el[] = {
{ (ASN_TAG_CLASS_CONTEXT | (1 << 2)), 0, 0, 0 }, /* m1 at 24 */
@ -765,7 +812,10 @@ asn1_TYPE_descriptor_t asn1_DEF_Ts = {
0, /* Use generic outmost tag fetcher */
asn1_DEF_Ts_tags,
sizeof(asn1_DEF_Ts_tags)
/sizeof(asn1_DEF_Ts_tags[0]), /* 1 */
/sizeof(asn1_DEF_Ts_tags[0]) - 1, /* 1 */
asn1_DEF_Ts_tags, /* Same as above */
sizeof(asn1_DEF_Ts_tags)
/sizeof(asn1_DEF_Ts_tags[0]), /* 2 */
1, /* Whether CONSTRUCTED */
asn1_MBR_Ts,
3, /* Elements count */