From: Mats Klepsland Date: Tue, 31 Jan 2017 13:58:20 +0000 (+0100) Subject: app-layer-smtp: add STARTTLS support X-Git-Tag: suricata-4.0.0-beta1~99 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8800b1893b440b2fe56736f45e0d5222ea4f60b;p=thirdparty%2Fsuricata.git app-layer-smtp: add STARTTLS support --- diff --git a/src/app-layer-smtp.c b/src/app-layer-smtp.c index 56fd838fcd..fe95de3f65 100644 --- a/src/app-layer-smtp.c +++ b/src/app-layer-smtp.c @@ -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; }