Commit 06230f79 authored by Lev Walkin's avatar Lev Walkin

decoding unknown extensions

parent 70e3d264
...@@ -1210,10 +1210,33 @@ uper_get_open_type(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -1210,10 +1210,33 @@ uper_get_open_type(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
return rv; return rv;
} }
asn_dec_rval_t
uper_sot_suck(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd) {
asn_dec_rval_t rv;
(void)opt_codec_ctx;
(void)td;
(void)constraints;
(void)sptr;
while(per_get_few_bits(pd, 24) >= 0);
rv.code = RC_OK;
rv.consumed = pd->moved;
return rv;
}
static int static int
uper_skip_open_type(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd) { uper_skip_open_type(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd) {
asn_TYPE_descriptor_t s_td;
asn_dec_rval_t rv; asn_dec_rval_t rv;
rv = uper_get_open_type(opt_codec_ctx, 0, 0, 0, pd);
s_td.name = "<unknown extension>";
s_td.uper_decoder = uper_sot_suck;
rv = uper_get_open_type(opt_codec_ctx, &s_td, 0, 0, pd);
if(rv.code != RC_OK) if(rv.code != RC_OK)
return -1; return -1;
else else
...@@ -1387,12 +1410,18 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, ...@@ -1387,12 +1410,18 @@ SEQUENCE_decode_uper(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td,
/* Skip over overflow extensions which aren't present /* Skip over overflow extensions which aren't present
* in this system's version of the protocol */ * in this system's version of the protocol */
while(per_get_few_bits(&epmd, 1) >= 0) { for(;;) {
switch(per_get_few_bits(&epmd, 1)) {
case -1: break;
case 0: continue;
default:
if(uper_skip_open_type(opt_codec_ctx, pd)) { if(uper_skip_open_type(opt_codec_ctx, pd)) {
FREEMEM(epres); FREEMEM(epres);
_ASN_DECODE_STARVED; _ASN_DECODE_STARVED;
} }
} }
break;
}
FREEMEM(epres); FREEMEM(epres);
} }
...@@ -1445,7 +1474,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -1445,7 +1474,7 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
int present; int present;
if(!IN_EXTENSION_GROUP(specs, edx)) { if(!IN_EXTENSION_GROUP(specs, edx)) {
ASN_DEBUG("%d is not extension", edx); ASN_DEBUG("%s (@%d) is not extension", elm->type->name, edx);
continue; continue;
} }
...@@ -1459,7 +1488,8 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr, ...@@ -1459,7 +1488,8 @@ SEQUENCE_handle_extensions(asn_TYPE_descriptor_t *td, void *sptr,
present = 1; present = 1;
} }
ASN_DEBUG("checking ext %d is present => %d", edx, present); ASN_DEBUG("checking %s (@%d) present => %d",
elm->type->name, edx, present);
exts_count++; exts_count++;
exts_present += present; exts_present += present;
......
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