*/
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;
}
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) {
* 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",