diff options
Diffstat (limited to 'epan/dissectors/packet-ssl.c')
-rw-r--r-- | epan/dissectors/packet-ssl.c | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c index df5d850126..f49732f178 100644 --- a/epan/dissectors/packet-ssl.c +++ b/epan/dissectors/packet-ssl.c @@ -3724,31 +3724,68 @@ ssldecrypt_uat_fld_protocol_chk_cb(void* r _U_, const char* p, guint len _U_, co static void ssl_src_prompt(packet_info *pinfo, gchar *result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", pinfo->srcport, UTF8_RIGHTWARDS_ARROW); + SslPacketInfo* pi; + guint32 srcport = pinfo->srcport; + + pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, pinfo->curr_layer_num); + if (pi != NULL) + srcport = pi->srcport; + + g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "source (%u%s)", srcport, UTF8_RIGHTWARDS_ARROW); } static gpointer ssl_src_value(packet_info *pinfo) { - return GUINT_TO_POINTER(pinfo->srcport); + SslPacketInfo* pi; + + pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, pinfo->curr_layer_num); + if (pi == NULL) + return GUINT_TO_POINTER(pinfo->srcport); + + return GUINT_TO_POINTER(pi->srcport); } static void ssl_dst_prompt(packet_info *pinfo, gchar *result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, pinfo->destport); + SslPacketInfo* pi; + guint32 destport = pinfo->destport; + + pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, pinfo->curr_layer_num); + if (pi != NULL) + destport = pi->destport; + + g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "destination (%s%u)", UTF8_RIGHTWARDS_ARROW, destport); } static gpointer ssl_dst_value(packet_info *pinfo) { - return GUINT_TO_POINTER(pinfo->destport); + SslPacketInfo* pi; + + pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, pinfo->curr_layer_num); + if (pi == NULL) + return GUINT_TO_POINTER(pinfo->destport); + + return GUINT_TO_POINTER(pi->destport); } static void ssl_both_prompt(packet_info *pinfo, gchar *result) { - g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", pinfo->srcport, UTF8_LEFT_RIGHT_ARROW, pinfo->destport); + SslPacketInfo* pi; + guint32 srcport = pinfo->srcport, + destport = pinfo->destport; + + pi = (SslPacketInfo *)p_get_proto_data(wmem_file_scope(), pinfo, proto_ssl, pinfo->curr_layer_num); + if (pi != NULL) + { + srcport = pi->srcport; + destport = pi->destport; + } + + g_snprintf(result, MAX_DECODE_AS_PROMPT_LEN, "both (%u%s%u)", srcport, UTF8_LEFT_RIGHT_ARROW, destport); } /********************************************************************* |