]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
app-layer-smtp: add STARTTLS support
authorMats Klepsland <mats.klepsland@gmail.com>
Tue, 31 Jan 2017 13:58:20 +0000 (14:58 +0100)
committerVictor Julien <victor@inliniac.net>
Mon, 8 May 2017 08:43:36 +0000 (10:43 +0200)
src/app-layer-smtp.c

index 56fd838fcd6fc61fa5b2c3e5b09b4c94c9e00c49..fe95de3f659214b2210c7f92008e7e9c799a59dc 100644 (file)
@@ -954,9 +954,8 @@ static int SMTPProcessReply(SMTPState *state, Flow *f,
         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);
+            FlowSetChangeProtoFlag(f);
+            state->curr_tx->done = 1;
         } else {
             /* decoder event */
             SMTPSetEvent(state, SMTP_DECODER_EVENT_TLS_REJECTED);
@@ -1890,10 +1889,7 @@ static int SMTPParserTest01(void)
         goto end;
     }
 
-    if (!(f.flags & FLOW_NOPAYLOAD_INSPECTION) ||
-        !(ssn.flags & STREAMTCP_FLAG_APP_LAYER_DISABLED) ||
-        !(((TcpSession *)f.protoctx)->server.flags & STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED) ||
-        !(((TcpSession *)f.protoctx)->client.flags & STREAMTCP_STREAM_FLAG_NEW_RAW_DISABLED)) {
+    if (!FlowChangeProto(&f)) {
         goto end;
     }