Commit Graph

37361 Commits

Author SHA1 Message Date
Richard Sharpe 45add8812d ieee80211: Improve the handling of Beamforming matrices.
Reduce the number of chars used so we can fit in the 240-byte limit.

Fixes #18504
2022-10-18 23:20:26 +00:00
João Valverde 4136b250c5 epan: Rename tvb_get_nstringz0()
Rename tvb_get_nstringz0() to tvb_get_raw_bytes_as_stringz()
to reflect the fact that this function does not return
a string (UTF-8 internal text string).

Remove tvb_get_stringz() because it is unused and just seems
dangerous.
2022-10-18 19:51:38 +01:00
João Valverde e4d5a44014 MEGACO: Fix proto_tree_add_string() call
Strings passed to proto_tree_add_string() must be UTF-8 encoded.

Fixes #18486.
2022-10-18 19:50:38 +01:00
John Thacker 6156e28a26 dhcp: Convert raw string to UTF-8 before adding to expert info
In PacketCable MTA capabilities, the length of the capability
is store as hex digits in ASCII. If bogus, the incorrect value
is added as an expert info. Ensure that it's formatted as UTF-8
and for display when added to the tree.

Fix #18437
2022-10-18 07:03:38 -04:00
Vadim Yanitskiy b93e8234f6 GSM A-bis/RSL: dissect and show RFN using parse_reduced_frame_number()
3GPP came up with a special encoding of TDMA frame number, which reduces
the amount of bits needed to carry it from 32 to 16.  This encoding is
not only employed on the radio interface (GSM RR), but also on the
A-bis/RSL interface which is used between BTS and BSC nodes.

From the user perspective, parsed RFN value is a lot more meaningful
than the T1/T2/T3 variables used on the wire.  The GSM RR dissector
does show parsed RFN value together with these variables, while the RSL
dissector does not.  Let's show it in the RSL dissector too.
2022-10-17 19:45:15 +00:00
Vadim Yanitskiy 269d3a9968 GSM A RR: expose parse_reduced_frame_number()
This function will be used by the RSL dissector to show parsed RFN
value in the upcoming patch.
2022-10-17 19:45:15 +00:00
Vadim Yanitskiy 9006f25701 GSM A RR: make [parse_]reduced_frame_number() easier to use 2022-10-17 19:45:15 +00:00
Alexis La Goutte 47bd05e494 giop: Fix Dead Store found by Clang Analyzer 2022-10-17 16:44:45 +00:00
John Thacker 0bf410550b smb2: Copy entire Unicode string length
In SMB2, the length of the buffer than contained a UTF-16
unicode string is not necessarily the length of the converted
UTF-8 string, and in some cases can even be shorter than the
length of the UTF-8 string, if the string has many 2 octet
UTF-16 characters that are 3 or 4 octets in UTF-8.

Use wmem_strdup and wmem_strdup_printf instead of wmem_alloc
and sprintf, which is a safer pattern anyway as it reduces
the chance of these errors.

Fix #18482
2022-10-17 07:45:20 -04:00
John Thacker d248702b86 nbt: Eliminate clang analyzer warning
By using strlcat later, we don't need to update pname_ret again,
since we only need the total size of the buffer. Elminates a
clang analyzer warning about writing a value that is never used
related to commit 9891a79137
2022-10-17 00:37:16 +00:00
John Thacker 5fd09b521d ftp: deal with UTF-8
Ensure that FTP doesn't add invalid strings to the tree or columns.
Also allow UTF-8 pathnames to work.

According to RFC 2640, FTP supports UTF-8 for pathnames (and it
MUST be supported even if the other side does not advertise support
for UTF-8, unless a different character set has been explicitly
configured, which is out of scope of the RFCs, and we don't have
such a preference.) So in general interpret strings as UTF-8, not
ASCII.

Reduce the use of tvb_get_ptr by using functions directly on the
original tvb and offset. This also happens to be more compliant
with RFC 2640 when getting the token lengths. (RFC 2640 states
that implementations MUST assume that there is only one space between
a command and the pathname, and treat additional spaces as part of
the pathname instead of skipping them. tvb_get_token_len() does not
skip trailing spaces, but get_token_len() does.)

The only place that still uses tvb_get_ptr is when processing a PWD
command, because it has to deal with the double quote escaping as
a custom encoding.

Add a tvb_ascii_isdigit function.

Fix #18439.
2022-10-16 22:43:39 +00:00
Gerald Combs 94b4202a99 GIOP: Handle recursion and large loops.
dissect_data_for_typecode_with_params is recursive. Add a depth check.
It also has large loops. Make sure our offsets advance.
Fixes #18392.
2022-10-16 22:09:32 +00:00
Bin Peng 2eeb086f70 H265: Support RPS prediction in h265 SPS
According to Rec. ITU-T H.265 7.3.7 and 7.4.8,
when there are multiple RPS in SPS,
RPS can be predicted from previous ones.

But NumDletaPocs used to be a local variable for each RPS,
prediction will always fail.
In this change, NumDletaPocs is  moved from dissect_h265_st_ref_pic_set
to dissect_h265_seq_parameter_set_rbsp, to allow access to previous RPS
data.

This change also move each RPS into a subtree.

Fix #18481
2022-10-16 21:24:06 +00:00
Gerald Combs 44a17f395f [Automatic update for 2022-10-16]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-16 21:08:54 +00:00
Martin Gallo fc052615a6 SAPNI: Added SAP NI as main dissector 2022-10-16 19:59:59 +00:00
Guy Harris f86a0d5ab4 Use wmem_strbuf_append_unichar_repl() to append a REPLACEMENT CHARACTER.
Replace several instances in which a REPLACEMENT CHARACTER was being
appended to a wmem_strbuf with a call to
wmem_strbuf_append_unichar_repl().

This reduces the number of explicit 0x00fffd or 0xfffd or... in the
code.
2022-10-15 14:16:10 -07:00
João Valverde ab7b71605c TDS: Reject invalid ASCII
Fixes #18448.
2022-10-15 20:17:56 +00:00
John Thacker cb23c5e8d7 PER, asn2wrs: Fix permitted-alphabet constrained character strings
Effective permitted-alphabet constraints are only PER-visible for
the known-multiplier character string types (X.691 27.1). When
PER-visible, the upper bound of any code point used in the
alphabet needs to be calculated, in particular for the ALIGNED
variant, because that determines whether or not canonical order
is used (X.691 27.5.2, 27.5.4).

Note that even with the change to asn2wrs.py none of the generated
dissectors change, because we don't have any example of ASN.1
with non-PER visible permitted alphabet constraints because of
using them on non known-multiplier character string types
(like UTF8String).

There's some various edge cases that we still don't handle, but
nothing that any of the ASN.1 modules in the repository use.
(Permitted-alphabet constraints using characters outside the
ASCII range, possibly with "CharacterStringList", "Quadruple",
or "Tuple" notation, permitted-alphabet constraints that are
extensible and thus not PER-visible, etc.)

Also fix a fencepost error with the length of the octets to highlight.

Fix #18468
2022-10-15 17:20:02 +00:00
Martin Mathieson 21b3529be4 ANSI-A: init user_data field in stat_tap_table_item_type entries. 2022-10-15 17:17:11 +00:00
Michael Tuexen 510c22a6a7 TCP: Update TCP TARR support to version 06 of the ID
The dissector now supports draft-gomez-tcpm-ack-rate-request-06.
The rate is now encoded in one byte instead of two.
2022-10-15 15:59:35 +02:00
Brian Sipos 89a63469f9 LTP: Guard itree use when segments have invalid data ranges
This also guards a coverty issue in ltp_stats_tree_packet()
2022-10-15 12:48:49 +00:00
João Valverde c045c70f00 JSON: Clean up stripping of double quotes in members 2022-10-15 12:10:19 +01:00
João Valverde 2d5bc550c8 JSON: Fix validation of UTF-8
Instead of trying to rewrite the validation of UTF-8 for the nth
time first extract a validated string from the parser with
tvb_get_string_enc() and then do the post-processing on that
(unescape, etc.).
2022-10-15 12:10:19 +01:00
João Valverde 995096df70 JSON: Add preference to enable "unescaping" strings 2022-10-15 12:10:19 +01:00
João Valverde a72edfff49 XML: Sanitize UTF-8 input
Fixes #18471.
2022-10-14 21:06:31 +01:00
João Valverde 75eb708143 RTSP: Use format_text() on a string
Fixes #18474.
2022-10-14 18:23:30 +00:00
Richard Sharpe b02fc55253 ieee80211: Correct the number of bits for phi & psi in beamforming matrices
I noticed while implementing the equivalent for 802.11be that the number
of bits for phi and psi angles was reversed. Also, fixed the spelling of
AvgSNR.
2022-10-14 17:44:33 +00:00
João Valverde eea68c7721 WBXML: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-14 11:04:48 +01:00
João Valverde 8ca0aa78ed SMB Pipe: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-14 11:03:58 +01:00
João Valverde ceca3fed61 DCT2000: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-14 11:00:46 +01:00
John Thacker 790f9eeaa9 PER: Ensure that restricted strings are UTF-8
Use UTF-8 replacement characters for characters outside the
restricted string domain. This is particularly important to
guarantee valid UTF-8 for values outside the ASCII range.

Fix #18423
2022-10-13 21:27:02 -04:00
Dr. Lars Völker 883bc6ef29 TECMP: improve FCS and Padding detection for Ethernet
This patch fixes some bugs that occur with padded Ethernet frames
or Ethernet frames with FCS present.
2022-10-13 14:47:12 +00:00
John Thacker 9891a79137 nbt: Check NetBIOS scope IDs
RFC 1001 says that scope IDs "meet the restricted character set
of the domain system and has a leading period." Convert them from
ASCII (plus possible garbage fuzzed characters) to UTF-8. Also
check for truncation when appending them to the NetBIOS name.

Fix #18412
2022-10-13 12:04:16 +00:00
Michael Tuexen 41fdfcdbfb SCTP: Improve handling of Host Name parameters 2022-10-13 10:14:00 +00:00
Patricia Lindner ceed050c47 LTP: Enhance with generated items, sequence analysis, and statistics
This change adds computed values for reports, sequence analysis between
segments, conversation and endpoint taps, and a new statistics menu
and dialog.
2022-10-13 09:30:55 +00:00
John Thacker 900984b3b7 smb: Fix display_unicode_string
In SMB, display_unicode_string is used to handle null terminated
UTF-16LE strings. Do that with the normal API, instead of just
taking every other byte (which works for ASCII and nothing else.)

Do the same fix for the DirectPlay dissector, which borrowed the
code from SMB

Fix #18467.
2022-10-12 23:52:03 -04:00
João Valverde d99426fa6a GVCP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 17:35:30 +01:00
João Valverde 9a16cda9c7 HICP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 17:33:34 +01:00
João Valverde a0a2386f74 LISP: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 10:58:22 +01:00
João Valverde 803edf3f72 Homeplug AV: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 10:55:41 +01:00
João Valverde 8ad9561f22 Open Sound Control: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde a05b210e11 F5 Ethtrailer: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde 411289eaca IEEE 17221: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
João Valverde af36a6ffcc ELF: Replace tvb_get_const_stringz()
Ping #18447.
2022-10-12 09:25:23 +00:00
John Thacker 78ce2f2907 HTTP: Validate Basic Auth against UTF-8 after Base64 decoding
The result of Base64 decoding might not be valid UTF-8, so
check it as such. Also add the decoded result as a new tvb data
source, so that it's easier to do other manipulations on it from
the GUI in case it isn't UTF-8.

Note that RFC 7617 says that the encoding is only known to be
UTF-8 if the charset parameter was used in the WWW-Authenticate
header, so perhaps this should be a FT_BYTES using
BASE_SHOW_UTF_8_PRINTABLE

Fix #18408
2022-10-11 23:19:11 +00:00
Alexis La Goutte ec767dcf2d ieee80211: Use gint(8) for Beamforming Report AVG SNR
Fix #18436
2022-10-11 18:35:10 +00:00
Martin Mayer cf45609c02 OCP.1: Added packet forward lookup 2022-10-11 07:09:22 +00:00
Dylan Ulis 5f9d493640 CIP: Support object-specific services 2022-10-11 07:07:12 +00:00
zhangzhilei f7416d7e95 change GMTLS to TLCP
GMTLS is a non-official name, now that these is a Chinese National Standard called
"GB/T 38636-2020 Information security technology—Transport layer cryptography protocol(TLCP)"
so we replace GMTLS by TLCP
2022-10-11 12:48:29 +08:00
Gerald Combs 2a97e729dc [Automatic update for 2022-10-09]
Update manuf, services enterprise numbers, translations, and other items.
2022-10-10 08:13:49 +00:00