Fix for bug 4544 - Decrypted data for STARTLS session is not shown in packet list...
authorsake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 23 May 2010 22:23:33 +0000 (22:23 +0000)
committersake <sake@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 23 May 2010 22:23:33 +0000 (22:23 +0000)
- make sure the SSL dissector knows how to reach the original dissector for the decrypted data
- make sure the SMTP dissector does not call the SSL dissector again with the decrypted data

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32921 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-smtp.c
epan/dissectors/packet-ssl.c

index 49a2a02740243019872c5f20a4ea408d0254f85f..07a6595c85709e9b0f4fa70ca9e17a2b34013b33 100644 (file)
@@ -315,11 +315,20 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
    */
   if (session_state->last_nontls_frame != 0 && pinfo->fd->num > session_state->last_nontls_frame) {
     guint16 save_can_desegment;
+    guint32 save_last_nontls_frame;
+
     /* This is TLS, not raw SMTP. TLS can desegment */
     save_can_desegment = pinfo->can_desegment;
     pinfo->can_desegment = pinfo->saved_can_desegment;
+
+    /* Make sure the SSL dissector will not be called again after decryption */
+    save_last_nontls_frame = session_state->last_nontls_frame;
+    session_state->last_nontls_frame = 0;
+
     call_dissector(ssl_handle, tvb, pinfo, tree);
+
     pinfo->can_desegment = save_can_desegment;
+    session_state->last_nontls_frame = save_last_nontls_frame;
     return;
   }
 
@@ -801,9 +810,8 @@ dissect_smtp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
           if (code == 220) {
             /* This is the last non-TLS frame. */
             session_state->last_nontls_frame = pinfo->fd->num;
-            session_state->smtp_state = SMTP_STATE_READING_DATA;
-          } else
-            session_state->smtp_state =  SMTP_STATE_READING_CMDS;
+          }
+          session_state->smtp_state =  SMTP_STATE_READING_CMDS;
         }
 
         if (tree) {
index 467d01bcd645cc88007dc222e81e3504935fc869..2b95d9ca46ae5e1cbcd0c805bdf8d636562cb282 100644 (file)
@@ -1529,6 +1529,7 @@ dissect_ssl3_record(tvbuff_t *tvb, packet_info *pinfo,
          * info cached there*/
         association = ssl_association_find(ssl_associations, pinfo->srcport, pinfo->ptype == PT_TCP);
         association = association ? association: ssl_association_find(ssl_associations, pinfo->destport, pinfo->ptype == PT_TCP);
+        association = association ? association: ssl_association_find(ssl_associations, 0, pinfo->ptype == PT_TCP);
 
         proto_item_set_text(ssl_record_tree,
            "%s Record Layer: %s Protocol: %s",