aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-imap.c
AgeCommit message (Collapse)AuthorFilesLines
2021-01-10imap: fix bug in username retrieve.Dario Lombardo1-1/+1
Fix: #16874.
2020-07-14IMAP: Try to fix Wpointer-sign warnings.Anders Broman1-9/+9
Change-Id: I654af8d3addcf8b2c4b0131d10f8a5010b1d4d24 Reviewed-on: https://code.wireshark.org/review/37854 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-02-16More issues spotted by PVS-Studio in bug 16335.Martin Mathieson1-1/+1
Only the change to packet-imap.c really represents a bug. Change-Id: Ie270f97f3d94c338ea3c84a712f8f4d43ffd36f4 Reviewed-on: https://code.wireshark.org/review/36115 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-19imap: add credentials to tap.Dario Lombardo1-0/+13
Change-Id: I6858e66dcda643a97e9f1b29b62edc5ceb8af064 Reviewed-on: https://code.wireshark.org/review/33765 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Pascal Quantin <pascal@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-07-19imap: dissect username and password from LOGIN command.Dario Lombardo1-0/+26
Change-Id: I84ff13cdda7af60bb6ce588b7ec3bccb1911ee97 Reviewed-on: https://code.wireshark.org/review/33756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2019-07-12Fix Wpointer-sign warnings.Anders Broman1-1/+1
Change-Id: I58383b280a04ea0f0f8185298459e07e47bf25e4 Reviewed-on: https://code.wireshark.org/review/33908 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-07-02imap: move the more general field first.Dario Lombardo1-8/+8
The imap.request/response is a more general field, containing tags. It is moved first as we have more general fields followed by more specific ones. Change-Id: Ib8f7fbdd28f2d0ed2ed6d8d6b2de4d92ae24c6cc Reviewed-on: https://code.wireshark.org/review/33755 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-06-27imap: remove useless nesting.Dario Lombardo1-213/+211
Change-Id: I9961d8cdc005a4fc14e716e8bca7b08cd6fbb85c Reviewed-on: https://code.wireshark.org/review/33754 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04epan: Convert our PROTO_ITEM_ macros to inline functions.Gerald Combs1-8/+8
Convert our various PROTO_ITEM_ macros to inline functions and document them. Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c Reviewed-on: https://code.wireshark.org/review/32706 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-01-15IMAP: Fix regression introduced by change 30876Christophe GUERBER1-58/+59
UID prefixed commands where not dissected correctly. Change-Id: I280e3ff7edff11fa67b4a3567b4a0614271d9f6a Reviewed-on: https://code.wireshark.org/review/31542 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-12-27Try to squeeze some bytes out of the frame_data structure.Guy Harris1-1/+1
Make the time stamp precision a 4-bit bitfield, so, when combined with the other bitfields, we have 32 bits. That means we put the flags at the same structure level as the time stamp precision, so they can be combined; that gets rid of an extra "flags." for references to the flags. Put the two pointers next to each other, and after a multiple of 8 bytes worth of other fields, so that there's no padding before or between them. It's still not down to 64 bytes, which is the next lower power of 2, so there's more work to do. Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe Reviewed-on: https://code.wireshark.org/review/31213 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-26imap: remove unused value (CID: 1441962).Dario Lombardo1-1/+0
Change-Id: Iae7697ba1cdeb06d3ef38a5079e3e8ea1bef649c Reviewed-on: https://code.wireshark.org/review/31205 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-12-14IMAP: Reassemble message elements and add request/response trackingChristophe GUERBER1-102/+428
1. Reassemble TCP segment so that IMAP dissector is called on message elements. Content of fetched messages are parsed by IMF dissector. Dissected fields are available to "Export Objects" menu item. 2. Request/Response tracking with timestamp between request and response in response frame. Bug: 15090 Change-Id: Icdbef8c237965d2a59aa7726c5e6a681602c71ce Reviewed-on: https://code.wireshark.org/review/30876 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Graham Bloice <graham.bloice@trihedral.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-10-21Add tvb_ascii_isprint APIMichael Mann1-9/+3
This allows dissectors to check if a portion of the tvb is an ascii string while hiding the use of tvb_get_ptr. Change-Id: Iaec7559dcfdefb8a5ae23e099ced45e90e611f8f Reviewed-on: https://code.wireshark.org/review/30291 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-25Rename packet-ssl* to packet-tls*Gerald Combs1-2/+2
Rename packet-ssl{,-utils}.[ch] to packet-tls{,-utils}.[ch]. Change-Id: I4732162ec131ddf0734b3dd191ccc9e48a76ce06 Reviewed-on: https://code.wireshark.org/review/29659 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-09-13Start renaming SSL to TLS.Gerald Combs1-5/+5
Rename the "ssl" protocol to "tls" and add an "ssl" alias. Prefer "TLS" over "SSL" in user interface text and in the documentation. Fix the test_tls_master_secret test while we're here. Bug: 14922 Change-Id: Iab6ba2c7c4c0f8f6dd0f6d5d90fac5e9486612f8 Reviewed-on: https://code.wireshark.org/review/29649 Petri-Dish: Gerald Combs <gerald@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-09imap: Give correct lineend to get_token_len()Stig Bjørlykke1-6/+8
The return value from get_token_len() is the token length, but the returned next_token can have a offset more than token length because it also skip trailing blanks. Ensure we always give correct lineend. Bug: 13466 Change-Id: I88a11b9bce02999fcf87c0d7542e56fa90aae5a0 Reviewed-on: https://code.wireshark.org/review/20451 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2017-01-31format_text_wmem -> format_textMichael Mann1-1/+1
All cases of the "original" format_text have been handled to add the proper wmem allocator scope. Remove the "original" format_text and replace it with one that has a wmem allocator as a parameter. Change-Id: I278b93bcb4a17ff396413b75cd332f5fc2666719 Reviewed-on: https://code.wireshark.org/review/19884 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-01-31Add format_text_wmem.Michael Mann1-1/+1
This allows for a wmem_allocator for users of format_text who want it (dissectors for wmem_packet_scope()). This lessens the role of current format_text functionality in hopes that it will eventually be replaced. Change-Id: I970557a65e32aa79634a3fcc654ab641b871178e Reviewed-on: https://code.wireshark.org/review/19855 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-08Combine Decode As and port preferences for tcp.port dissector table.Michael Mann1-1/+1
This patch introduces new APIs to allow dissectors to have a preference for a (TCP) port, but the underlying data is actually part of Decode As functionality. For now the APIs are intentionally separate from the regular APIs that register a dissector within a dissector table. It may be possible to eventually combine the two so that all dissectors that register with a dissector table have an opportunity to "automatically" have a preference to adjust the "table value" through the preferences dialog. The tcp.port dissector table was used as the guinea pig. This will eventually be expanded to other dissector tables as well (most notably UDP ports). Some dissectors that "shared" a TCP/UDP port preference were also converted. It also removed the need for some preference callback functions (mostly when the callback function was the proto_reg_handoff function) so there is cleanup around that. Dissectors that has a port preference whose default was 0 were switched to using the dissector_add_for_decode_as_with_preference API rather than dissector_add_uint_with_preference Also added comments for TCP ports used that aren't IANA registered. Change-Id: I99604f95d426ad345f4b494598d94178b886eb67 Reviewed-on: https://code.wireshark.org/review/17724 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-01IMAP: Add heuristic check for TLSJoão Valverde1-0/+66
If the IMAP TCP stream doesn't include the STARTTLS command/response the IMAP dissector will try to dissect TLS ciphertext as IMAP protocol plaintext. Add heuristic check for SSLv3/TLS and if the heuristic matches register dissect_ssl() as the dissector for that IMAP session. Change-Id: If84eca22315193a306e93e66c608de6634e6cd85 Reviewed-on: https://code.wireshark.org/review/13570 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-02-15IMAP: IndentationJoão Valverde1-2/+2
Change-Id: Ie5cacd1e058cffd5518dcad049731b27989c0e79 Reviewed-on: https://code.wireshark.org/review/13944 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-30IMAP: fix Recurring check found by PVS Studio (V571)Alexis La Goutte1-2/+1
The 'session_state->ssl_requested' condition was already verified in line 259 Change-Id: I6813176b2c235780785ff258377a7fd77a2cf24a Reviewed-on: https://code.wireshark.org/review/12311 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-09Convert some TCP subdissectors to "new" style.Michael Mann1-3/+5
Change-Id: I28ce51f3c06f78b85792bce4a13ef39eb75d7890 Reviewed-on: https://code.wireshark.org/review/11648 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-07Create real dissector tables for SSL and DTLS to use.Michael Mann1-1/+1
Since ssl_dissector_[add|delete] only take TCP dissectors, remove the parameter and just use it within the "internal" ssl_association_add call. Change-Id: I0fdf941389934c20cbacf910250e17520614e706 Reviewed-on: https://code.wireshark.org/review/11591 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-10IMAP: do not iterate over reported length when using tvb_find_line_endPascal Quantin1-1/+1
This function can only search in captured length buffer This fixes an ASAN failure reported by Alexis Change-Id: Ib936f918e057423d63ff34a5fc79fed602e56dfc Reviewed-on: https://code.wireshark.org/review/7052 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-02-09pgsql,imap: add STARTTLS supportPeter Wu1-9/+38
The PGSQL "STARTTLS" protocol is documented at http://www.postgresql.org/docs/9.4/static/protocol-flow.html While at it, convert some tvb_length[_remaining] users. Tested against pgsql-ssl.pcapng, Tested against imap-ssl.pcapng, http://wiki.wireshark.org/SampleCaptures#SSL_with_decryption_keys Change-Id: I1a00a6daa7f03de93339c2c13b07b4cfb8cdbd86 Reviewed-on: https://code.wireshark.org/review/6821 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-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/+2
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-10-20Get rid of calls to ctype.h functions.Guy Harris1-4/+3
They don't handle values outside the range -1 to 127, and their behavior is locale-dependent. Use g_ascii_isXXX() and g_ascii_toXXX() instead of isXXX() and toXXX(). If you're checking for printable ASCII, don't use isascii() and don't use iscntrl(), use g_ascii_isprint(). If you're checking for graphical ASCII, i.e. printable ASCII except for a space, use g_ascii_isgraph(). Use ws_xton() to convert a hex digit character to the corresponding numeric value. Change-Id: Id3039bc586fbf66d8736c2df248c790c0d7a2330 Reviewed-on: https://code.wireshark.org/review/4851 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-24IMAP: fix mixed indent (use 2spaces)Alexis La Goutte1-236/+280
Change-Id: Icaad98527c61cb5c87f84ec23d1d895079fe2515 Reviewed-on: https://code.wireshark.org/review/3182 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-1/+1
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-1/+1
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 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>
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54135
2013-11-03Fix what appears to be an off-by-one error in the IMAP dissector, causingEvan Huus1-1/+1
valgrind errors with the capture from https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9263 svn path=/trunk/; revision=53062
2013-09-13Dario Lombardo <lomato@gmail.com> viaJörg Mayer1-4/+5
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9147 Migration from emem to wmem for trivial cases (ep_alloc only). svn path=/trunk/; revision=52002
2013-08-05Keep result of [new_]register_dissector in some dissectors. [2 of x]Jakub Zawadzki1-4/+5
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
2013-06-27Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8857 :Pascal Quantin1-1/+1
Do not assume that we must have at least 1 character present before \r\n svn path=/trunk/; revision=50185
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-10/+8
svn path=/trunk/; revision=49920
2013-06-03Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8739 :Pascal Quantin1-1/+1
Move offset to end of line without assuming that we always have \r\n at the end of it svn path=/trunk/; revision=49722
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
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-07-10From Ben Bowen:Guy Harris1-23/+155
Add additional named fields for IMAP. svn path=/trunk/; revision=43651
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2011-10-25From Michael Mann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6446 :Jeff Morriss1-60/+41
Add some filters to the IMAP dissector (proto_tree_add_text() -> proto_tree_add_item()). svn path=/trunk/; revision=39551
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503