diff options
author | Pascal Quantin <pascal.quantin@gmail.com> | 2018-09-07 09:38:34 +0200 |
---|---|---|
committer | Pascal Quantin <pascal.quantin@gmail.com> | 2018-09-07 08:09:42 +0000 |
commit | 580575a51e56be6b369d8fb03f41afa3ce2a4be7 (patch) | |
tree | f45ee1017c56c71f4664e5c759a324397ab2151c | |
parent | 560a185e531d33be482895d561cb81cdb7ef6193 (diff) | |
download | wireshark-580575a51e56be6b369d8fb03f41afa3ce2a4be7.tar.gz wireshark-580575a51e56be6b369d8fb03f41afa3ce2a4be7.tar.bz2 wireshark-580575a51e56be6b369d8fb03f41afa3ce2a4be7.zip |
PER: fix dissection of enumerated type with a single extension value
Per X.691 chapter 14.3, a enumerated type with extension marcker should
always be encoded as a normally small non-negative whole number.
Change-Id: Ice070a932792ba1654674c68157ff4b6b0942f90
Reviewed-on: https://code.wireshark.org/review/29454
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
(cherry picked from commit e4ff3e657a8abfad75041cb9e6d750ca42764af0)
Reviewed-on: https://code.wireshark.org/review/29459
-rw-r--r-- | epan/dissectors/packet-per.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/epan/dissectors/packet-per.c b/epan/dissectors/packet-per.c index d498aa29bf..8488c74812 100644 --- a/epan/dissectors/packet-per.c +++ b/epan/dissectors/packet-per.c @@ -1585,20 +1585,11 @@ dissect_per_enumerated(tvbuff_t *tvb, guint32 offset, asn1_ctx_t *actx, proto_tr offset = dissect_per_constrained_integer(tvb, offset, actx, tree, hf_per_enum_index, 0, root_num - 1, &enum_index, FALSE); if (!display_internal_per_fields) PROTO_ITEM_SET_HIDDEN(actx->created_item); } else { - /* 13.3 */ - 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; - } else { - /* 13.3 ".. and the value shall be added to the field-list as a - * normally small non-negative whole number whose value is the - * enumeration index of the additional enumeration and with "lb" set to 0.." - */ - offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_enum_extension_index, &enum_index); - } + /* 13.3 ".. and the value shall be added to the field-list as a + * normally small non-negative whole number whose value is the + * enumeration index of the additional enumeration and with "lb" set to 0.." + */ + offset = dissect_per_normally_small_nonnegative_whole_number(tvb, offset, actx, tree, hf_per_enum_extension_index, &enum_index); enum_index += root_num; } val = (value_map && (enum_index<(root_num+ext_num))) ? value_map[enum_index] : enum_index; |