Go to the documentation of this file.
26 #ifndef SURICATA_APP_LAYER_SSL_H
27 #define SURICATA_APP_LAYER_SSL_H
84 #define SSL_AL_FLAG_SERVER_CHANGE_CIPHER_SPEC BIT_U32(0)
86 #define SSL_AL_FLAG_CLIENT_CHANGE_CIPHER_SPEC BIT_U32(1)
87 #define SSL_AL_FLAG_CHANGE_CIPHER_SPEC BIT_U32(2)
90 #define SSL_AL_FLAG_SSL_CLIENT_HS BIT_U32(3)
91 #define SSL_AL_FLAG_SSL_SERVER_HS BIT_U32(4)
92 #define SSL_AL_FLAG_SSL_CLIENT_MASTER_KEY BIT_U32(5)
93 #define SSL_AL_FLAG_SSL_CLIENT_SSN_ENCRYPTED BIT_U32(6)
94 #define SSL_AL_FLAG_SSL_SERVER_SSN_ENCRYPTED BIT_U32(7)
95 #define SSL_AL_FLAG_SSL_NO_SESSION_ID BIT_U32(8)
98 #define SSL_AL_FLAG_STATE_CLIENT_HELLO BIT_U32(9)
99 #define SSL_AL_FLAG_STATE_SERVER_HELLO BIT_U32(10)
100 #define SSL_AL_FLAG_STATE_CLIENT_KEYX BIT_U32(11)
101 #define SSL_AL_FLAG_STATE_SERVER_KEYX BIT_U32(12)
102 #define SSL_AL_FLAG_STATE_UNKNOWN BIT_U32(13)
105 #define SSL_AL_FLAG_STATE_FINISHED BIT_U32(14)
108 #define SSL_AL_FLAG_HB_INFLIGHT BIT_U32(15)
109 #define SSL_AL_FLAG_HB_CLIENT_INIT BIT_U32(16)
110 #define SSL_AL_FLAG_HB_SERVER_INIT BIT_U32(17)
113 #define SSL_AL_FLAG_HANDSHAKE_DONE BIT_U32(18)
116 #define SSL_AL_FLAG_SESSION_RESUMED BIT_U32(20)
119 #define SSL_AL_FLAG_CH_VERSION_EXTENSION BIT_U32(21)
123 #define SSL_AL_FLAG_LOG_WITHOUT_CERT BIT_U32(22)
127 #define SSL_AL_FLAG_EARLY_DATA BIT_U32(23)
130 #define TLS_TS_RANDOM_SET BIT_U32(24)
133 #define TLS_TC_RANDOM_SET BIT_U32(25)
135 #define SSL_AL_FLAG_NEED_CLIENT_CERT BIT_U32(26)
138 #define SSL_TLS_LOG_PEM (1 << 0)
141 #define SSL_EXTENSION_SNI 0x0000
142 #define SSL_EXTENSION_ELLIPTIC_CURVES 0x000a
143 #define SSL_EXTENSION_EC_POINT_FORMATS 0x000b
144 #define SSL_EXTENSION_SIGNATURE_ALGORITHMS 0x000d
145 #define SSL_EXTENSION_ALPN 0x0010
146 #define SSL_EXTENSION_SESSION_TICKET 0x0023
147 #define SSL_EXTENSION_EARLY_DATA 0x002a
148 #define SSL_EXTENSION_SUPPORTED_VERSIONS 0x002b
151 #define SSL_SNI_TYPE_HOST_NAME 0
154 #define SSL_VERSION_MAX_STRLEN 20
157 #define TLS_RANDOM_LEN 32
190 static inline bool TLSVersionValid(
const uint16_t
version)
@ TLS_DECODER_EVENT_HANDSHAKE_INVALID_LENGTH
@ TLS_DECODER_EVENT_MULTIPLE_SNI_EXTENSIONS
SSLv[2.0|3.[0|1|2|3]] state structure.
@ TLS_DECODER_EVENT_INVALID_SSL_RECORD
SSLStateConnp client_connp
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_X509NAME
struct HtpBodyChunk_ * next
SSLStateConnp server_connp
@ TLS_DECODER_EVENT_INVALID_HEARTBEAT
uint16_t session_id_length
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_DER
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_EXTENSIONS
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_SERIAL
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_VERSION
struct SSLAlpns_ SSLAlpns
@ TLS_VERSION_13_DRAFT26_FB
SSLStateConnp * curr_connp
@ TLS_DECODER_EVENT_HEARTBEAT
AppLayerStateData state_data
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_VALIDITY
@ TLS_DECODER_EVENT_INVALID_SNI_LENGTH
void SSLVersionToString(uint16_t, char *)
@ TLS_DECODER_EVENT_INVALID_SSLV2_HEADER
uint8_t hs_buffer_message_type
@ TLS_VERSION_13_DRAFT20_FB
uint32_t record_lengths_length
@ TLS_VERSION_13_PRE_DRAFT16
struct SSLStateConnp_ SSLStateConnp
@ TLS_VERSION_13_DRAFT22_FB
void SSLEnableJA3(void)
if not explicitly disabled in config, enable ja3 support
uint32_t hs_buffer_offset
TAILQ_HEAD(, SSLAlpns_) alpns
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_SUBJECT
void RegisterSSLParsers(void)
Function to register the SSL protocol parser and other functions.
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_LENGTH
@ TLS_DECODER_EVENT_INVALID_SNI_TYPE
uint32_t certs_buffer_size
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_ALGORITHMIDENTIFIER
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_ISSUER
@ TLS_VERSION_13_DRAFT21_FB
struct AppLayerTxData AppLayerTxData
uint8_t random[TLS_RANDOM_LEN]
@ TLS_DECODER_EVENT_INVALID_RECORD_LENGTH
@ TLS_DECODER_EVENT_OVERFLOW_HEARTBEAT
TAILQ_ENTRY(SSLAlpns_) next
@ TLS_DECODER_EVENT_CERTIFICATE_INVALID_DATE
uint32_t hs_buffer_message_size
void SSLEnableJA4(void)
if not explicitly disabled in config, enable ja4 support
@ TLS_DECODER_EVENT_INVALID_TLS_HEADER
@ TLS_DECODER_EVENT_DATALEAK_HEARTBEAT_MISMATCH
bool SSLJA3IsEnabled(void)
return whether ja3 is effectively enabled
TAILQ_HEAD(, SSLCertsChain_) certs
@ TLS_VERSION_13_DRAFT23_FB
@ TLS_DECODER_EVENT_ERROR_MSG_ENCOUNTERED
@ TLS_DECODER_EVENT_INVALID_HANDSHAKE_MESSAGE
@ TLS_DECODER_EVENT_INVALID_RECORD_VERSION
TAILQ_ENTRY(SSLCertsChain_) next
@ TLS_DECODER_EVENT_INVALID_RECORD_TYPE
@ TLS_DECODER_EVENT_INVALID_CERTIFICATE
struct SSLState_ SSLState
SSLv[2.0|3.[0|1|2|3]] state structure.
struct SSLCertsChain_ SSLCertsChain
@ TLS_DECODER_EVENT_TOO_MANY_RECORDS_IN_PACKET
bool SSLJA4IsEnabled(void)
return whether ja4 is effectively enabled