Commit graph

195 commits

Author SHA1 Message Date
Guy Harris
bc23f79729 UAT error string pointers should not be const pointers.
UAT error strings are usually allocated by g_strdup() or
g_strdup_printf(), and must ultimately be freed by the caller.

Make the pointer-to-error-string-pointer arguments to various functions
be "char **", not "const char **".

Fix cases that finds where a raw string was being used, as that won't
work if you try to free it; g_strdup() it instead.

Add a missing free of an error string.

Remove some no-longer-necessary casts.

Remove some unnecessary g_strdup()s (the string being handed to it was
already g_malloc()ated).

Change some variable declarations to match.

Put in XXX comments for some cases where the error string is just freed,
without being shown to the user.

Change-Id: I40297746a2ef729c56763baeddbb0842386fa0d0
Reviewed-on: https://code.wireshark.org/review/6525
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13 20:20:03 +00:00
Martin Mathieson
7e8a4b0927 Deleting unnecessary #includes from dissectors.
Fourth batch (packet-mac-lte.c -> packet-rtp.c).

Will look at cleaning up and committing script afterwards.

Change-Id: Id921f07f4b274f0cfb77ce81abe4a285fdb8b644
Reviewed-on: https://code.wireshark.org/review/6023
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-23 17:16:40 +00:00
Bill Meier
b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +00:00
Martin Mathieson
5d6eb80c14 Use g_direct_ functions for hash tables where possible
Change-Id: Ie364cbdcf500d7a04e64d7adcdd03bd1926dda86
Reviewed-on: https://code.wireshark.org/review/5736
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-12-13 00:17:23 +00:00
Michael Mann
6fad7d19e7 Eliminate proto_tree_add_text from some dissectors.
Some other related cleanup.

Change-Id: I45f54032aa8318858f4ee784945b6f2ed163b6ea
Reviewed-on: https://code.wireshark.org/review/4328
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-27 15:44:53 +00:00
Graham Bloice
560762044d Fix buildbot issues with commit f8f3239bb0
from change 3016.

Change-Id: I67363462f1c4e1ca69695573892692c458c620c6
Reviewed-on: https://code.wireshark.org/review/3040
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-14 14:02:29 +00:00
Martin Mathieson
f8f3239bb0 Add default ciphering and integrity algorithms to use for when control messages are not available, e.g. when handing in to a target cell.
Change-Id: I35830fe04df5e5778c15cdb782982b2fbcda67ea
Reviewed-on: https://code.wireshark.org/review/3016
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-07-14 12:30:47 +00:00
Bill Meier
9ed99d5c4e Strip some trailing whitespace; Fix some indentation; Add editor-modelines as needed.
Change-Id: I943153e28f468070d86535abad7be032e1386118
Reviewed-on: https://code.wireshark.org/review/2994
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 03:20:54 +00:00
Pascal Quantin
666127f5f9 PDCP LTE: do not try to decipher PDCP control messages (like ROHC feedback)
Change-Id: I4a1596fd45bbc78ed8e90accf69ac048e7053161
Reviewed-on: https://code.wireshark.org/review/2366
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-18 06:17:54 +00:00
Pascal Quantin
ad7b5381ac Upgrade Windows builds to GnuTLS 3.1.22 and Gcrypt 1.6.0
Change-Id: I7650a3ec31120ac5e7954f4c1ca985ad55d189b4
Reviewed-on: https://code.wireshark.org/review/1978
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-06 15:33:01 +00:00
Pascal Quantin
398c81a299 PDCP LTE: add identification of ZUC based security algorithms
Change-Id: I63a66bc5822ac04f1a2bccd3a15adac30b65e397
Reviewed-on: https://code.wireshark.org/review/1541
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-06 21:43:35 +00:00
Pascal Quantin
542b4e6742 MAC/RLC/PDCP LTE: replace obsolete APIs
Change-Id: I5368cc7b1986c6a87cb70a3fd3cb5e589d73f870
Reviewed-on: https://code.wireshark.org/review/1520
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-05 21:26:46 +00:00
Michael Mann
9606ec5954 Remove enabling HAVE_SNOW3G by default
Change-Id: Ie1af436b763ec762a41af0bdfc1f3ec6adea2bc1
Reviewed-on: https://code.wireshark.org/review/1486
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-05-04 01:13:07 +00:00
Martin Mathieson
32e3e410ae Update TODO comments
Change-Id: I4ea940be5b65c041bdd330bfc2bdbe9a00360d00
Reviewed-on: https://code.wireshark.org/review/1475
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-05-03 21:38:36 +00:00
Martin Mathieson
616d4c9c1b Change preferences - always want to try to decrypt signalling PDUs
Change-Id: Ib34f12b5f8dd276612aed2fe0192c94e847858f2
Reviewed-on: https://code.wireshark.org/review/1377
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-04-26 22:33:32 +00:00
Martin Mathieson
784808ca86 PDCP LTE: various fixes related to security handling
- fixes the wrap multiplier (for COUNT) for 12-bit sequence numbers
- fixes dissection of non-ciphered IP payloads
- adds a way for private protocols to set keys. The ueid->key lookup is now broken out into a separate function, and these settings are used in preference to the UAT ones

Change-Id: I723307df3ee20425897b82beb9b431a0860075cf
Reviewed-on: https://code.wireshark.org/review/583
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-03-10 13:12:46 +00:00
Alexis La Goutte
296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Bill Meier
93fe4d53e2 Remove trailing whitespace.
Change-Id: Ia03a1cd4590aceda30ead4aa93ad413d90c6aea6
Reviewed-on: https://code.wireshark.org/review/372
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 16:36:38 +00:00
Gilbert Ramirez
4cc694839d Fix all -fstrict-alias warnings found by gcc 4.1.2
The majority of the fixes are for calls to uat_new(). Instead of
having each caller cast its private data to (void**), we use void*
in the uat_new() API itself. Inside uat_new(), we cast the void*
to void**.

Some dissectors use val64_string arrays, so a VALS64() macro was
added for those, to avoid using VALS(), which is useful only for
value_string arrays.

packet-mq.c was changed because dissect_nt_sid() requires
a char**, not a guint**. All other callers of dissect_nt_sid() use
char*'s (and take the address of it) for their local storage. So,
this was changed to follow the other practices.

A confusion between gint and absolute_time_display_e in packet-time.c
was cleared up.

The ugliest fix is the addition of ip6_guint8_to_str(), for exactly
one caller. The caller uses one type of ip6 address byte array,
while ip6_to_str() expects another. This new function is in place
until the various address implementations can be consolidated.

Add VALS64() to the developer documentation.

Change-Id: If93ff5c6c8c7cc3c9510d7fb78fa9108e4552805
Reviewed-on: https://code.wireshark.org/review/48
Reviewed-by: Evan Huus <eapache@gmail.com>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-03 09:26:10 +00:00
Martin Mathieson
9416835735 Revert part of previous change
svn path=/trunk/; revision=54979
2014-01-27 12:54:34 +00:00
Martin Mathieson
f903141d65 Send news of SecurityModeFailure to PDCP dissector, which will attempt to roll back to previous setting
svn path=/trunk/; revision=54978
2014-01-27 12:06:46 +00:00
Martin Mathieson
62249477b6 Remove #include and make the situation with snow3g clearer in a comment. May need further removal, depending upon concensus on wireshark-dev
svn path=/trunk/; revision=54827
2014-01-16 12:02:30 +00:00
Alexis La Goutte
85ab202c08 Fix -Wsometimes-uninitialized found by Clang
packet-pdcp-lte.c:1397:9: error: variable 'decrypted_data' is used uninitialized whenever 'if' condition is false
packet-pdcp-lte.c:1469:50: note: uninitialized use occurs here
    decrypted_tvb = tvb_new_child_real_data(tvb, decrypted_data, payload_length, payload_length);
packet-pdcp-lte.c:1353:27: note: initialize the variable 'decrypted_data' to silence this warning

packet-pdcp-lte.c:1397:9: error: variable 'payload_length' is used uninitialized whenever 'if' condition is false
packet-pdcp-lte.c:1469:66: note: uninitialized use occurs here
    decrypted_tvb = tvb_new_child_real_data(tvb, decrypted_data, payload_length, payload_length);
packet-pdcp-lte.c:1354:24: note: initialize the variable 'payload_length' to silence this warning

svn path=/trunk/; revision=54791
2014-01-14 17:44:21 +00:00
Pascal Quantin
330654baf8 SNOW3G is not available on default Wireshark
svn path=/trunk/; revision=54788
2014-01-14 16:48:43 +00:00
Martin Mathieson
293f8ca247 Make sure we allocate bytes for snow3g at least rounded up to next 4 byte boundary
svn path=/trunk/; revision=54786
2014-01-14 16:22:44 +00:00
Martin Mathieson
b948c75dfe Update a comment
svn path=/trunk/; revision=54785
2014-01-14 15:11:35 +00:00
Martin Mathieson
58e8800136 Add snow3g integrity (not quite working for me), but rework how integrity and ciphering functions and conditional compilation is done
svn path=/trunk/; revision=54784
2014-01-14 15:07:20 +00:00
Martin Mathieson
b01a99c385 Provide hook for calling EEA1 implementation (Snow3G). Implementation not supplied due to licensing conditions. TODO: EIA1.
svn path=/trunk/; revision=54782
2014-01-14 11:09:47 +00:00
Guy Harris
547efd4dc9 Cast away constness.
svn path=/trunk/; revision=54763
2014-01-14 05:17:06 +00:00
Martin Mathieson
830509b7dc Update a comment and fix some indentation
svn path=/trunk/; revision=54692
2014-01-10 17:56:55 +00:00
Martin Mathieson
f026d8a807 Call deciphering and integrity checking appropriately for
SecurityModeCommand and SecurityModeResponse.

Also show when integrity has been checked and found to be correct.

svn path=/trunk/; revision=54620
2014-01-06 18:18:04 +00:00
Martin Mathieson
f6bf6285ef Do EEA2 deciphering in-place, from Pascal
svn path=/trunk/; revision=54615
2014-01-06 11:28:20 +00:00
Pascal Quantin
3fb89feca6 EIA2 is now functional
svn path=/trunk/; revision=54579
2014-01-03 12:21:26 +00:00
Martin Mathieson
2719103661 Zero security struct to avoid reading garbage value, and remove a redundant test
svn path=/trunk/; revision=54506
2013-12-31 00:46:53 +00:00
Guy Harris
189debcadb Code that uses that parameter is #if 0'ed out, so _U_ it for now.
svn path=/trunk/; revision=54452
2013-12-25 09:23:33 +00:00
Martin Mathieson
21f8c1fb7b Show ciphering and integrity keys separately. Correct inputs to integrity calculation (result still not right with gcrypt 1.6 yet)
svn path=/trunk/; revision=54451
2013-12-25 08:44:43 +00:00
Martin Kaiser
7708c2a19f dirty hack to make things compile without libgcrypt
would it make sense to check global_pdcp_check_integrity inside
calculate_digest()?

svn path=/trunk/; revision=54438
2013-12-24 13:38:32 +00:00
Martin Mathieson
8cbcfcf6a4 Lop off last 4 bytes of payload to use for digest calculation. Still doesn't get expected result.
svn path=/trunk/; revision=54437
2013-12-24 07:24:39 +00:00
Martin Mathieson
57c6542aaf Still not quite working, but using MAC API with gcrypt 1.6 now for digest
svn path=/trunk/; revision=54427
2013-12-24 00:09:41 +00:00
Guy Harris
b71b269a23 Fix setup of new expert info item.
svn path=/trunk/; revision=54426
2013-12-23 22:05:23 +00:00
Alexis La Goutte
21eb60df17 Fix compilation after last change in packet-pdcp-lte (about unused parameter)
svn path=/trunk/; revision=54398
2013-12-23 18:12:16 +00:00
Martin Mathieson
7479af52e5 Add #if 0'd code to calculate CMAC digest, which isn't supported in windows build of libgcrypt currently getched by 'setup'.
svn path=/trunk/; revision=54388
2013-12-23 15:56:40 +00:00
Martin Mathieson
5b8f078f4b Remove printf() call
svn path=/trunk/; revision=54382
2013-12-23 13:53:56 +00:00
Martin Mathieson
9d688a9fde Call function and compare result with parsed mac-i. Now just need to do EIA2(AES) calculation
svn path=/trunk/; revision=54380
2013-12-23 13:43:13 +00:00
Martin Mathieson
27409e8f2e Use preference variable that wasn't used yet to pacify buildbot
svn path=/trunk/; revision=54378
2013-12-23 11:38:38 +00:00
Martin Mathieson
2f2b05aee2 Starting to get ready for integrity checking
svn path=/trunk/; revision=54377
2013-12-23 10:56:51 +00:00
Martin Mathieson
4509ef242d Change types and add cast to try to please buildbot
svn path=/trunk/; revision=54256
2013-12-19 17:48:32 +00:00
Martin Mathieson
62393a672e Cope with spaces or dashes in security keys
svn path=/trunk/; revision=54251
2013-12-19 17:21:36 +00:00
Martin Mathieson
ae50f1d21e Fix a test to allow deciphering to happen on the first pass, and close the gcrypt handles after use.
svn path=/trunk/; revision=54216
2013-12-18 13:08:57 +00:00
Martin Mathieson
d536d5fb7d Remove unused variables to try to unbreak MAC buildbots
svn path=/trunk/; revision=54213
2013-12-18 12:19:42 +00:00