This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Per decoding is showing “too long integer(per_normally_small_nonnegative_whole_number)"

0

Hi, at the time of decoding some sequence (the function "dissect_per_sequence" is called), we are getting the error: "too long integer(per_normally_small_nonnegative_whole_number)". The IEs with "ASN1_EXTENSION_ROOT,ASN1_OPTIONAL and ASN1_NOT_OPTIONAL" are dissecting properly. after those dissection the error is coming.

The sequence has extension marker (the ellipses or ...) in PROP_IEs.asn file. the dissection of IEs before (ellipses or ...) is fine. after that Malformed packet with "too long integer(per_normally_small_nonnegative_whole_number)" is shown.

snapshot of PROP_IEs.asn:

pD-BearerDataList              PD-BearerDataList           OPTIONAL,
pD-FirstUeMeasurementDataItems PD-UeMeasurementDataListing OPTIONAL,
pD-LastUeMeasurementDataItems  PD-UeMeasurementDataListing OPTIONAL,
...,
measDataNotAvailable           MeasDataNotAvailable        OPTIONAL,
rrcEstablishmentReason         RrcEstablishmentCause       OPTIONAL,

snapshot of packet-s1ap.c

{ &hf_s1ap_pD_BearerDataList, ASN1_EXTENSION_ROOT, ASN1_OPTIONAL, dissect_s1ap_PCMD_BearerDataList },
{ &hf_s1ap_pD_FirstUeMeasurementDataItems, ASN1_EXTENSION_ROOT, ASN1_OPTIONAL, dissect_s1ap_UeMeasurementDataListing },
{ &hf_s1ap_pD-LastUeMeasurementDataItems, ASN1_EXTENSION_ROOT, ASN1_OPTIONAL, dissect_s1ap_UeMeasurementDataListing },
{ &hf_s1ap_measDataNotAvailable, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL, dissect_s1ap_MeasDataNotPresent },
{ &hf_s1ap_rrcEstablishmentReason, ASN1_NOT_EXTENSION_ROOT, ASN1_OPTIONAL, dissect_s1ap_RrcEstablishmentCause },

So my question is regarding dissection of IEs/Components after extension marker (Ellipses or ...). How dissection happens? how to calculate number of extensions? why this error is coming? Any help specially from developer are welcome.

asked 06 Apr '17, 03:05

Abhisek's gravatar image

Abhisek
16111216
accept rate: 0%

edited 06 Apr '17, 03:22

grahamb's gravatar image

grahamb ♦
19.8k330206

According to my understanding of packet-per.c, the dissect_per_sequence function dissected in two stage. Stage 1: components before extension marker.

  1. first calculate components with NOT(ASN1_NOT_EXTENSION_ROOT) and ASN1_OPTIONAL,
  2. then check optional field flag for each components calculated earlier step and make an arrary of bits(0 or 1 depends on presence of optional field flag),
  3. then call dissector function for components whose bit value is 1 in the array mentioned above.

Upto this part is fine. the dissection is fine with respect to sequence. Stage 2:Components after extension marker.

  1. dissect_per_normally_small_nonnegative_whole_number is called. and here my dissection is getting failed with error of Malformed packet and error message "too long integer(per_normally_small_nonnegative_whole_number)".

I don't know dissection part after that. Is any developer there, who can help me out.

(07 Apr '17, 04:49) Abhisek