Commit Graph

41573 Commits

Author SHA1 Message Date
Jonas Falkevik 34b41729f9 lcsap: fix decode of plmnIdentity
Corretly decode MNC if it consists of 3 digits
Change to what is called big endinan MNC

   8   7   6   5   4   3   2   1
 +---+---+---+---+---+---+---+---+
 |  MCC digit 2  |  MCC digit 1  |  octet x
 +---------------+---------------+
 |    Filler     |  MCC digit 3  |  octet x+1
 +---------------+---------------+
 |  MNC digit 2  |  MNC digit 1  |  octet x+2
 +---------------+---------------+

 MNC of length 3:

   8   7   6   5   4   3   2   1
 +---+---+---+---+---+---+---+---+
 |  MCC digit 2  |  MCC digit 1  |  octet x
 +---------------+---------------+
 |  MNC digit 1  |  MCC digit 3  |  octet x+1
 +---------------+---------------+
 |  MNC digit 3  |  MNC digit 2  |  octet x+2
 +---------------+---------------+

From 3GPP TS 29.171
7.4.27 PLMN Identity

- digits 0 to 9, encoded 0000 to 1001,
- 1111 used as filler digit, two digits per octet,

- bits 4 to 1 of octet n encoding digit 2n-1
- bits 8 to 5 of octet n encoding digit 2n

The Selected PLMN identity consists of 3 digits from MCC followed by either
- a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
- 3 digits from MNC (in case of a 3 digit MNC).


(cherry picked from commit 156f9e81fc)
2020-10-29 10:07:09 +00:00
Huang Qiangxiong 1d6de11c49 Protobuf: fix bugs about field subdissector
Don't try to dissect bytes as string and show its value item if the
bytes field has a subdissector. And add field subdissector under field
item instead of value item.

close #16956


(cherry picked from commit 1c5d577d63)
2020-10-29 00:02:08 +00:00
Jaap Keuter a4213f2c4f Create protocols to the end of the TVB if length unknown upfront
Creating protocols with unknown length must be created to the end of the TVB
first and reined back using proto_set_len() once the length becomes known.
Not doing so can make indentification of problems harder and prevents analysis
engines like MATE from properly processing the generated protocol trees.
With this change the remaining offending dissectors are corrected for this.

Closes #16961


(cherry picked from commit 918db88055)
2020-10-28 14:38:33 +00:00
Stig Bjørlykke d28275c397 lte-rrc: Pluralize PagingRecord(s)
(cherry picked from commit edd71daa90)
2020-10-28 13:38:14 +00:00
Dieter Dobbelaere 13d0b4e400 Fix typo: 'descriptionfor' -> 'description for'.
(cherry picked from commit 7c9eb8b235)
2020-10-28 11:03:53 +00:00
Guy Harris 928f32e85c Add a new record type REC_TYPE_SYSTEMD_JOURNAL.
Systemd journal entries aren't file-type-specific; they're found in both
systemd journal entry blocks in pcapng files and in systemd journal
export files.  Give it a record type, for use with both file types.

This fixes #16955.

It also means that you can open a systemd journal export file and save
it as a pcapng file.


(cherry picked from commit 889e0d5cb6)
2020-10-28 04:16:42 +00:00
Stig Bjørlykke ab41153f22 AT: Handle response without leading \r\n
The AT response may not contain a leading \r\n, so avoid checking
for this to determine if it's a response. This characters will be
removed as a part of white space removal anyway.


(cherry picked from commit 5413331ed3)
2020-10-27 07:46:53 +00:00
Gerald Combs 74eeba5787 USB HID: Initialize a struct.
Initialize a variable caught by Valgrind. Fixes #16938.


(cherry picked from commit 273eb06390)
2020-10-25 09:32:30 +00:00
Gerald Combs eff9f0fb0d Initialize release-3.4.
Initialize the release-3.4 branch.
2020-10-22 11:38:47 -07:00
Stig Bjørlykke 10e6cb5f37 wslua: Make pinfo.p2p_dir writable
Make pinfo.p2p_dir writeble from Lua to be able to set the direction
for sub-dissectors.
2020-10-22 14:18:58 +00:00
robionekenobi f267a0433d packet-mq: Improve and fix bugs
Improve MultiSegment display
Fix Option (endianess) in MQCLOSE
Add missing parsing for Q_MGR_STATUS_ATTRS
Some minor code reformatting
2020-10-22 12:04:27 +00:00
George Hopkins e16ef82d7c Elasticsearch: support for version >= 5 2020-10-22 08:23:10 +00:00
Nardi Ivan e6adc940ac QUIC: update to draft-32 2020-10-22 07:43:01 +00:00
aaptel fef3b86b38 SMB2: fix EaSize field in QUERY DIR responses
According to [MS-FSCC] if the file has the REPARSE_TAG attribute, the
EaSize field must be interpreted as a reparse tag for the following
info levels:

* FileFullDirectoryInfo
* FileBothDirectoryInfo
* FileIdFullDirectoryInfo
* FileIdBothDirectoryInfo
2020-10-22 06:48:26 +00:00
John Thacker e110da70a4 Update validate_single_byte_ascii_encoding with new encodings
Add various other encodings that differ from ASCII in the ISO/IEC 646
invariant region to the reject list for validate_single_byte_ascii_encoding()
2020-10-22 05:21:39 +00:00
Joakim Karlsson 0929eea9fc pfcp: Update to 3GPP TS 29.244 V16.4.0
Change-Id: I31d3123c948cf3f472a384143ca77b756e83c773
2020-10-22 04:58:52 +00:00
Martin Mathieson 27157055cf BSSGP: Make some item calls match field lengths.
From tools/check_typed_item_calls.py output:

epan/dissectors/packet-bssgp.c:655 proto_tree_add_item called for hf_bssgp_bss_area_ind  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-bssgp.c:1468 proto_tree_add_item called for hf_bssgp_unit_val  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:1469 proto_tree_add_item called for hf_bssgp_gprs_timer  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:2606 proto_tree_add_item called for hf_bssgp_unit_val  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:2607 proto_tree_add_item called for hf_bssgp_gprs_timer  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:2635 proto_tree_add_item called for hf_bssgp_unit_val  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:2636 proto_tree_add_item called for hf_bssgp_gprs_timer  -  item type is FT_UINT8 but call has len  3
epan/dissectors/packet-bssgp.c:3276 proto_tree_add_item called for hf_bssgp_cell_acc_mode  -  item type is FT_UINT8 but call has len  4
2020-10-22 04:36:30 +00:00
Joakim Karlsson d1f0f08052 gprscdr: Update to 3GPP TS 32.298 V16.6.1
Change-Id: Id6e4504405b2d909d0ff9f044b4c1b1f99d3d407
2020-10-22 03:40:38 +00:00
John Thacker e20bd408de Use iconv to support GB 18030 and EUC-KR, allow future encodings
Add support internally to using iconv (always present with glib) to convert
strings from various encodings to UTF-8 (using REPLACEMENT CHARACTER as
recommended), and use that to support GB 18030 and EUC-KR. Replace call
directly to iconv in ANSI 637 for EUC-KR to new API. Update comments
and documentation around character encodings. It is possible to replace
the calls to iconv with an internal decoder later. Tested on Linux and
on Windows (including with illegal characters). Closes #16630.
2020-10-21 11:26:23 +00:00
Mikael Kanstrup ad69ec2e11 dot11decrypt: Fix WEP decryption
For WPA security association (SA) entries are created on sucessful
PTK derivation from 4-way handshake frames. WEP though don't use
4-way handshake frames for key derivation and therefore no SA entry
is created. Still WEP decryption implementaton expects to find
an SA otherwise the decryption is skipped.

Fix broken WEP decryption by removing the check for an existing SA
entry and instead form the SA on first successful decryption.

Add also a test for WEP decryption.

Fixes: v3.3.0rc0-1263-g099d241046 ("dot11decrypt: Avoid allocating SA on packet decryption")
2020-10-21 11:03:44 +00:00
John Thacker e814fe0c9b SOCKS: fix desegmentation over multiple TCP segments
The SOCKS dissector temporarily changes the pinfo values for destport
or srcport, so it should get the tcp_conversation_data after doing so
before recursively calling the TCP dissector again. Otherwise the TCP
dissector will be confused about whether a TCP multisegment PDU is in
progress or not, causing failure to lookup and store fragments correctly,
including both failed desegmentation and failed asserts (when it expects
an entry in the table which isn't there, as it was stored under a different
port number.) Fixes #16646.
2020-10-21 10:03:38 +00:00
Kenneth Soerensen 38cdd3df4e ieee802154: Add timeout to ACK tracking
In captures where a lot of packets are missing, requests and ACKs are
sometimes incorrectly paired. With this improvement, ACKs must arrive in
a reasonable time to be paired with a request.
2020-10-21 10:02:56 +00:00
Stig Bjørlykke 93ea780e7c tls/dtls: Add a generated field for Application Data Protocol 2020-10-21 08:18:22 +00:00
Martin Mathieson 3f0649bbe5 Correct a few more item lengths. 2020-10-20 21:23:53 +01:00
Martin Mathieson 89e96c1e77 XML Escaping: Don't need to escape unprintable chars.
Should not be needed because the attribute encoding="utf-8" is there.

closes #10445
2020-10-20 05:32:29 +00:00
Martin Mathieson d86df72da3 RTCP: Fix length of PTT participant ref
Found by ./tools/check_typed_item_calls.py
2020-10-20 05:08:56 +00:00
Guy Harris c8882c0f29 bthci: add a note about the case where we hve no connection handle.
A previous change initialized the k_connection_handle, so we don't
compare random data with remote_bdaddr->chandle, but perhaps we
shouldn't compare it at all if we didn't find a handle pair.
2020-10-19 21:19:39 -07:00
Gerald Combs 666e74401a BT ISO Data: Initialize a variable.
Initialize a variable caught by Valgrind. Fixes #16926.
2020-10-19 20:21:45 +00:00
Guy Harris 0d2277bca5 Include <stdint.h> in YACC/Bison parsers if necessary.
MSVC doesn't, by default, define __STDC_VERSION__, which means that the
code generated by newer versions of winflexbison3's Bison end up
defining YYPTRDIFF_T as long, which is wrong on 64-bit Windows, as
that's an LLP64 platform, not an LP64 platform, and causes warnings to
be generated.  Those warnings turn into errors.

With MSVC, if __STDC_VERSION__ isn't defined, Forcibly include
<stdint.h> here to work around that.

Fixes #16924.
2020-10-19 11:17:43 -07:00
Gerald Combs 1a244f9de5 CMake: Configure our .y files for different Bison/YACC flavors.
Bison 3.4 and later generate deprecation warnings for the "%pure-parser"
directive. As https://git.savannah.gnu.org/cgit/bison.git/tree/NEWS says,

----
** Deprecated features

  The %pure-parser directive is deprecated in favor of '%define api.pure'
  since Bison 2.3b (2008-05-27), but no warning was issued; there is one
  now.  Note that since Bison 2.7 you are strongly encouraged to use
  '%define api.pure full' instead of '%define api.pure'.
----

Rename our .y files to .y.in, and modify FindYACC.cmake to detect newer
versions of Bison and configure our .y files with "%pure-parser" or
"%define api.pure" as needed. Squelches warnings from Bison in #16924.
2020-10-19 08:46:32 -07:00
Huang Qiangxiong 0a219bf8b9 Protobuf: dissect a google.protobuf.Timestamp as absolute time field
The google.protobuf.Timestamp is a standard protobuf message type and
consists of seconds and nanos fields. We dissect protobuf field in
google.protobuf.Timestamp type as wireshark FT_ABSOLUTE_TIME field.
And add tvb_get_protobuf_field_uint() to make it easy to get a
Protobuf field of varint type from the tvb.

close #16927
2020-10-19 10:57:50 +00:00
Mikael Kanstrup 3b74cbcf4e EAP: Let dissect_eap_psk_pchannel return offset
For consistency with other functions in this dissector let
dissect_eap_psk_pchannel also return offset instead of "number of
bytes dissected".
2020-10-19 10:09:41 +00:00
Mikael Kanstrup 279bde1a0e EAP: Fix GPSK CSuite Sel dissection
The function to dissect CSuite Sel returns offset not number of
dissected bytes so calling function must assign new offset rather
than incrementing. For consistency also update the CSuite List
function to return offset.
2020-10-19 10:09:41 +00:00
Mikael Kanstrup 72fbe69d9b EAP: Fix GPSK failure code item length
Fix issues found by running ./tools/check_typed_item_calls.py

epan/dissectors/packet-eap.c:1475 proto_tree_add_item called for hf_eap_gpsk_failure_code  -  item type is FT_UINT16 but call has len  4
epan/dissectors/packet-eap.c:1479 proto_tree_add_item called for hf_eap_gpsk_failure_code  -  item type is FT_UINT16 but call has len  4
2020-10-19 10:09:41 +00:00
Mikael Kanstrup 6da08adcca Minor fixes to TEAP dissector
Fix the hf_teap_status item length and hf_teap_prompt diplay name.
2020-10-19 10:09:41 +00:00
Martin Mathieson bf245c5f68 PDML: speed up writing
Speed functions to print hex bytes, escape XML strings and
print out indents by avoiding specifier calls, and building
larger strings before calling fputs().

Someone mentioned this in the sharkfest chat yesterday.
Also, Ostinato relies upon this when importing from pcap.

An example capture I have has gone from 18 to 11 seconds.
2020-10-19 09:32:49 +00:00
David Perry c03011b906 Lua: base64_decode: handle unpadded data
As noted in bug #16386, glib's `g_base64_decode_inplace()` aborts
decoding of base64 strings that aren't padded. This addresses that by
adding padding "=" characters if needed to the buffer which will be
decoded.

I added the test case from the bug report to the test suite, though the
location therein may not be ideal.

Closes #16386
2020-10-19 08:38:31 +00:00
Martin Mathieson 723d0fab8f IEEE80211: Fix the lengths of a couple of items
Found by running ./tools/check_typed_item_calls.py

epan/dissectors/packet-ieee80211.c:14209 proto_tree_add_item called for hf_ieee80211_osen_akm_count  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-ieee80211.c:20025 proto_tree_add_item called for hf_ieee80211_tclas_ether_type  -  item type is FT_UINT8 but call has len  2
2020-10-19 06:26:47 +00:00
Martin Mathieson d0fe9cae70 GTP and GTPv2: Fix some item lengths.
Fix issues found by running ./tools/check_typed_item_calls.py

epan/dissectors/packet-gtp.c:4414 proto_tree_add_item called for hf_gtp_sel_mode  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-gtp.c:6807 proto_tree_add_item called for hf_gtp_rai_rac  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-gtp.c:7600 proto_tree_add_item called for hf_gtp_bssgp_cause  -  item type is FT_UINT8 but call has len  2
epan/dissectors/packet-gtpv2.c:3607 proto_tree_add_item called for hf_gtpv2_trace_id  -  item type is FT_UINT16 but call has len  3
epan/dissectors/packet-gtpv2.c:5049 proto_tree_add_item called for hf_gtpv2_trace_id  -  item type is FT_UINT16 but call has len  3
2020-10-18 20:00:39 +01:00
Guy Harris a58ed646aa Handle relative times with >2^31 seconds.
Make display_signed_time() take a 64-bit signed number of seconds, and,
in calls to it, cast the argument to gint64, not gint32.

Addresses issue #16909.
2020-10-18 02:06:07 -07:00
Joerg Mayer 10297b60be packet-tcp.c: Add tcp D-SACK support
And it's all Sake's fault anyway :-)
2020-10-17 22:09:48 +02:00
Joerg Mayer bf1b34c35d packet-tcp: Rename ei_tcp_connection_sack to ei_tcp_connection_synack
This unfortunately includes the name of the filter element but "sack" in TCP
should not mean "a packet with syn+ack set" to most networking people nowadays.
2020-10-17 22:09:48 +02:00
Nardi Ivan e9ab795179 TLS: fix visualization of QUIC Transport Parameter Preferred Address 2020-10-16 21:27:57 +02:00
Prerit Jain 04145521b4 nrup: fix in Frame Indicator display 2020-10-16 13:42:44 +00:00
Jamie Hare cf83a67fd3 IPPUSB Protocol
Added a dissector to reassemble IPP Over USB packets and pass them to
the HTTP dissector. Added a display filter so IPPUSB packets can be
filtered. Dissector checks to ensure semgent is IPPUSB and supports
reassembly of send-documents and print-job documents. It also supports
the reassembly and dissection of packets that are truncted or
incomplete.

Change-Id: Icc9525592c07b00baaac887a70bc9e7568273016
2020-10-16 08:49:48 +00:00
Christian Krump 76e56358c2 EPL: wrong size detection of last segment
- fixed size detection of last segment in multiple read/write ASNDs
2020-10-15 22:35:29 +00:00
Ameya Deshpande 34626f2596 USBLL: Introduce usbll states in usbll_data_t.
This commit introduces usbll states. These states
represent the transaction upto the current packet.

Uses of introducing usbll states:
1. Avoid condition checks upto last three packets.
2. Identify invalid PID sequences.
3. Identify correct transactions. This will help in
   the USB 2.0 reassembly.

Ping-bug: 15908
Signed-off-by: Ameya Deshpande <ameyanrd@outlook.com>
2020-10-15 22:10:59 +00:00
John Thacker 91b792c6dc Replace ill-formed UTF-8 byte sequences with replacement character
Implement the Unicode Standard "best practices" for replacing ill-formed
sequences with the Unicode REPLACEMENT CHARACTER. Add wmem_strbuf_append_len
for appending strings with embedded null characters. Clarify why
wmem_strbuf_grow() doesn't always ensure that there's enough room for
a new string, and short-circuit some tests there. Related to #14948
2020-10-15 21:48:28 +00:00
Joerg Mayer 8b622bffc8 packet-stun.c: Series of small updates
- Rename some elements to their current RFC names
- Add an expert item for msg_len field
- Create an attribute for 8006 as unknown to avoid triggering the expert item for unknown attributes
2020-10-15 20:48:16 +00:00
Allan Møller Madsen 6d752876ef bthci_iso: full packet decode and reassembly added
Decode all Bluetooth HCI ISO packet fields and reassemble
fragmented packets.
2020-10-15 19:12:00 +00:00