diff options
author | Dario Lombardo <lomato@gmail.com> | 2019-06-28 13:59:32 +0200 |
---|---|---|
committer | Dario Lombardo <lomato@gmail.com> | 2019-07-19 12:23:51 +0000 |
commit | aec84807603206e784323c970741c60962e6ee91 (patch) | |
tree | 843ff97ac8d1ad9de85c0af6288da2c881522bbb /epan | |
parent | 7b0f2fe09f5f13b66d112293c2ce6a9d2e378c3b (diff) |
imap: add credentials to tap.
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>
Diffstat (limited to 'epan')
-rw-r--r-- | epan/dissectors/packet-imap.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/epan/dissectors/packet-imap.c b/epan/dissectors/packet-imap.c index b489c7a226..fb9cf2fc43 100644 --- a/epan/dissectors/packet-imap.c +++ b/epan/dissectors/packet-imap.c @@ -19,6 +19,8 @@ #include <wsutil/strtoi.h> #include "packet-tls.h" #include "packet-tls-utils.h" +#include <ui/tap-credentials.h> +#include <tap.h> void proto_register_imap(void); void proto_reg_handoff_imap(void); @@ -46,6 +48,8 @@ static int hf_imap_time = -1; static gint ett_imap = -1; static gint ett_imap_reqresp = -1; +static int credentials_tap = -1; + static dissector_handle_t imap_handle; static dissector_handle_t tls_handle; static dissector_handle_t imf_handle; @@ -583,6 +587,13 @@ dissect_imap(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_ int password_tokenlen = tvb_get_token_len(tvb, username_next_token, passwordlen, NULL, FALSE); guint8* password = tvb_get_string_enc(wmem_packet_scope(), tvb, password_offset + 1, password_tokenlen - 2, ENC_ASCII | ENC_NA); proto_tree_add_string(reqresp_tree, hf_imap_request_password, tvb, password_offset, password_tokenlen, password); + + tap_credential_t* auth = wmem_new0(wmem_packet_scope(), tap_credential_t); + auth->num = auth->username_num = pinfo->num; + auth->password_hf_id = hf_imap_request_password; + auth->username = username; + auth->proto = "IMAP"; + tap_queue_packet(credentials_tap, pinfo, auth); } } @@ -753,6 +764,8 @@ proto_register_imap(void) /* compile patterns */ ws_mempbrk_compile(&pbrk_whitespace, " \t\r\n"); + + credentials_tap = register_tap("credentials"); } void |