First time here? Check out the FAQ!

Ask Your Question
0

About the enum type of per decode

asked Sep 6 '18

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

In the function of packet-per.c, dissect_per_enumerated,when there is only one element in the extension part, why not need to decode the element?

the responding code is as follows:

......
if (ext_num == 1) {
    /* 10.5.4   If "range" has the value 1,
     * then the result of the encoding shall be
     * an empty bit-field (no bits).
     */
    enum_index = 0;
}
......

the above regulation cannot be seen in the enum type of per decode regulation

Preview: (hide)

2 Answers

Sort by » oldest newest most voted
0

answered Sep 7 '18

Pascal Quantin gravatar image

This is indeed a bug in Wireshark, thanks for reporting it. The fix is available here: https://code.wireshark.org/review/c/2... and will be backported in all the active branches.

Preview: (hide)
link
0

answered Sep 6 '18

Pascal Quantin gravatar image

Hi,

It comes from the definition of a constrained whole number encoding in ITU X.691 chapter 11.5.4 (Wireshark comment is based on an earlier X.691 specification where the corresponding chapter was 10.5.4).

Preview: (hide)
link

Comments

In the ITU X.691 ,I think the enum type of per decode regulation should be as follows In the presence of an extension marker,if the value is not in the extension root it is encoded as a normally small non-negative whole number , not as a constrained whole number

liwsh880709 gravatar imageliwsh880709 ( Sep 7 '18 )

So do you have a pcap triggering this code that we could use to double check the behavior?

Pascal Quantin gravatar imagePascal Quantin ( Sep 7 '18 )

Hi, after a second thought I agree with you: this specific case should be removed so as to systematically use the small non-negative whole number encoding. I'm gonna fix it right now, thanks for raising the point.

Pascal Quantin gravatar imagePascal Quantin ( Sep 7 '18 )

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: Sep 6 '18

Seen: 509 times

Last updated: Sep 07 '18