Skip to content

Commit

Permalink
smtp layer: reset app layer after STARTTLS
Browse files Browse the repository at this point in the history
This patch updates SMTP layer to ask for a reset of application
layer when a successful STARTTLS command is seen. A full reset is
asked to allow the application layer to skip server answer and
continue to proceed the data.
  • Loading branch information
regit committed Nov 17, 2014
1 parent 0521ea6 commit a1ff46d
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/app-layer-smtp.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,11 +846,8 @@ static int SMTPProcessReply(SMTPState *state, Flow *f,
/* reply but not a command we have stored, fall through */
} else if (state->cmds[state->cmds_idx] == SMTP_COMMAND_STARTTLS) {
if (reply_code == SMTP_REPLY_220) {
/* we are entering STARRTTLS data mode */
state->parser_state |= SMTP_PARSER_STATE_COMMAND_DATA_MODE;
AppLayerParserStateSetFlag(pstate,
APP_LAYER_PARSER_NO_INSPECTION |
APP_LAYER_PARSER_NO_REASSEMBLY);
/* we reset the alproto */
AppLayerAskReset(f, 1);
} else {
/* decoder event */
SMTPSetEvent(state, SMTP_DECODER_EVENT_TLS_REJECTED);
Expand Down

0 comments on commit a1ff46d

Please sign in to comment.