string* tls_org_unit_buf = nullptr;
string* http_request_referer_buf = nullptr;
string* ftp_command_user_buf = nullptr;
+ string* quic_sni_buf = nullptr;
uint16_t http_request_uri_offset = 0;
uint16_t http_request_uri_end_offset = 0;
if (tls_org_unit_buf) delete tls_org_unit_buf;
if (http_request_referer_buf) delete http_request_referer_buf;
if (ftp_command_user_buf) delete ftp_command_user_buf;
+ if (quic_sni_buf) delete quic_sni_buf;
}
// Note: calling these 2 times in a row, the 2nd time it returns null.
TPAD_GET(tls_org_unit)
TPAD_GET(http_request_referer)
TPAD_GET(ftp_command_user)
+ TPAD_GET(quic_sni)
uint16_t http_request_uri_begin() { return http_request_uri_offset; }
uint16_t http_request_uri_end() { return http_request_uri_end_offset; }
TPAD_SET(tls_org_unit)
TPAD_SET_OFFSET(http_request_referer)
TPAD_SET(ftp_command_user)
+ TPAD_SET(quic_sni)
};
#endif
}
}
+static inline void process_quic(AppIdSession& asd,
+ ThirdPartyAppIDAttributeData& attribute_data, AppidChangeBits& change_bits)
+{
+ const string* field = 0;
+ if ( !asd.tsession )
+ asd.tsession = (TlsSession*)snort_calloc(sizeof(TlsSession));
+
+ if ( (field=attribute_data.quic_sni()) != nullptr )
+ {
+ if ( appidDebug->is_active() )
+ LogMessage("AppIdDbg %s Flow is QUIC\n", appidDebug->get_debug_session());
+ asd.tsession->set_tls_host(field->c_str(), field->size(), change_bits);
+ if ( asd.service.get_id() <= APP_ID_NONE )
+ asd.set_service_appid_data(APP_ID_QUIC, change_bits);
+ }
+}
+
static inline void process_third_party_results(AppIdSession& asd, int confidence,
const vector<AppId>& proto_list, ThirdPartyAppIDAttributeData& attribute_data,
AppidChangeBits& change_bits)
else if (contains(proto_list, APP_ID_FTP_CONTROL))
process_ftp_control(asd, attribute_data);
+
+ else if (contains(proto_list, APP_ID_QUIC))
+ process_quic(asd, attribute_data, change_bits);
}
static inline void check_terminate_tp_module(AppIdSession& asd, uint16_t tpPktCount)
&& (!asd.get_session_flags(APPID_SESSION_APP_REINSPECT)
|| asd.payload.get_id() > APP_ID_NONE) )
{
- AppId snort_app_id;
+ AppId snort_app_id = APP_ID_NONE;
// if the packet is HTTP, then search for via pattern
if ( asd.get_session_flags(APPID_SESSION_HTTP_SESSION) )
}
snort_app_id = APP_ID_SSL;
}
+ else if (asd.service.get_id() == APP_ID_QUIC)
+ asd.set_tp_payload_app_id(*p, direction, tp_app_id, change_bits);
else
{
//for non-http protocols, tp id is treated like serviceId