Commit 188ed2c7 authored by Lev Walkin's avatar Lev Walkin

inner structures tagging fix. see 0.9.5 comment in ChangeLog

parent d563d397
......@@ -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,
......
This diff is collapsed.
......@@ -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; \
......
......@@ -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 */
};
/*
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
/*-
* 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];
}
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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,
...
}
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment