]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
fixed config issue
authorhuica <huica@cisco.com>
Tue, 21 Jul 2015 21:06:15 +0000 (17:06 -0400)
committerhuica <huica@cisco.com>
Tue, 21 Jul 2015 21:06:15 +0000 (17:06 -0400)
src/file_api/file_mime_process.cc
src/service_inspectors/smtp/smtp.cc
src/service_inspectors/smtp/smtp.h

index 3dc4a0f6414b507b2816286a610f29e0f1970e3b..ed7beadb6402da17829bfc8c7276b836642fb4da 100644 (file)
@@ -547,11 +547,6 @@ void MimeSession::reset_mime_state()
     ClearEmailDecodeState(decode_state);
 }
 
-/*
- * Main function for mime processing
- *
- * This should be called when mime data is available
- */
 const uint8_t* MimeSession::process_mime_data_paf(Flow* flow, const uint8_t* start, const uint8_t* end,
    bool upload, FilePosition position)
 {
@@ -681,11 +676,8 @@ const uint8_t* MimeSession::process_mime_data_paf(Flow* flow, const uint8_t* sta
     return end;
 }
 
-/*
- *  * Main function for mime processing
- *   *
- *    * This should be called when mime data is available
- *     */
+// Main function for mime processing
+// This should be called when mime data is available
 const uint8_t* MimeSession::process_mime_data(Flow* flow, const uint8_t* start,
     const uint8_t* data_end_marker, bool upload, FilePosition position)
 {
index d9d31816522d466df056abaf5c53521c6ea24752..97ae28d7c4929b83c32db5daa6492bdb30814ac5 100644 (file)
@@ -192,8 +192,7 @@ SMTPData* SetNewSMTPData(SMTP_PROTO_CONF* config, Packet* p)
     smtp_ssn = &fd->session;
 
     smtp_ssn->mime_ssn = new SmtpMime(&(config->decode_conf), &(config->log_config));
-    //smtp_ssn->mime_ssn.methods = &(smtp_mime_methods);
-    //smtp_ssn->mime_ssn.config = config;
+    smtp_ssn->mime_ssn->config = config;
 
     if(stream.is_midstream(p->flow))
     {
@@ -1453,7 +1452,6 @@ int SmtpMime::handle_header_line(void* conf, const uint8_t* ptr, const uint8_t*
 {
     int ret;
     int header_line_len;
-    SMTP_PROTO_CONF* config = (SMTP_PROTO_CONF*)conf;
     MimeSession* mime_ssn = (MimeSession*)this;
     /* get length of header line */
     header_line_len = eol - ptr;
@@ -1499,8 +1497,6 @@ int SmtpMime::handle_header_line(void* conf, const uint8_t* ptr, const uint8_t*
 
 int SmtpMime::normalize_data(void* conf, const uint8_t* ptr, const uint8_t* data_end)
 {
-    SMTP_PROTO_CONF* config = (SMTP_PROTO_CONF*)conf;
-
     /* if we're ignoring data and not already normalizing, copy everything
      * up to here into alt buffer so detection engine doesn't have
      * to look at the data; otherwise, if we're normalizing and not
index d559a54c1d7dee1a014f553ff88517312c100f15..15eef2dbccc146e9f80348a78777289042021931 100644 (file)
@@ -143,7 +143,9 @@ struct SMTPAuthName
 
 class SmtpMime : public MimeSession
 {
+public:
     using MimeSession::MimeSession;
+    SMTP_PROTO_CONF* config;
 private:
     int handle_header_line(void* conf, const uint8_t* ptr, const uint8_t* eol,
         int max_header_len) override;