Commit Graph

37989 Commits

Author SHA1 Message Date
Jianwei Mao d9a09aa622 IPv6: Support dissecting IETF APN6 option.
IETF APN6: Application-Aware IPv6 Networking (APN6)

APN6 option is a new option including in IPv6 Destination Options Header.

APN6 makes use of IPv6 encapsulation to convey the APN Attribute along with
data packets and make the network aware of data flow requirements at different
granularity levels. The APN attribute can be encapsulated in the APN header.

References:
1. https://datatracker.ietf.org/wg/apn/about/
2. https://datatracker.ietf.org/doc/draft-li-apn-header/
3. https://datatracker.ietf.org/doc/draft-li-apn-ipv6-encap/
2022-12-24 08:15:27 +00:00
Martin Mathieson 51a6dfffc7 PDCP-LTE: add a filter for decypted data 2022-12-23 10:59:35 +00:00
Pascal Quantin e9176b652d ASN.1 PER: fix dissect_per_restricted_character_string_sorted()
Avoid incrementing offset if it was already changed when trying to fetch
length. Closes #18702
2022-12-22 20:51:49 +00:00
John Thacker 5ee2e7c268 QUIC: Handle QUIC connections multiplexed on the same 5-tuple
Different QUIC connections can be multiplexed on the same network
5-tuple. Handle this, including checking for Stateless Reset tokens
on all connections on the same 5-tuple.

Create a CONVERSATION_QUIC type using our internal QUIC connection
ID, and set the conversation elements so that subdissectors like
TLS that set conversation data only alter data for the one QUIC
connection instead of all multiplexed connections.

Various failures are expected, per RFC 9000, if zero-length connection
IDs are used when multiplexing connections on the same local IP addresses
and ports.

Fix #17099
2022-12-22 19:56:19 +00:00
Martin Mathieson 369993d72c E2AP: Use gnbid to share RAN Function ID mappings 2022-12-22 19:18:18 +00:00
Martin Mathieson 398b05d199 DECT-NWK: Fix a couple of typos 2022-12-22 12:05:12 +00:00
easonweii 0e4bcf427f H224: Completing of H.224 dissection for Client Data Octets
Add the client protocols prasing for CME (Client Management Entity) and H.281/FECC (Far-End Camera Control).
Related #18667
2022-12-22 08:40:53 +00:00
Bernhard Dick ae0d6324c4 DECT-NWK: Fix windows build
When building using msvc implicit changes of the integer sizes in
fmt_dect_nwk_ipei are treated as error due to possible loss of
information.
This is now forecome by explicitely masking the shifted value to fit in
guint16 and by typecasting in calculation to guint16 (the maximum value
that needs to fit here is sum(x=1..x=12)(9x)=702 )
2022-12-21 21:30:20 +00:00
Bernhard Dick 8aec74c0ba DECT-NWK: Simplify data dissector call 2022-12-21 21:30:20 +00:00
Bernhard Dick cdf134b4e5 DECT-NWK: Update wmem_strbuf function usage
In 32f88ad22c the function to create new
sized wmwm strbufs has been renamed and got a parameter change. This
updates DECT-NWK parts accordingly.
2022-12-21 21:30:20 +00:00
Bernhard Dick b7d2d107d4 DECT-NWK: Update hf type
Use type int instead of gint for all hf_ variables as this is used in
the functions and structures
2022-12-21 21:30:20 +00:00
Bernhard Dick 0905bc33b5 DECT-NWK: Remove solved TODO marks 2022-12-21 21:30:20 +00:00
Bernhard Dick 9cddc16d68 DECT-NWK: Dissect more IPUI types 2022-12-21 21:30:20 +00:00
Bernhard Dick 4e0365b25b DECT-NWK: Improve display of DECT chars/strings 2022-12-21 21:30:20 +00:00
Bernhard Dick ad06d7cec6 DECT-NWK: Use DECT charset for strings 2022-12-21 21:30:20 +00:00
Bernhard Dick cc86a34c90 DECT-NWK: Fix IPEI string formatting 2022-12-21 21:30:20 +00:00
Bernhard Dick 1272bd3c2d DECT-NWK: Fix missing initialization 2022-12-21 21:30:20 +00:00
Bernhard Dick 4fed21f5a8 DECT-NWK: Make format function static 2022-12-21 21:30:20 +00:00
Bernhard Dick e3f010683f DECT-NWK: Dissect more S-Format message types
Adds basic dissection for futher S-Format message types:
* CISS
* CRSS
* COMS
* CLMS
2022-12-21 21:30:20 +00:00
Bernhard Dick 98a86dc660 DECT-NWK: Add fields to PORTABLE-IDENTITY
Add dissection of TPUI and IPEI field including IPEI format string to
the PORTABLE-IDENTITY S-Format information element
2022-12-21 21:30:20 +00:00
Bernhard Dick 3b1084d0a1 DECT-NWK: Fix missing prototype 2022-12-21 21:30:20 +00:00
Bernhard Dick e95424b4cd DECT-NWK: fix proto tree item length
The Default Cipher Key algorithm field within AUTH-TYPE is only in the
last two bits of octet 5c, not 5c+5d
2022-12-21 21:30:20 +00:00
Bernhard Dick bb9785c849 DECT-NWK: Fix typos 2022-12-21 21:30:20 +00:00
Bernhard Dick d4f070ce54 DECT-NWK: Add further ie dissection
Added dissectin of the S-Format information fields
* DURATION
* IWU-TO-IWU
* MODEL-IDENTIFIER
* CODEC-LIST
2022-12-21 21:30:20 +00:00
Bernhard Dick 775ea97ddf DECT-NWK: Fix TERMINAL-CAPAPILITY
The mask for the control codes field within the TERMINAL-CAPABILITY
information element was masking the wrong bits.
2022-12-21 21:30:20 +00:00
Bernhard Dick 528391f2bd DECT-NWK: Fix hf definition
Definition of hf_dect_nwk_s_ie_terminal_capability_blind_slot_6a
reffered to the TFS for its bits by accident, this is now removed.
2022-12-21 21:30:20 +00:00
Bernhard Dick be04f23917 DECT-NWK: fix typo in field name 2022-12-21 21:30:20 +00:00
Bernhard Dick 271f7e00f9 DECT-NWK: Fix value_string terminations 2022-12-21 21:30:20 +00:00
Bernhard Dick 2e6e44d1b1 DECT-NWK: Add MULTI-DISPLAY, MULTI-KEYPAD
Add basic dissection of S-Format elements MULTI-DISPLAY and
MULTI-KEYPAD. The dissector now holds information regarding control
characters of the DECT charset.
2022-12-21 21:30:20 +00:00
Bernhard Dick 1c0da0d2e2 DECT-NWK: Add TERMINAL-CAPABILITY dissection
Dissection of the TERMINAL-CAPABILITY S-Format information element has
been implemented.
2022-12-21 21:30:20 +00:00
Bernhard Dick f4ec602228 DECT-NWK: Add LOCATION-AREA dissection 2022-12-21 21:30:20 +00:00
Bernhard Dick d1befab186 DECT-NWK: Add single binary value IEs
Add dissection of the S-Format information elements RAND, RES, RS all
holding an arbitrary data within their whole field length
2022-12-21 21:30:20 +00:00
Bernhard Dick 42751da3c3 DECT-NWK: Add AUTH-TYPE dissection 2022-12-21 21:30:20 +00:00
Bernhard Dick 79e3822dee DECT-NWK: Dissect MM messages
Added value strings for all MM messages and use S-Format IE dissection
also for MM
2022-12-21 21:30:20 +00:00
Bernhard Dick eaeff2858a DECT-NWK: Fix CIPHER-INFO
The value for Escaping to proprietary algorithm was wrong and the
Boolean field Y/N was registered using the wrong base, resulting in a
failed assertion during dissection
2022-12-21 21:30:20 +00:00
Bernhard Dick d9130e8d20 DECT-NWK: Add fixed len information elements
Dissection of all fixed length S-Format information elements has been
added to the dect-nwk dissector
2022-12-21 21:30:20 +00:00
Bernhard Dick 443f0dcc33 DECT-NWK: Handle CALLING-PARTY-NUMBER
Add begin of dissection of S-Format Calling Party Number information
element.
2022-12-21 21:30:20 +00:00
Bernhard Dick da2048d5f3 DECT-NWK: Move IE dissection out of LCE
Dissection of S-Format information elements has moved to an own
function that is now also used for dissecting CC messages
2022-12-21 21:30:20 +00:00
Bernhard Dick b7fc9a2788 DECT-NWK: Begin LCE-PAGE-RESPONSE dissection
First steps in dissection of the LCE-PAGE-RESPONSE message. Basic
dissection for S-FORMAT information elements being mandatory or
optional in this message is included.
2022-12-21 21:30:20 +00:00
Harald Welte 1be5ec9433 DECT-NWK: Initial dissector for DECT NWK layer
Change-Id: Idf0b97ce40ec5b2dd1b507a72fed64cfee288354
2022-12-21 21:30:20 +00:00
Pascal Quantin 318b5a819d NAS 5GS: fix a typo 2022-12-21 15:59:14 +00:00
Martin Mathieson 7f5668e8ec WLAN: fix a couple of warnings from check_typed_item_calls.py 2022-12-20 21:21:35 +00:00
Martin Mathieson 5ccde702c1 PDCP-NR: Add a field to show/filter decrypted data 2022-12-20 16:36:39 +00:00
Nardi Ivan 507d5c5386 QUIC: update final constants for QUICv2
Old v2-01 version has been removed, like we did for v2-00 in 78d78eb016.

See:
https://datatracker.ietf.org/doc/draft-ietf-quic-v2/
https://datatracker.ietf.org/doc/draft-ietf-quic-version-negotiation-14
2022-12-20 10:43:47 +01:00
Martin Mathieson 202da2a700 WLAN: fix a conflicting entry for value_string 2022-12-19 22:15:10 +00:00
GREGORIO-M 1a2642ec69 MP-DCCP: Fixed typo in filter name
mp_joidid to mp_joinid
2022-12-19 11:06:25 +00:00
GREGORIO-M c1756855eb MP-DCCP: Solving Compilation Errors on Certain Compilers
-Removed some whitespaces
2022-12-19 11:06:25 +00:00
GREGORIO-M 801f954a53 MP-DCCP: Solving Compilation Errors on Certain Compilers
-Fixed a few issues with whitespaces
-Fixed duplicate field entries for mp_join, mp_prio and mp_addr
2022-12-19 11:06:25 +00:00
GREGORIO-M 1ebdeb2943 MP-DCCP: Fixed Compilation Error on Certain Compilers
-Reading whether a connection was MP_CAPABLE had incorrect arguments for its type.
2022-12-19 11:06:25 +00:00
GREGORIO-M 5c42b6e84f MP-DCCP: Fixed Rare Packet Malformation Error
-Applied change #2 in commit e98638bf798c5ccdb12b8af7a591b218f660b001 from wireshark/master
2022-12-19 11:06:25 +00:00
GREGORIO-M 599e51462e MP-DCCP: Solving Compilation Errors on Certain Compilers
-Changed the encoding of certain options to their appropriate value, the old values caused compilation error on some machines
-Reverted change #1 in commit c7d3335110290886f6dd56fa640c8b0ca0b7fce5 which caused a packet malformation error due to a data item being read incorrectly.
2022-12-19 11:06:25 +00:00
GREGORIO-M 350875f44f MP-DCCP: Solving Compilation Errors on Certain Compilers
-Certain lines had a mixture of tabs and spaces which prevented compilation on certain machines
2022-12-19 11:06:25 +00:00
GREGORIO-M 174730bdcc MP-DCCP: Solving Compilation Errors on Certain Compilers
-Certain lines had a mixture of tabs and spaces which prevented compilation on certain machines
-Replaced protocol abbreviation from mpdccp.mp_* to dccp_mp_* to solve PROTOABBREV error when building
2022-12-19 11:06:25 +00:00
GREGORIO-M 151414ac35 MP-DCCP: Resolved Minor Merge Issues
-Changed proto_tree_add_unit to proto_tree_add_item, as suggested for the dissect feature option
-Changed conditional statements to switch case in for MP_ADDADDR
2022-12-19 11:06:25 +00:00
GREGORIO-M 7f02b09c41 MP-DCCP: Improved MP_CONFIRM
-MP_Confirm dissection now works as a recursive function, which is capable of more effectively dissect a list of incoming confirmations.
2022-12-19 11:06:25 +00:00
GREGORIO-M 2b6e9d7b2b MP-DCCP: Modified MP_CONFIRM to match IETF draft.
-List MP_OPT as a subtree with relevant MP_SEQ, ID Address and/or subflow. 
-Fixed a compilation warning due to an except statement creating subtree for an inexistent tree.
2022-12-19 11:06:25 +00:00
Nathalie Romo 7bb4c2fb1e MP-DCCP: -Rename multi-path subobtions to match IETF draft.
-Add MP-KEY value.
-Add Key Data in MP_CLOSE.
-Add HMAC data.
-Correct IPv4 address endianess.
2022-12-19 11:06:25 +00:00
Nathalie Romo bdc9210978 DCCP: Fix dissection of Feature options to match feature_number names instead option_type, and include MP_CAPABLE feature. 2022-12-19 11:06:25 +00:00
GREGORIO-M 720c05c799 MP-DCCP: Added all features to MP-DCCP V6.
Previous implementation lacked MP_ADDADDR, MP_REMOVEADDR and had an outdated version of MP_PRIO.

Fixed a bug where the dissector had an incorrect offset of 1 byte, resulting in it incorrectly reading headers and data, something resulting in malformed packets.
2022-12-19 11:06:25 +00:00
GREGORIO-M 16ea20120c MP-DCCP: Implemented MP-DCCP up-to V4.
Used Leonard Walter's MP-DCCP dissector code.
2022-12-19 11:06:25 +00:00
Gerald Combs f951d80201 [Automatic update for 2022-12-18]
Update manuf, services enterprise numbers, translations, and other items.
2022-12-18 16:46:50 +00:00
João Valverde 2bc72fa3db IPP: Fix invalid UTF-8 encoding
Fixes #18739.
2022-12-17 17:41:11 +00:00
Martin Mathieson b2572f3a35 Fix some spelling errors 2022-12-17 11:41:29 +00:00
João Valverde c2850d7203 C15 CH: Fix UTF-8 string truncation 2022-12-16 19:45:02 +00:00
João Valverde 730981f76a GSM A-bis: Add an assertion to prevent a buffer overflow
==207143==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f59752e0f00 at pc 0x7f5971cd0737 bp 0x7ffe881b1ef0 sp 0x7ffe881b1ee8
READ of size 4 at 0x7f59752e0f00 thread T0
    #0 0x7f5971cd0736 in setup_rlc_mac_priv epan/dissectors/packet-gsm_abis_pgsl.c:194:8
    #1 0x7f5971ccfc89 in dissect_gprs_data epan/dissectors/packet-gsm_abis_pgsl.c:357:3
    #2 0x7f5971ccf6ea in dissect_abis_pgsl epan/dissectors/packet-gsm_abis_pgsl.c:477:3
    #3 0x7f5974483daa in call_dissector_through_handle epan/packet.c:822:9
    #4 0x7f5974478c05 in call_dissector_work epan/packet.c:920:9
2022-12-16 19:45:02 +00:00
John Thacker 5b96d57b18 protobuf: Do not crash on zero length bytes element
If a field name has been written to the json dumper for
a bytes element (Base64), then a Base64 value must be written
later, even if the value is zero length.

Move the JSON_DUMPER_FLAGS_NO_DEBUG flag to the json_dumper header,
and use it in the protobuf dissector, so that errors in the JSON
dumper state transitions do not abort the application through a
ws_error() call. Use DISSECTOR_ASSERT in that case, since it should
happen only with a dissector bug (as with the zero bytes elements
issue fixed here), not with malformed packets.

Only instantiate the json_dumper and create its output string if
we intend on displaying its output, instead of doing so whenever
we have a message type name.

Fix #18730.
2022-12-16 12:20:30 +00:00
Vasil Velichkov a4f56e90a6 BER: Fix extension lengths
Previously the length was ignored and if a Sequence contains more then
one extensions (in the ellipsis) then the value of the second was
wrongly added to the value of the previous one.
2022-12-16 08:55:47 +00:00
Chuck Craft 3a61e3f851 SNMP/UDP: SNMP is walking on UDP conversation/stream ID 2022-12-16 08:46:03 +00:00
Gerald Combs b0cf030b30 RTPS: Add offset overflow checking.
Add and use check_offset_addition, which adds an expert item and throws
an exception if we're about to overflow our offset.

Fixes #18737
2022-12-15 16:16:00 -08:00
João Valverde 1ca46907d4 DMP: Fix invalid UTF-8 encoding 2022-12-15 15:04:08 +00:00
João Valverde 10bfb702a6 ECMP: Fix invalid UTF-8 encoding 2022-12-15 14:23:01 +00:00
João Valverde be44dab5d6 Zbee ZDP: Fix UTF-8 string invalid truncation 2022-12-15 14:23:01 +00:00
João Valverde 0256d09ab8 NCSI: Fix invalid UTF-8 encoding 2022-12-15 14:23:01 +00:00
João Valverde 2db8d6213f AllJoyn: Fix invalid UTF-8 encoding
Fixes #18725.
2022-12-15 14:23:01 +00:00
João Valverde 8afd34c616 Alljoyn: Fix -Wdocumentation warnings 2022-12-15 14:23:01 +00:00
Martin Mathieson d17c018013 tools/check_typed_item_calls: check FT_BOOLEAN mask length 2022-12-15 13:28:05 +00:00
Jeremy Kerr ff728ab37d MCTP: Add decoder for message type
Once we have a full MCTP message, we can decode its type (including IC
field). This change adds type decode support, for the types present in
packet-mctp.h.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-12-15 12:21:06 +00:00
Jeremy Kerr cfcb33e8b7 MCTP: Add NCSI (and ethernet) over MCTP dissection
This change adds support for trivially-encapsulated MCTP protocols,
starting with NCSI-over-MCTP.

We need to handle this slightly different from the existing MCTP-based
protocols (MCTP control protocol and NVMe-MI), as the inner protocol is
unaware of the type byte and (optional) checksum tailer. So, add a new
dissector table, "mctp.encap-type" for these, meaning we can just hook
into the raw NC-SI dissector.

We also add the type definition for MCTP-over-ethernet, as defined in
the NCSI-over-MCTP specification.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-12-15 12:21:06 +00:00
Jeremy Kerr 728e89b955 MCTP: Add header for MCTP packet types
We have a few hard-coded MCTP type definitions in use (for MCTP control
protocol, and NVMe-MI) already, and we're about to add a couple more.

This change adds a header for packet-mctp, just with the type
definitions, and uses it for the current types.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-12-15 12:21:06 +00:00
Bernhard Dick 7b53d22b27 DECT-DLC: Remove abandonend part 2022-12-15 12:17:29 +00:00
Bernhard Dick 969f12c365 DECT-DLC: Unify variable naming
Naming of variables, i.e. for header fields was inconsistent (dlc_ vs
dect_dlc_). This is now changed to use the abbreviation (dect_dlc_) on
all global places.
2022-12-15 12:17:29 +00:00
Bernhard Dick f56a3fed08 DECT-DLC: Fix missing prototype 2022-12-15 12:17:29 +00:00
Bernhard Dick 584e65c950 DECT-DLC: Fix typos in hf definitions 2022-12-15 12:17:29 +00:00
Bernhard Dick 9a96284e5a DECT-DLC: Reassemble fragments
The DECT-DLC dissector now reassembles fragments before handing them
over to the NWK layer. Most of this is done by reusing of the reassembly code
from packet-lapdm.c.
2022-12-15 12:17:29 +00:00
Bernhard Dick 594207d04e DECT-DLC:DECT-DLC: Really disable abandoned func
The preprocessor definition to disable the stub
proto_reg_handoff_dect_aastra in packet-dect-dlc did not work, so it's
disabled via comment now.
2022-12-15 12:17:29 +00:00
Harald Welte c6fb1b2308 DECT-DLC: Don't call NWK dissector if there's no payload
Change-Id: Ia86185f52b724be61db2d94ffaf51fd00ebab84c
2022-12-15 12:17:29 +00:00
Harald Welte a13d71dab9 DECT-DLC: Initial dissector for DECT DLC protocol layer
Change-Id: Iabd75b0f9b12ea9162dc164741123feb1ba7992d
2022-12-15 12:17:29 +00:00
John Thacker 4672e73900 NBAP: Add UEID to HS-DSCH flows added from RadioLinkReconfiguration
A few HS-DSCH conversations are created when calling add_hsdsch_bind,
such as when a RadioLinkReconfigurationPrepare procedure has
a id-HSDSCH-MACdFlows-to-Add element. This method should add
the CommunicationContextID to the conversation just like the
other ways of creating the conversation. This provides a UEID
for a unique key for RLC reassembly.
2022-12-15 12:13:36 +00:00
João Valverde 38e73b895a SGsAP: Use ENC_APN_STR
Fixes #18701.
2022-12-15 03:08:39 +00:00
João Valverde 31ab1a0a17 SIP: Fix heap-use-after-free crash with ASAN
Fixes 358641a5ca.

Fixes #18735.
2022-12-15 02:13:30 +00:00
Brendan Meath 3a43d97898 NAS-5GS: change TLV to TLV_E for CAG Information list IE 2022-12-14 18:55:55 +00:00
Alexis La Goutte 8504578ec2 ieee80211: fix typo for encoding 2022-12-14 15:58:38 +00:00
Alexis La Goutte 30df11941b ieee80211: fix trailing whitespace 2022-12-14 15:58:38 +00:00
Alexis La Goutte 1856d1368a ieee80211: Add Location Civic (Measurement Report) 2022-12-14 15:58:38 +00:00
Alexis La Goutte 4b9aef8371 ieee80211: Add Location Civic (Measurement Request) 2022-12-14 15:58:38 +00:00
Alexis La Goutte 7191006bc4 ieee80211: Add Usage Rules/Policy Subelement
for LCI Report
2022-12-14 15:58:38 +00:00
Alexis La Goutte ce58638fe4 ieee80211: Add Measurement Request LCI Report dissection 2022-12-14 15:58:38 +00:00
Alexis La Goutte 0a5fcb4680 ieee80211: Update Measurement Request/Report value_string
From 802.11-2020.pdf
2022-12-14 15:58:38 +00:00
Alexis La Goutte b54c882df5 ieee80211: Add Measurement Request LCI Request dissection 2022-12-14 15:58:38 +00:00
Martin Mayer 4bbc640763 OCP.1: Fix Notification Context Parsing
The notification context field was parsed as a 4-byte fixed-length field but is defined as type OcaBlob (variable length).
This fix parses the notification context as an OcaBlob parameter while maintaining the field `ocp1.context`.
2022-12-14 15:54:10 +00:00
Jim Young dfa387d405 file-pcapng: Add Darwin Flow ID and Wake Packet flag 2022-12-14 15:52:26 +00:00
John Thacker 925904d6ce pkixqualified: Clear the oid at the start of each QCStatement
Clear the object_identifier_id global at the beginning of
each QCStatement, in case the statementId BER has errors and
does not put a value in the ptr. (call_ber_oid_callback correctly
handles being passed a NULL.)

Fix #18552.
2022-12-14 15:51:09 +00:00
Brian Sipos 9866cf3bad BPv7: Add conversation and endpoint tracking
This adds BPv7 source and destination as first-class text addresses for the packet.
This fixes proto-data used for decode-as table editing outside of a layer.
2022-12-14 15:44:36 +00:00
David Perry c6abd4ff7b Support SCTP over DTLS 2022-12-14 14:06:06 +00:00
Peter Dobransky 2d9e8416da OAM: Add support for missing DPoE and 1904.1 attributes
Add support for several DPoE and IEEE 1904.1 OAM attributes and
enhanced the decoding of several others.
2022-12-14 13:07:58 +00:00
David Fort bf158b3e41 tpkt: don't have the heuristic enforce TPKT dissecting
Most RDP connections starts with TPKT and then switch to TLS, so enforcing TPKT
for the whole conversation makes the decoding fail.
2022-12-14 12:00:47 +00:00
David Fort d90d525dd7 tls: do not enforce the TLS dissector for the whole connection
In the case of RDP traffic, the conversation usually starts with 3 TPKT packets
and then switch to TLS. The SSL dissector was setting the conversation dissector
without specifying any start packet which were leading to have the 3 first packets
interpreted as invalid SSL records (which they are as it's TPKT packets). This patch
fixes by specifying the first true SSL packet.
2022-12-14 12:00:47 +00:00
David Fort d560ae612a rdpudp: support desegmentation
The RDPUDP protocol transports TLS or DTLS records, but as the payload of RDPUDP is small,
most of the time records are splitted over multiple RDPUDP packets. This patch adds
support for desegmentation in RDPUDP so that we interpret the results of the SSL
dissector and we can give back untreated content when dissecting the next packet.
2022-12-14 12:00:47 +00:00
David Perry 8513da747d BGP: improve PDU handling 2022-12-14 09:22:34 +00:00
Gerald Combs dcf00fc3bd NCP: Add offset overflow checking.
Add and use check_offset_addition, which adds an expert item and throws
an exception if we're about to overflow our offset.

Fixes #18720
2022-12-14 08:57:44 +00:00
John Thacker 10666fb7c3 UMTS RLC: AMD and UMD PDUs can be larger than 255 bytes
AMD and UMD PDUs can be larger than 255 bytes, so the
offset should not be stored in a guint8. Otherwise,
the offset overflows and the last 256 bytes of the PDU
are added as an extra "fragment."
2022-12-14 08:56:56 +00:00
João Valverde 358641a5ca SIP: Fix fixed buffer UTF-8 string truncation
Fixes #18699
2022-12-14 08:56:26 +00:00
Alexis La Goutte 37c400afe3 usb-ccid: fix mask found by check_typed_items_calls
epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.stopIccClk  - mask has odd number of digits 0x100 expected max for FT_BOOLEAN is 8
epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.nadValNot0accept  - mask has odd number of digits 0x200 expected max for FT_BOOLEAN is 8
epan/dissectors/packet-usb-ccid.c filter= usbccid.dwFeatures.autoIfsd  - mask has odd number of digits 0x400 expected max for FT_BOOLEAN is 8
2022-12-13 14:16:11 +00:00
Alexis La Goutte 594aaca250 usb-ccid: fix typo found by check_typed_item_calls
packet-usb-ccid.c:598 proto_tree_add_item called for hf_ccid_wLevelParameter  -  item type is FT_UINT8 but call has len 2
2022-12-13 14:16:11 +00:00
John Thacker 2fd04b6ba9 bpv6: Fix possible infinite loop
display_extension_block is supposed to return the current offset,
not the number of bytes remaining. The number of bytes remaining
can be less than the current offset and cause an infinite loop.

In the case of an error, set lastheader and return the current
offset in order to break out of the main processing loop.

Fix #18711.
2022-12-13 07:33:19 -05:00
Pascal Quantin 73866d3623 RoHC: fix dissection of IP version alternate encoding for IP profile
As specified in RFC 3843 chapter 3.1
2022-12-12 20:43:04 +00:00
John Thacker f0002e0e3d umts_fp: Handle absent checksums when there is no payload
3GPP TS 25.427 and TS 25.435 both say that the Payload CRC IE
may only be present if the frame contains payload for E-DCH
frames, even where the setup of the transport bearer indicated
that the CRC would be present otherwise. So if there's no payload
and the CRC is missing, treat that as missing-but-expected rather
than marking the packet as malformed.

Take the opportunity to switch to proto_tree_add_checksum, which
handles all the various cases. Ping #8859
2022-12-12 15:00:27 +00:00
John Thacker ec30a03387 usb-video: Validate encoding of fourcc
Don't add raw bytes as a string; convert to UTF-8.

Fix #18713.
2022-12-12 08:41:42 -05:00
Gerald Combs 3924162f00 [Automatic update for 2022-12-11]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-12-11 20:24:56 +00:00
Ludovic Rousseau 699e9162d8 CCID USB: decode PC_RDR_SET_PARAMS & RDR_PC_PARAMS
Add decoding of the abProtocolDataStructure part of the command and the
response.
2022-12-11 15:55:51 +01:00
Ludovic Rousseau 5a260568b6 CCID USB: Correctrly identify protocol number
The bProtocolNum field is at offset 9, not 8.
Offset 8 is already used for bError.
2022-12-11 15:55:51 +01:00
Tomasz Moń cf6fd1248f
USB: Fix Darwin source and destination handling
Set the direction based on request type in a similar manner as it done
for other URB types, i.e. set source to host on URB submit. Correctly
set bus number based on locationID upper 8 bits.

Fixes #16768
2022-12-10 19:40:34 +01:00
John Thacker 29c6f4ebf1 H224: Add for Decode As
Add H224 as a possible type for Decode As for RTP Payload Type

Fix #18680
2022-12-09 10:13:00 +00:00
Chien Wong 82a0a5215d ieee80211: Fix SAE Confirm dissecting
IEEE 802.11-2020, Section 12.4.7.6 says that an SAE Confirm message,
with a status code not equal to SUCCESS, shall indicate that a peer
rejects a previously sent SAE Confirm message. In this case, the Confirm
message may not carry a Send-Confirm field or a Confirm field, as
hostapd does. So we simply ignore possible fields following Status code.

Signed-off-by: Chien Wong <m@xv97.com>
2022-12-09 06:37:51 +00:00
Odysseus Yang c19f31247f MBIM: Remove repeated hf_mbim_ms_device_slot_mapping_info_map_count 2022-12-08 20:42:58 +00:00
John Thacker bcc77ab189 http-urlencoded: Optimize parsing
Use tvb_find_guint8 and tvb_ws_mepbrk to find the
token boundaries for www-form-urlencoded. Use tvb_memcpy
to copy groups of bytes that don't have special characters
like + or %.

This is considerably more optimized (e.g. find_guint8 uses
memchr) than the naive loop, and speeds up the relevant part
by up to 10x.

Also handle cases where value is empty and there is no =
by splitting on &, instead of looking for the next =.

Together with bd1f2cc996, fix #13779.
2022-12-08 02:28:37 +00:00
David Perry d3fd7a92ec PCEP: Stub in support for more objects 2022-12-07 18:53:51 +00:00
Tomasz Moń bad5ae8c42
USB: Allow registering protocol specific dissectors
Formerly only the class specific dissectors could be registered for
bulk, control and interrupt endpoints. While this is sufficient for
major classes, there are some classes that only use one or two of
possible class/subclass/protocol triple values. Allow registering
specific triples so appropriate dissector can be automatically selected
based on CONFIGURATION DESCRIPTOR data.

Register DFU Run-Time and DFU Mode triples so user no longer needs to
manually set Decode As for USB DFU.
2022-12-06 16:36:18 +01:00
Tomasz Moń 2fcc819366
USBLL: Correctly handle last fragment retransmissions
Add fragment_add_check_with_fallback() and use it in USBLL dissector
instead of fragment_add_check() to avoid last fragment retransmissions
from being treated as separate transfers. With this change, the last
fragment retransmissions are correctly grouped together with the rest
of the transfer.

Only skip single fragment reassembly if retransmission is not possible
at the protocol level, i.e. for SETUP DATA0 (when it is not merged with
OUT data) and for isochronous transfers. The reassembly must not be
skipped for other transfers (especially for full-speed bulk) because
otherwise it wouldn't be possible to group retransmissions together with
the first data packet.

Do not use DATA0/DATA1 tracking for isochronous transfers. Isochronous
data cannot be retransmitted because there are no handshakes (there is
no ACK nor NAK after isochronous data packets).
2022-12-06 07:26:02 +01:00
Stig Bjørlykke 6558b58e58 dtls: Support Connection ID when using Block Ciphers
Add support for DTLS Connection ID when using Block Ciphers
with the deprecated extention type (53) from
draft-ietf-tls-dtls-connection-id-07.

Closes #18705
2022-12-05 14:05:34 +00:00
João Valverde b29ee628e2 IPv6: Remove some redundancies in address detail
The loopback and unspecified addresses are repeated. Keep
only the "special purpose" field, in accordance with the
IANA registry (and unlike RFC 4291) to remove the redundancy.

Add the "Unique Local Unicast" range to address space field,
also from the IANA registry.

Unique-Local and Link-Local are still repeated in both fields.
Oh well...
2022-12-05 13:39:38 +00:00
João Valverde d216f0a6e2 IPv6: Add special-purpose address detail
Add a field to show special purpose assignments listed in [1].

[1] https://www.iana.org/assignments/iana-ipv6-special-registry/iana-ipv6-special-registry.xhtml
2022-12-05 13:39:14 +00:00
João Valverde f8d308e9af Kafka: Add more loop checks
Add a safeguard to limit the maximum number of iterations.

Do not allocate a new buffer for every loop iterations in a loop that
depends on the result of the decompression routine.

Either allocate the buffer once or free after use. Defensive programming
is more important than speed in this case.
2022-12-05 11:53:31 +00:00
Kevin Albertson 266a0d38b4 kafka: fix note of ZSTD_decompressStream return 2022-12-05 00:16:59 +00:00
Kevin Albertson 9412adf7bf kafka: stop decompressing once all input is consumed 2022-12-05 00:16:59 +00:00
John Thacker c36dde6e13 nxp_802154_sniffer: Add heuristics
UDP port 49999 is not IANA registered, so add some heuristics
to the NXP 802.15.4 sniffer so that it doesn't claim packets
from other protocols that have chosen that ephemeral port.

Don't return 0 after already adding things to the tree; do that
check in the heuristics.

Fix #18695
2022-12-04 23:51:10 +00:00
Gerald Combs 3b7df80a0a [Automatic update for 2022-12-04]
Update manuf, services enterprise numbers, translations, and other items.
2022-12-04 16:48:16 +00:00
Martin Mathieson eba1f048b3 E2AP: Use S-NSSAI field in KPM 2022-12-04 13:38:12 +00:00
João Valverde f96885ab06 IPv6: Add multicast scope and flags address detail 2022-12-04 12:57:49 +00:00
Martin Mathieson b7c3bae518 check_typed_item_calls: add check for add_bitmask fields 2022-12-03 17:15:24 +00:00
João Valverde 32f88ad22c wmem: Remove strbuf max size parameter
This parameter was introduced as a safeguard for bugs
that generate an unbounded string but its utility for
that purpose is doubtful and the way it is being used
creates problems with invalid truncation of UTF-8
strings.

Rename wmem_strbuf_sized_new() with a better name.
2022-12-03 01:54:52 +00:00
Harald Welte 3311b34106 gsmtap: Support V5-in-GSMTAP
GSMTAP has had support for various other ISDN related protocols as
sub-types of the GSMTAP_TYPE_E1T1 type.  We've recently started to work
on V5 (ITU-T G.964/G.965) and introduced a new sub-type for this.

Let's add the related dispatch from packet-gsmtap.c to packet-v5ef.c
2022-12-02 16:49:20 +01:00
Peter Dobransky 8683c4e328 Add support for missing DPoE and IEEE 1904.1 OAM attributes
DPoE
- D-ONU Packet Buffer (0xD7000A)

IEEE 1904.1
- aReadWriteMACAddress (0x07/0x00-1D)
- aPhyType (0x07/0x00-20)
- aAutoNegotiationAdminState (0X07/0x00-4F)
- aMACControlFunctionsSupported (0x07/0x00-5D)
- acConfigMulticastLlid (0xD9/0x01-07)
2022-12-02 08:35:02 +00:00
John Thacker 13823bb105 openflow_v6: Prevent infinite loops in too short ofp_stats
The ofp_stats struct length field includes the fixed 4 bytes.
If the length is smaller than that, report the length error
and break out. In particular, a value of zero can cause
infinite loops if this isn't done.
2022-12-01 21:18:12 -05:00
John Thacker 0e11932183 kafka: Don't try to decompress if the length is zero.
There's no point in trying to decompress a message with
length zero, and some of the third party decompression
libraries (e.g. zstd) can give unexpected results that
lead to infinite loops if we do so. A message length zero
is almost surely a file with errors.
2022-12-01 20:43:39 -05:00
John Thacker 8623cd9746 icmpv6: Format DNS name as UTF-8 for output
DNS names technically have arbitrary unknown encoding.
When adding them as a string for output, format as UTF-8.

Fix #18689
2022-12-01 08:23:51 -05:00
John Thacker f2a0d25dba bpv6: Prevent infinite loops
display_extension_block is supposed to return the current offset,
not the number of bytes remaining, which can be less than the current
offset and cause an infinite loop. In the case of errors, set
lastheader and return the current offset to break out of loops.
2022-12-01 01:40:17 +00:00
Bernhard Dick 415296436b DECT-MITEL-ETH: Fix #18683
Adds missing NULL-termination in headerfield list in
dissect_dect_mitel_eth_mac_con_ind and removes handover to general data
dissector as this is path is no longer reached due to handling the
different message types within this dissector.
2022-11-30 23:53:34 +01:00
Joakim Karlsson 4b0bf62791 asn2wrs: disable template line directive by default
Same as with !8955, To debug with line directive build with
-DENABLE_DEBUG_A2W=ON flag
2022-11-30 17:31:46 +00:00
João Valverde 729ea56b46 wmem: Remove wmem_strbuf_new_label()
Only dissectors are using this function and there is no use case,
as far as I know, that requires its use. Any limitation of length
is imposed transparently by the UI backend.

This function is problematic because it is not Unicode aware and
will truncate a string on an arbitrary byte boundary for multibyte
strings.

Replace its use with a normal strbuf without a length limite and
remove the function because it is not useful and the ITEM_LABEL_LENGTH
parameter does not belong in wmem anyway.
2022-11-30 15:55:54 +00:00
John Thacker 8a67ca77e6 http: Check CitrixAGBasic Auth encoding
CitrixAGBasic Authentication has Base64 encoded values. The result of
Base64 decoding is not guaranteed to be valid UTF-8 (or ASCII), so
verify it.

Also add the username and password to the credentials tap.

Fix #18677.
2022-11-30 07:54:01 -05:00
John Thacker 10c84b6450 HTTP2: Load dynamic hf entries when UAT is changed
The dynamic hf entries for HTTP2 read from the UAT should be
changed when the UAT is changed or reset, not on each file
load and file close. If a field is added as a column, coloring
rule, or filter, and the capture file is changed, deregistering
the field and reregistering it can cause a crash.

Use the same approach as with HTTP and SIP, slightly modified
because in HTTP2 the header fields hash contains the static
headers as well, to prevent adding duplicate entries via the UAT.

Fix #14768
2022-11-30 11:04:05 +00:00
Joakim Karlsson 5b8cb733fa asn2wrs: disable line directive by default
To debug with line directive build with -DENABLE_DEBUG_A2W=ON flag
2022-11-30 11:03:09 +00:00
Martin Mathieson c69d0114ea tools/check_static.py - fix remaining errors 2022-11-30 08:49:38 +00:00
Martin Gallo 129ed6d4c4 SAPSNC: Added SAP SNC as main dissector 2022-11-29 13:34:38 +00:00
John Thacker 9a19d48736 CIMD: Implement User Data encoding
When CIMD indicates that a message was sent in the 7 bit GSM alphabet,
each character has been converted to ASCII or ISO-8559-1 with the
use of combining escape sequences for characters not present in
the destination encoding. Properly convert back to GSM 7 bit encoding
and then to UTF-8 for display.

Fix #18676.
2022-11-29 07:02:26 -05:00
João Valverde f6e850af47 AJP13: Remove odd use of ITEM_LABEL_LENGTH 2022-11-29 10:22:44 +00:00
João Valverde a0d77e9329 dfilter: Return an error object instead of string
Return an struct containing error information. This simplifies
the interface to more easily provide richer diagnostics in the future.

Add an error code besides a human-readable error string to allow
checking programmatically for errors in a robust manner. Currently
there is only a generic error code, it is expected to increase
in the future.

Move error location information to the struct. Change callers and
implementation to use the new interface.
2022-11-28 15:46:44 +00:00
Bernhard Dick 7fc7830b13 DECT-MITEL-ETH: gint -> int for hf 2022-11-28 15:04:15 +00:00
Bernhard Dick 7cde243a66 DECT-MITEL-RFP: gint -> int for hf 2022-11-28 15:04:15 +00:00
Bernhard Dick 76ff611966 DECT-MITEL-RFP: Dissection of SYNC messages
Adds dissection of the SYNC message type with the following payloads:
* FREQ_CTRL_MODE_IND
* FREQ_CTRL_MODE_CFM
* SET_FREQUENCY
* START_MAC_SLAVE_MODE_IND
* SYSTEM_SEARCH_IND
* SYSTEM_SEARCH_CFM
* PHASE_OFS_WITH_RSSI_IND
2022-11-28 15:04:15 +00:00
Bernhard Dick 03dd33f740 DECT-MITEL-RFP: Improve display
Add unit display for some header fields
2022-11-28 15:04:15 +00:00
Bernhard Dick d67d08cf9b DECT-MITEL-RFP: Improve includes
More of a cosmetic change but ensure all includes refer to their
directory (i.e. epan/)
2022-11-28 15:04:15 +00:00
Bernhard Dick 7afe726007 DECT-MITEL-RFP: Reorder message dissection 2022-11-28 15:04:15 +00:00
Bernhard Dick 992c1fa616 DECT-MITEL-RFP: Add more messages
Add dissection of the following messages:
* SYS-HEARTBEAT-INTERVAL
* SYS-SYSLOG
* SYS-MAX-CHANNELS
* SYS-HTTP-SET
* SYS-PASSWD
* SYS-RPING
* SYS-CORE-DUMP
* SYS-VSNTP-TIME
* SYS-LICENSE-TIMER
2022-11-28 15:04:15 +00:00
Bernhard Dick 6f8a847b63 DECT-MITEL-RFP: Fix MEDIA-OPEN dissection 2022-11-28 15:04:15 +00:00
Bernhard Dick abea8b8b4a DECT-MITEL-RFP: Set proto length in DECToE case 2022-11-28 15:04:15 +00:00
Bernhard Dick a6c6afedef DECT-MITEL-ETH: Improve subtree len handling
Read the length for the subtree length for RFPc items at the same moment
the length field is added and update the subtree's length afterwards.
2022-11-28 15:04:15 +00:00
Bernhard Dick 443b0a4623 DECT-MITEL-RFP: Simpler TCP port registration
When using dissector_add_uint_with_preference no explicit definition of
the Port configuration option is needed. Thus remove unnecessary code.
2022-11-28 15:04:15 +00:00
Bernhard Dick 397d802618 DECT-MITEL-RFP: Fix spelling 2022-11-28 15:04:15 +00:00
Bernhard Dick 9a2cc2f8e2 DECT-MITEL-ETH: Fix spelling 2022-11-28 15:04:15 +00:00
Bernhard Dick 42927f3953 DECT-MITEL-RFP: Add MEDIA message dissection
Add dissection for the following messages:
* MEDIA-OPEN
* MEDIA-CONF
* MEDIA-START
* MEDIA-STOP
* MEDIA-STATISTICS
* MEDIA-REDIRECT-START
* MEDIA-REDIRECT-STOP
* MEDIA-RESTART
* MEDIA-DTMF
* MEDIA-TONE
2022-11-28 15:04:15 +00:00
Bernhard Dick c42800fa4d DECT-MITEL-ETH: Fix filter name 2022-11-28 15:04:15 +00:00
Bernhard Dick 7e5d5c2ddf DECT-MITEL-ETH: Improve MCEI dissection
Transfer dissection of MCEI field into own function and dissect MCEI in
messages where it was missing.
2022-11-28 15:04:15 +00:00
Bernhard Dick 6f216b9dbb DECT-MITEL-RFP: Remove unused assignments 2022-11-28 15:04:15 +00:00
Bernhard Dick 792fdf05ca DECT-MITEL-ETH: Remove unused assignment 2022-11-28 15:04:15 +00:00
Bernhard Dick 863f7d902d DECT-MITEL-ETH: Fix function naming 2022-11-28 15:04:15 +00:00
Bernhard Dick 7fcf2f8d36 DECT-MITEL-RFP: Improve protocol tree structure 2022-11-28 15:04:15 +00:00
Bernhard Dick 6fd2c267b4 DECT-MITEL_RFP: Honour work from zivillian
The dissection of the DECT-MITEL-RFP protocol is based upon findings
that resulted in rfpproxy, so I think it is a good idea to also name the
author in the source file
2022-11-28 15:04:15 +00:00
Bernhard Dick 8a05fc6a2a DECT-MITEL-RFP: Add SYS-IP-OPTIONS dissection 2022-11-28 15:04:15 +00:00
Bernhard Dick ca540b120a DECT-MITEL-ETH: Improve protocol tree
Put DECT-MITEL-ETH content beneath a tree item in the protocol tree and
use own indices for all different subtree types
2022-11-28 15:04:15 +00:00
Bernhard Dick de7594f58d DECT-MITEL-ETH: Add more RFPc item dissections
Add dissection for the following RFPc message item types:
* Revision
* RFPI
* Higher layer capabilities
* MAC capabilities
* Statistics data
* RFP_PLI
* Extended capabilities
2022-11-28 15:04:15 +00:00
Bernhard Dick 4c9da8039f DECT-MITEL-ETH: Begin dissection of RFPc
Add basic function to dissect RFPc messages and dissection of the RFPc
Extended capabilities message
2022-11-28 15:04:15 +00:00
Bernhard Dick 3bc96a57e4 DECT-MITEL-ETH: Move MAC_PAGE_REQ to function 2022-11-28 15:04:15 +00:00
Bernhard Dick b757b7fed2 DECT-MITEL-ETH: Improve MAC_INFO_IND
Move MAC_INFO_IND to own function call and also dissect PMID field
2022-11-28 15:04:15 +00:00
Bernhard Dick 73fe413b46 DECT-MITEL-ETH: dissect more fields
Add dissection for
* MAC_HO_IN_PROGRESS_IND
* MAC_HO_IN_PROGRESS_RES
2022-11-28 15:04:15 +00:00
Bernhard Dick c4daae6a1e DECT-MITEL-ETH: Improve MAC_DIS_IND dissection 2022-11-28 15:04:15 +00:00
Bernhard Dick 5e1c929697 DECT-MITEL-ETH: Add MAC_CLEAR_DEF_CKEY_REQ 2022-11-28 15:04:15 +00:00
Bernhard Dick 5d6cffc2d0 DECT-MITEL-ETH: Improve MAC_CON_IND
Update PMID field length (20bits instead of 2 bytes), move
MAC_CON_IND dissection into own function call and add flags field
2022-11-28 15:04:15 +00:00
Bernhard Dick cac1709e8d DECT-MITEL-ETH: Add more field dissection
Add dissection for
* MAC_ENC_KEY_REQ
* MAC_ENC_EKS_IND
* MAC_HO_FAILED_IND
2022-11-28 15:04:15 +00:00
Bernhard Dick 15edf3b3ce DECT-MITEL-ETH: Add Layer field and Mt 2022-11-28 15:04:15 +00:00
Bernhard Dick 534e594a34 DECT-MITEL-RFP: Begin of OMM/RFP protocol
This is the begin of a basic dissection of the proprietary protocol used
by the Mitel OMM/RFP communicatino over TCP. Currently no decryption is
supported so there is the need of external decryption.
2022-11-28 15:04:15 +00:00
Bernhard Dick d4a4d8ebc0 DECT-MITEL-ETH: Add IP encapsulated behaviour
The ETH protocol has an two byte field that is only used when
transported over RAW Ethernet and a length indicator in that case.
Those two fields are not present if the ETH protocol is encapsulated
in the OMM/RFP communication protocol.
To make this dissector also useable when used after dissecting
DECT-MITEL-RFP distinguishing between both packet structures has
been included.
2022-11-28 15:04:15 +00:00
Bernhard Dick a31c5923e1 DECT-MITEL-ETH: Unify naming
This commit unifies the naming within the dissector for the DECT over
Ethernet protocol within the Mitel DECT base stations (RFPs).
2022-11-28 15:04:15 +00:00
Pascal Quantin 849e0fae46 S1AP: restore g09914cca
It was reverted by mistake in g47a1b0f9
2022-11-28 14:06:18 +00:00
Jim Young 963877e921 discard: Implement dissector for RFC 863 2022-11-28 13:24:17 +00:00
AndersBroman 47a1b0f9da S1AP: Wrong ie id used on RequestTypeAdditionalInfo 2022-11-28 09:34:15 +01:00
Ales Povalac 60168c1c70 LoRaWAN: support for Class-B and v1.0.4 specification 2022-11-28 07:07:53 +00:00
Gerald Combs c3d02eeb38 [Automatic update for 2022-11-27]
Update manuf, services enterprise numbers, translations, and other items.
2022-11-27 16:47:44 +00:00
easonweii 927ea482ba H224:Resolve some client IDs parsing problems.
There are some problems in the parsing of Extended Client IDs and Non-Standard Client IDs in the previous code, which are now fixed.
Related #18655
2022-11-27 09:18:16 +00:00
João Valverde d42ff693d9 HSP+HFP: Fix invalid UTF-8 string truncation
Fixes #18656.
2022-11-26 11:11:36 +00:00
João Valverde 27ea011dd3 802.11: Remove artificial string truncation
The wmem_strbuf_new_label() creates a new buffer with a length limit
in octets. With multibyte strings this is likely to generate invalid
UTF-8 errors.

Remove the artificial limit on the value size. The
function proto_tree_add_string() sets the value, and truncating
that to an arbitrary limit is not really correct.

The display label will be truncated to a preset length by the UI.
This mechanism uses ws_label_strcpy() and is designed to avoid
the invalid truncation.

While here use wmem_strbuf_get_str() instead of wmem_strbuf_finalize().

Accepted best practice is to let the scope free the memory.
Removing the finalize call avoids an unnecessary realloc.

Fixes #18653.
2022-11-25 18:06:57 +00:00
Eason Wei 9d01610729 H224: Fix the missing Q.922 header in H.224 dissector 2022-11-24 15:48:46 +00:00
Kevin Albertson 30d829d429 use proto_tree_add_checksum 2022-11-24 09:21:51 +00:00
Kevin Albertson 3f8ae9a08d mongo: add Checksum field 2022-11-24 09:21:51 +00:00
Matan Perelman 15b3deff27 lapdm: Fix reused fragment id reassembly
Fixes #18676
2022-11-23 15:48:22 +00:00
John Thacker 26dda2ba78 H264, H265: Fix overflow value of se(v)
For signed exponential Golomb, fix a typo when testing if
value was even or odd that resulted in a no-op. This was
mapping all overflows to G_MININT32 instead of half of them
to G_MAXINT32.
2022-11-23 14:47:01 +00:00
John Thacker e6d81e8731 ANSI IS-637 A: Use tvb_new_octet_aligned for addresses
Use tvb_new_octet_aligned when adding addresses (strings or bytes)
that are not byte aligned. That is not only clearer code, but also
prevents attempting to add unvalidated strings.

Since we're aligning the fields properly, get rid of the extra
fields for the MSB of the first field and LSB of the last field.

Fix #18664
2022-11-23 07:01:19 -05:00
Richard Sharpe b8a50617d7 ieee80211: Fix an CLang warning about dead code in my recent MR. 2022-11-23 07:10:27 +00:00
Martin Mathieson 793365d0e0 Fix some issues seen with cppcheck 2022-11-22 20:55:24 +00:00
John Thacker ec353e89f3 SIP: Extract entire Call-ID without truncating
RFC 3261 does not put a limit on the maximum size of Call-ID.
(Some implementations do, such as at 256 bytes.) Truncating
it can produce invalid UTF-8 if there's also errors that
turn into UTF-8 replacement characteres.

A reduced size is still used for the hash table lookup.

Add an expert info warning if Call-ID is missing, as it's
a mandatory field.

Fix #18620.
2022-11-22 16:21:42 +00:00
Alexis La Goutte 6dcfb07b7d BGP: Fix (reader_)offset for IGMP
fix typo (offset => reader_offset)

Close #18660
2022-11-22 13:04:18 +00:00
Martin Gallo fdc211984f SAPMS: Added SAP MS as main dissector 2022-11-22 09:27:10 +00:00
Martin Gallo 82b5201f79 SAPRouter: Added SAP Router as main dissector 2022-11-21 15:01:59 +00:00
Richard Sharpe 43fb308437 Zieee80211: Provide compressed feedback matrices for VHT as well as HE.
!18574
2022-11-21 03:37:07 +00:00
Richard Sharpe ee4703094f ieee80211: Beamforming fixes 2022-11-21 03:37:07 +00:00
John Thacker 06b4a84901 XNAP: Use bitmask for E-UTRA and NR cell identities
Instead of using tvb_get_bits and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.

This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)

When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
2022-11-21 00:57:12 +00:00
John Thacker b10e26d742 NGAP: Use bitmask for NRCellIdentity and EUTRACellIdentity
Using a bitmask in the field definition allows us to use
proto_tree_add_item, which means that when print.c writes
PDML and JSON, the value written is the correctly masked
value (PDML also includes the unmasked value.)

When functions like proto_tree_add_uint are used instead,
the value written to PDML and JSON is the original value
from the packet buffer, not properly shifted.
2022-11-20 23:57:12 +00:00
Gerald Combs f9e0e555e0 [Automatic update for 2022-11-20]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-11-20 16:46:55 +00:00
John Thacker 09914cca33 S1AP: Use bitmask for cellIdentity
Instead of using tvb_get_bits32 and proto_tree_add_uint,
use a bitmask in the field info and proto_tree_add_item.

This means that when epan/print.c writes PDML or JSON,
the value written is the correctly masked value (PDML also
includes the unmasked value.)

When proto_tree_add_uint is used, the value written to
PDML and JSON is the original value from the packet buffer,
not properly shifted.
2022-11-20 12:56:08 +00:00
John Thacker 92208e4330 HTTP2: Ensure that the unescaped header value is valid encoding
It's possible, in the case of errors, for the result of
g_uri_unescape_string not to be valid UTF-8, either if originally
some other encoding was percent-encoded, or if there were errors.
Check for it.

Fix #18658.
2022-11-20 11:44:39 +00:00
João Valverde f3a96bc18c IAX2: Fix UTF-8 string encoding
Fixes #18651.
2022-11-18 11:32:13 +00:00
John Thacker 8037ecf93f mip6: Use ENC_APN_STR 2022-11-18 10:59:19 +00:00
João Valverde 45c15019ac AT: Fix UTF-8 string encoding
Fixes #18650.
2022-11-18 10:11:00 +00:00
João Valverde 6bc87f01da T.30: Fix UTF-8 encoding
Fixes #18649.
2022-11-18 10:10:07 +00:00
Martin Mathieson 709d65883f Fix some cppcheck issues 2022-11-18 10:07:57 +00:00
John Thacker 45cc56746b aol: Token encoding
The token is a 2 character ASCII string. Treat it as such.

Fix #18616.
2022-11-17 14:22:05 +00:00
Ferry Huberts 7a29f10d6d locamation-im: restore showing the eol character in the hex dump
This got lost in b00725c945.

Showing the eol character is important to us.

Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2022-11-17 12:35:23 +00:00
Ferry Huberts 16107683c6 locamation-im: line numbers are never used for split lines, lose them
Signed-off-by: Ferry Huberts <ferry.huberts@pelagic.nl>
2022-11-17 12:35:23 +00:00
Martin Mathieson 7efa4cb9a4 ORAN FH CUS: More changes to line up samples properly for Mod Compr 2022-11-17 09:33:42 +00:00
John Thacker b00725c945 locamation-im: Fix encoding
Add strings with proto_tree_add_item or tvb_get_string_enc;
avoid using tvb_get_raw_bytes_as_string.

Use UTF-8 as the encoding to future-proof, according to
Locomation.

Use tvb_find_line_end() to split the lines, which does almost
all the needed logic and simplifies the code.

Fix #18632
2022-11-17 03:04:48 +00:00
João Valverde 09718fb9b3 CMake: Move clang warnings
Move clang warnings to normal set. Let the CMake compatibility
check control the warning.

Fix or work-around -Wunreachable warnings in the code.
2022-11-17 01:35:16 +00:00
João Valverde 7ce4b153ae X509IF: Fix null pointer dereferencing.
Fixes #18652.
2022-11-17 01:09:07 +00:00
João Valverde c37bb02484 Regenerate ASN.1 dissectors 2022-11-17 01:08:47 +00:00
Dario Lombardo baaf60cb34
ptp: prevent divide by zero.
Check for valid values before use.

Fix: #18635.
2022-11-16 22:25:42 +01:00
João Valverde fc28bb0502 X509IF: Remove another fixed length buffer 2022-11-16 20:27:35 +00:00
João Valverde 59ee5247dc X509IF: Fix string truncation
Use a wmem_strbuf_t to avoid a truncation in the middle of a
multibyte character with a fixed length buffer.

Fixes #18543.
2022-11-16 20:27:35 +00:00
John Thacker 8fd375cfad tcp: Use correct wraparound comparison in sequence analysis
maxseqtobeacked needs to be increased when it's lower than
nextseq, not the other way around, otherwise we can get repeated
extra TCP ACKed unseen segment messages.

Since sequence analysis is always on the absolute sequence
numbers, not relative, it needs to use LT_SEQ to handle wraparound.

Fix #18558. Fix #18633.
2022-11-16 12:58:27 +00:00
Martin Mathieson 9b644f7f84 ORAN FH CUS: Start on Modulation Compression Support 2022-11-16 09:58:08 +00:00
David Perry 714ee652cd Refactor PCEP object dissection for readability 2022-11-16 08:20:40 +00:00
AndersBroman 1e5f909617 RTPProxy: Remove newlines from col info. 2022-11-16 08:15:39 +00:00
John Thacker 03a4eed570 ppp: Check to see if process_reassembled_data gave us a tvbuffer
It's possible to have multiplexed PPP MP that occurs in several
layers in the same frame, so we need to check that we're in the
right packet and also the right layer. process_reassembled_data
does that, so check to see if it returned a tvb instead of
just checking the frame number. Prevents some DISSECTOR BUG errors
when the buffer isn't actually available.
2022-11-16 01:18:14 +00:00
David Perry 99d3112464 Show the address space of IPv6 addresses 2022-11-15 16:38:30 +00:00
Pascal Quantin 6b41ad918b PCAP: upgrade dissector to v17.0.0
In their infinite wisdom, 3GPP succeeded to make non backward compatible
ASN.1 description
Closes #18646
2022-11-15 16:04:54 +01:00
Pau Espin 37a0ccee9c GSM A-bis/OML: Show NACK cause descriptions 2022-11-15 10:23:47 +00:00
Jeremy Kerr 889e5331dc Add NVMe Management Interface (NVMe-MI) dissector
This change adds a small dissector for the NVMe-MI protocol, typically
for tunelling Administration commands over an MCTP (over I2C) channel.

We just decode the request and response headers, and leave the payload
as raw data.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-11-15 09:05:05 +00:00
Jeremy Kerr baf7a3c493 Add MCTP control protocol dissector
This change adds a very basic dissector for the MCTP control protocol -
just the header fields, leaving the raw payload data.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-11-15 09:05:05 +00:00
Jeremy Kerr e1cbe02cce Add Management Component Transport Protocol (MCTP) dissector
This change adds a protocol dissector for the Management Component
Transport Protocol (MCTP). This is a failry simple datagram-based
protocol for messaging between components within a single platform,
typically over I2C, serial or PCIe.

This dissector just implements the header fields, and sequence-number
based message reassembly. Inner protocols will be added as follow-up
changes.

Linux has support for AF_MCTP data, so decode from the MCTP SLL ltype.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
2022-11-15 09:05:05 +00:00
AndersBroman b704562c0c RTPProxy: Make column info more readable. 2022-11-15 09:29:19 +01:00
Martin Gallo 59fdaa7d07 SAPEnqueue: Added SAP Enqueue Server as main dissector 2022-11-14 20:35:17 +00:00