Commit 1ad922db authored by Mouse's avatar Mouse

Make APER encoding/decoding of constrained OCTET_STRING correct

parent 6806d080
......@@ -60,10 +60,17 @@ OCTET_STRING_decode_aper(const asn_codec_ctx_t *opt_codec_ctx,
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
canonical_unit_bits = unit_bits = 8;
if(cval->flags & APC_CONSTRAINED)
unit_bits = cval->range_bits;
bpc = OS__BPC_CHAR;
break;
case ASN_OSUBV_STR:
canonical_unit_bits = unit_bits = 8;
/*
if(cval->flags & APC_CONSTRAINED)
unit_bits = cval->range_bits;
unit_bits = cval->range_bits;
*/
bpc = OS__BPC_CHAR;
break;
case ASN_OSUBV_U16:
......@@ -267,10 +274,17 @@ OCTET_STRING_encode_aper(const asn_TYPE_descriptor_t *td,
switch(specs->subvariant) {
case ASN_OSUBV_ANY:
canonical_unit_bits = unit_bits = 8;
if(cval->flags & APC_CONSTRAINED)
unit_bits = 8;
bpc = OS__BPC_CHAR;
break;
case ASN_OSUBV_STR:
canonical_unit_bits = unit_bits = 8;
/*
if(cval->flags & APC_CONSTRAINED)
unit_bits = cval->range_bits;
unit_bits = 8;
*/
bpc = OS__BPC_CHAR;
sizeinunits = st->size;
break;
......
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