aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipsec.c
AgeCommit message (Collapse)AuthorFilesLines
2015-02-18Make UAT record update callbacks return a success/failure indication.Guy Harris1-1/+2
Have them return TRUE on success and FALSE on failure. Check the return value rather than whether the error string pointer is null or not. Change-Id: I800a03bcd70a6bbb7b217cf7c4800e9cdcf2189c Reviewed-on: https://code.wireshark.org/review/7222 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-01-13UAT error string pointers should not be const pointers.Guy Harris1-1/+1
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-11Replace some "low hanging fruit" uses of emem.Michael Mann1-1/+1
Most of the remaining ep_ uses are grouped with specific functionality. Change-Id: I8fa64a17acc6bcdcf6891b2d28715ac0c58f1a4a Reviewed-on: https://code.wireshark.org/review/6484 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Third batch (packet-icmpv6.c -> packet-mac-lte.c). Will look at cleaning up and committing script afterwards. Change-Id: Ib91e36ad200db01c3000605f6a7a21125b96a640 Reviewed-on: https://code.wireshark.org/review/6018 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+0
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-11-02Eliminate proto_tree_add_text from several dissectors.Michael Mann1-13/+34
Change-Id: I6d3125f15d268edd47ef74dd655eb86cb25ee52d Reviewed-on: https://code.wireshark.org/review/5047 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-23ESP: honor enable_null_encryption_decode_heuristic preference when the ESP ↵Pascal Quantin1-594/+585
packet does not match any known SA Otherwise checking the enable_encryption_decode preference will completely ignore enable_null_encryption_decode_heuristic Change-Id: I34744ddb2080453dab7cd7d34f47b4984969993c Reviewed-on: https://code.wireshark.org/review/4897 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-10-20Get rid of another toupper() call in favor of g_ascii_toupper().Guy Harris1-1/+1
Change-Id: If527af69ec96a91c4127c95307c3b93b79b53e2f Reviewed-on: https://code.wireshark.org/review/4865 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-20Get rid of unnecessary includes of ctype.h.Guy Harris1-1/+0
Change-Id: I2cf49f808558147ce77e7d086558966cfb2defca Reviewed-on: https://code.wireshark.org/review/4850 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-09-12IPSec: fix compilation when building without libgcryptPascal Quantin1-17/+16
Change-Id: Iea3de2f0a54f9c0703afbeb42722d18da99f5c9a Reviewed-on: https://code.wireshark.org/review/4090 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-09-11Fix an incorrect commentMartin Mathieson1-1/+3
Change-Id: Ic60c67fcc554b5ceb0b359a992fafd0f84521eef Reviewed-on: https://code.wireshark.org/review/4077 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-09-11Do simple sequence analysis on ESP Sequence Number fieldMartin Mathieson1-12/+181
Change-Id: I84e204fb7a84eb821f4728a50945f34f4bdba73f Reviewed-on: https://code.wireshark.org/review/4057 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-08-02fix warning: 'cipher_hd' may be used uninitialized in this functionEvan Huus1-0/+3
I don't think it's an actual issue, but the new compiler on the mac buildbots isn't smart enough to tell that. Change-Id: I759e1afe9c4011d5612be0d15282076be6f5a331 Reviewed-on: https://code.wireshark.org/review/3355 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-29proto_tree_add_subtree[_format]Michael Mann1-12/+11
Change-Id: I7e016f10fcfdc0523bf2fe8c11295c0334f7c332 Reviewed-on: https://code.wireshark.org/review/2694 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-4/+4
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-4/+4
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-4/+2
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-13IPsec: fix implicit conversion of pointer warningPascal Quantin1-1/+1
Change-Id: Id1b62e2a7ea525cf2d421e41d9f344d24b56506d Reviewed-on: https://code.wireshark.org/review/1619 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-05-13Allow 16 SAs to be added, but allocate on heap to avoid growing stackMartin Mathieson1-7/+24
Change-Id: I68a4437c35c6e1e629cace06cfea07ae1ec45066 Reviewed-on: https://code.wireshark.org/review/1616 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-05-07Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-2/+0
Change-Id: I8727e74d0818f759f3c58c6f156b0b4e36eb7218 Reviewed-on: https://code.wireshark.org/review/1465 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com>
2014-04-30Add '#include "packet-ipsec.h'; Do some cleanup.Bill Meier1-1294/+1309
Cleanup: - #include <stdio.h> & <ctype.h> only when needed; - Add editor modelines; - Convert tabs to spaces; - Use a consistent indentation (2 spaces). Change-Id: I5ef67b5c6aff99bf5dc1655b20760f862cd14d7f Reviewed-on: https://code.wireshark.org/review/1445 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-04-30IPsec: fix compilation when building without libgcryptPascal Quantin1-4/+3
Change-Id: If525fb27ec607201efceb3ab9207305c3a4953dc Reviewed-on: https://code.wireshark.org/review/1439 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-04-30Try to make Mac OS X Buildbot HappyAlexis La Goutte1-1/+1
packet-ipsec.c:1905: warning: implicit conversion shortens 64-bit value into a 32-bit value Change-Id: Ic293e6b297f8f52aef7a102ab5ca0e0e98b9d7a7 Reviewed-on: https://code.wireshark.org/review/1436 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-30Add an API for programmatically adding ESP SAs (most likely from a privateMartin Mathieson1-320/+422
dissector). Also, speed up ESP decryption in several ways: - store gcrypt_cipher_hd in the SA struct, rather than continually open, setkey and close for each PDU - don't convert the key string from ascii to hex each time - do it upon during update callback and keep - do the decryption in-place, avoiding the need to allocate, memcpy and free a separate buffer for encrypted data - when matching addresses, avoid doing a strlen until after we check whether or not we're matching against "*" Change-Id: Ibb66663ec21326351abc761be78a0d57f7797fa5 Reviewed-on: https://code.wireshark.org/review/1421 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-28Make a dissector table out of IPv6 Next header.Michael Mann1-42/+55
This cleans up the implementation of the extension header, but also allows Decode As functionality for Next Header fields. This allows "old" SHIM6 IP protocol number (not IANA registered) to still be dissected. bug:9995 Change-Id: I6f29a1f7db144478c5b6416d27da2c9c5a7a1de1 Reviewed-on: https://code.wireshark.org/review/1378 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-18Exported PDU: add support for more than 32 tagsPascal Quantin1-2/+3
Change-Id: Idc9f105164919827a8a81c88b5a56de4fa25df0b Reviewed-on: https://code.wireshark.org/review/1197 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-04-06Convert ep_address_to_str -> address_to_str(wmem_packet_scope, ...) for all ↵Michael Mann1-2/+2
dissectors Change-Id: I7489e2fb3a1f2630ca17b0a5fe1aa873992f1061 Reviewed-on: https://code.wireshark.org/review/975 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-03-19Exported PDU: add support for data length on the wirePascal Quantin1-1/+2
Change-Id: Iff14ec4d0297ec85f3597b33871fb0ab5256a597 Reviewed-on: https://code.wireshark.org/review/728 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-02-03Fix all -fstrict-alias warnings found by gcc 4.1.2Gilbert Ramirez1-1/+1
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>
2013-12-14Fix warningsJakub Zawadzki1-0/+2
svn path=/trunk/; revision=54089
2013-12-08Fix some warnings: cast discards `__attribute__((const))' qualifier from ↵Jakub Zawadzki1-1/+1
pointer target type svn path=/trunk/; revision=53875
2013-12-08IPsec ESP: add AES-GCM decryption. Bug 8395 ↵Michael Mann1-4/+11
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8395) Insert Any 64bit authnetication option so AES-GCM with 8 byte ICV From Alexandru Juncu svn path=/trunk/; revision=53844
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-06-18Add ability to export decrypted IPsec PDUsPascal Quantin1-33/+78
svn path=/trunk/; revision=50022
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-14/+8
svn path=/trunk/; revision=49920
2013-03-29Rename value string (and similar) functions to use a consistent pattern. ThisEvan Huus1-1/+1
was done using textual search+replace, not anything syntax-aware, so presumably it got most comments as well (except where there were typos). Use a consistent coding style, and make proper use of the WS_DLL_* defines. Group the functions appropriately in the header. I ended up getting rid of most of the explanatory comments since many of them duplicated what was in the value_string.c file (and were out of sync with the recent updates I made to those in r48633). Presumably most of the comments should be in the .h file not the .c file, but there's enough churn ahead that it's not worth fixing yet. Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467 svn path=/trunk/; revision=48634
2013-03-19From beroset:Anders Broman1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48426
2013-03-12From beroset:Anders Broman1-3/+3
remove C++ incompatibilities from UAT_VS_DEF macro and all uses https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48259
2013-02-25From Alex Badea via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8395Evan Huus1-1/+8
Support AES-GCM ipsec encryption using CTR (since libgcrypt doesn't support GCM). Using CTR instead gets us decryption, but does not verify authentication. svn path=/trunk/; revision=47886
2013-02-21include the wsutil/wsgcrypt.h instead of including gcrypt.h directlyMartin Kaiser1-1/+1
svn path=/trunk/; revision=47802
2013-02-19How can I get a new tvbuff that starts at an offset within a givenGuy Harris1-1/+1
tvbuff and runs to the end of the tvbuff? Let me count the ways.... Replace a bunch of different ways of doing that (some incorrect, in that they're not properly handling tvbuffs where the captured and reported lengths are different) with tvb_new_subset_remaining(). svn path=/trunk/; revision=47751
2012-12-26Fix a bunch of warnings.Guy Harris1-13/+13
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of sizeof. Cast away some implicit 64-bit-to-32-bit conversion errors due to use of strtol() and strtoul(). Change some data types to avoid those implicit conversion warnings. When assigning a constant to a float, make sure the constant isn't a double, by appending "f" to the constant. Constify a bunch of variables, parameters, and return values to eliminate warnings due to strings being given const qualifiers. Cast away those warnings in some cases where an API we don't control forces us to do so. Enable a bunch of additional warnings by default. Note why at least some of the other warnings aren't enabled. randpkt.c and text2pcap.c are used to build programs, so they don't need to be in EXTRA_DIST. If the user specifies --enable-warnings-as-errors, add -Werror *even if the user specified --enable-extra-gcc-flags; assume they know what they're doing and are willing to have the compile fail due to the extra GCC warnings being treated as errors. svn path=/trunk/; revision=46748
2012-10-22From Matthias St. Pierre:Anders Broman1-6/+22
Add full rfc4868 support to both dissectors. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7873 svn path=/trunk/; revision=45708
2012-10-21Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=45681
2012-10-16From "msp":Anders Broman1-2/+4
'*' wildcard in the 'Src IP' or 'Dest IP' field of the ESP SA dialog does not work https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7866 svn path=/trunk/; revision=45585
2012-10-11From Alex Badea via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7849Alexis La Goutte1-6/+35
IPsec ESP: allow filtering by ICV verification result Add hf_esp_icv_good and hf_esp_icv_bad (similar to IP checksums), to allow filtering based on the ICV check results. svn path=/trunk/; revision=45483
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45017
2012-07-08UATs could be put into "categories". The categories were defined onlyGuy Harris1-17/+17
implicitly by the #define name and string they were defined to; not all UATs neatly fit into any of the categories, so some of them were put into categories that weren't obviously correct for them, and one - the display filter macro UAT - wasn't put into any category at all (which caused crashes when editing them, as the GUI code that handled UAT changes from a dialog assumed the category field was non-null). The category was, in practice, used only to decide, in the aforementioned GUI code, whether the packet summary pane needed to be updated or not. It also offered no option of "don't update the packet summary pane *and* don't redissect anything", which is what would be appropriate for the display filter macro UAT. Replace the category with a set of fields indicating what the UAT affects; we currently offer "dissection", which applies to most UATs (any UAT in libwireshark presumably affects dissection at a minimum) and "the set of named fields that exist". Changing any UAT that affects dissection requires a redissection; changing any UAT that affects the set of named fields that exist requires a redissection *and* rebuilding the packet summary pane. Perhaps we also need "filtering", so that if you change a display filter macro, we re-filter, in case the display is currently filtered with a display filter that uses a macro that changed. svn path=/trunk/; revision=43603
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536