TLS: fix reassembly regression when extending a PDU
authorPeter Wu <peter@lekensteyn.nl>
Mon, 1 Oct 2018 22:00:16 +0000 (00:00 +0200)
committerAnders Broman <a.broman58@gmail.com>
Tue, 2 Oct 2018 04:43:10 +0000 (04:43 +0000)
The fragment identifier was changed, but fragment_set_partial_reassembly
was left unchanged which broke reassembly/decryption when a subdissector
finishes reassembly, but then requests further reassembly (like HTTP
with chunked encoding). This bug results in a faulty "Reassembly error,
protocol TLS: New fragment past old data limits" message.

Bug: 15158
Change-Id: I636ef623dd65c3feb58da29adf7125d8458f038f
Fixes: v2.9.0rc0-2003-gbe16d87c60 ("TLS: fix broken reassembly with multiple PDUs in the same frame")
Reviewed-on: https://code.wireshark.org/review/29967
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/dissectors/packet-tls.c

index 05f35f7c4d6ed88b5a225bda589dddf177c9c484..420e2e8dc33485be5c18b8031566f779b928bef0 100644 (file)
@@ -1112,7 +1112,7 @@ process_ssl_payload(tvbuff_t *tvb, int offset, packet_info *pinfo,
                     dissector_handle_t app_handle_port);
 
 static guint32
-tls_msp_frament_id(struct tcp_multisegment_pdu *msp)
+tls_msp_fragment_id(struct tcp_multisegment_pdu *msp)
 {
     /*
      * If a frame contains multiple appdata PDUs, then "first_frame" is not
@@ -1213,7 +1213,7 @@ again:
         }
 
         ipfd_head = fragment_add(&ssl_reassembly_table, tvb, offset,
-                                 pinfo, tls_msp_frament_id(msp), NULL,
+                                 pinfo, tls_msp_fragment_id(msp), NULL,
                                  seq - msp->seq,
                                  len, (LT_SEQ (nxtseq,msp->nxtpdu)));
 
@@ -1339,7 +1339,7 @@ again:
                  * needs desegmentation).
                  */
                 fragment_set_partial_reassembly(&ssl_reassembly_table,
-                                                pinfo, msp->first_frame, NULL);
+                                                pinfo, tls_msp_fragment_id(msp), NULL);
                 /* Update msp->nxtpdu to point to the new next
                  * pdu boundary.
                  */
@@ -1485,7 +1485,7 @@ again:
 
             /* add this segment as the first one for this new pdu */
             fragment_add(&ssl_reassembly_table, tvb, deseg_offset,
-                         pinfo, tls_msp_frament_id(msp), NULL,
+                         pinfo, tls_msp_fragment_id(msp), NULL,
                          0, nxtseq - deseg_seq,
                          LT_SEQ(nxtseq, msp->nxtpdu));
         }