Merge in SNORT/snort3 from ~LCZARNIK/snort3:appid_imaps to master
Squashed commit of the following:
commit
50fc3462f4f62ad0039e21ff8a103dc80fd65311
Author: Lukasz Czarnik <lczarnik@cisco.com>
Date: Wed Jun 7 10:53:33 2023 -0400
appid: fix for opportunistic tls detected as ssl
return cip_msp;
}
+ inline bool is_encrypted_oportunistic_tls_session()
+ {
+ return get_session_flags(APPID_SESSION_OPPORTUNISTIC_TLS) and !flow->flags.data_decrypted;
+ }
+
private:
uint16_t prev_httpx_raw_packet = 0;
}
}
+ if (asd.is_encrypted_oportunistic_tls_session() and asd.encrypted.client_id > 0)
+ {
+ asd.set_client_id(asd.encrypted.client_id);
+ asd.set_client_detected();
+ asd.client_disco_state = APPID_DISCO_STATE_FINISHED;
+ }
+
if (asd.client_disco_state == APPID_DISCO_STATE_STATEFUL)
{
if (asd.client_candidates.empty() and tp_app_id > APP_ID_NONE and
if (id->flags & IMAP_FLAG_RESULT_OK)
{
// FIXIT-L - this may be called from server side
- //add_app(asd, APP_ID_IMAPS, APP_ID_IMAPS, nullptr);
+ detector->add_app(asd, APP_ID_IMAPS, APP_ID_IMAPS, nullptr, change_bits);
asd.clear_session_flags(APPID_SESSION_CLIENT_GETS_SERVER_PACKETS);
}
else
}
}
+ if (asd.is_encrypted_oportunistic_tls_session() and asd.encrypted.service_id > 0)
+ {
+ asd.set_service_id(asd.encrypted.service_id, asd.get_odp_ctxt());
+ asd.stop_service_inspection(p, direction);
+ }
+
//stop inspection as soon as tp has classified a valid AppId later in the session
if ( tp_app_id > APP_ID_NONE and
asd.service_disco_state == APPID_DISCO_STATE_STATEFUL and