suricata
|
#include "suricata-common.h"
#include "decode.h"
#include "app-layer.h"
#include "app-layer-detect-proto.h"
#include "app-layer-protos.h"
#include "app-layer-parser.h"
#include "app-layer-frames.h"
#include "app-layer-events.h"
#include "app-layer-ssl.h"
#include "conf.h"
#include "feature.h"
#include "util-debug.h"
#include "util-ja3.h"
#include "util-enum.h"
#include "util-validate.h"
Go to the source code of this file.
Data Structures | |
struct | SslConfig_ |
struct | SSLDecoderResult |
Typedefs | |
typedef struct SslConfig_ | SslConfig |
Enumerations | |
enum | { ERR_INVALID_CERTIFICATE =1 , ERR_INVALID_LENGTH , ERR_INVALID_VERSION , ERR_INVALID_SERIAL , ERR_INVALID_ALGORITHMIDENTIFIER , ERR_INVALID_X509NAME , ERR_INVALID_DATE , ERR_INVALID_EXTENSIONS , ERR_INVALID_DER , ERR_EXTRACT_SUBJECT , ERR_EXTRACT_ISSUER , ERR_EXTRACT_VALIDITY } |
enum | SslConfigEncryptHandling { SSL_CNF_ENC_HANDLE_TRACK_ONLY = 0 , SSL_CNF_ENC_HANDLE_BYPASS = 1 , SSL_CNF_ENC_HANDLE_FULL = 2 } |
Functions | |
void | RegisterSSLParsers (void) |
Function to register the SSL protocol parser and other functions. | |
void | SSLEnableJA3 (void) |
if not explicitly disabled in config, enable ja3 support | |
void | SSLEnableJA4 (void) |
if not explicitly disabled in config, enable ja4 support | |
bool | SSLJA3IsEnabled (void) |
return whether ja3 is effectively enabled | |
bool | SSLJA4IsEnabled (void) |
return whether ja4 is effectively enabled | |
Variables | |
SCEnumCharMap | tls_frame_table [] |
SCEnumCharMap | tls_decoder_event_table [] |
SslConfig | ssl_config |
Definition in file app-layer-ssl.c.
#define HAS_SPACE | ( | n | ) | ((uint64_t)(input - initial_input) + (uint64_t)(n) <= (uint64_t)(input_len)) |
Definition at line 260 of file app-layer-ssl.c.
#define SHA1_STRING_LENGTH 60 |
Definition at line 258 of file app-layer-ssl.c.
#define SSL_CONFIG_DEFAULT_JA3 0 |
Definition at line 189 of file app-layer-ssl.c.
#define SSL_DECODER_ERROR | ( | e | ) |
Definition at line 266 of file app-layer-ssl.c.
#define SSL_DECODER_INCOMPLETE | ( | c, | |
n | |||
) |
Definition at line 276 of file app-layer-ssl.c.
#define SSL_DECODER_OK | ( | c | ) |
Definition at line 271 of file app-layer-ssl.c.
#define SSL_RECORD_MINIMUM_LENGTH 6 |
Definition at line 256 of file app-layer-ssl.c.
#define SSLParserHSReset | ( | connp | ) |
Definition at line 312 of file app-layer-ssl.c.
#define SSLParserReset | ( | state | ) |
Definition at line 318 of file app-layer-ssl.c.
#define SSLSetEvent | ( | ssl_state, | |
event | |||
) |
Definition at line 325 of file app-layer-ssl.c.
#define SSLV2_MT_CLIENT_CERTIFICATE 8 |
Definition at line 243 of file app-layer-ssl.c.
#define SSLV2_MT_CLIENT_FINISHED 3 |
Definition at line 238 of file app-layer-ssl.c.
#define SSLV2_MT_CLIENT_HELLO 1 |
Definition at line 236 of file app-layer-ssl.c.
#define SSLV2_MT_CLIENT_MASTER_KEY 2 |
Definition at line 237 of file app-layer-ssl.c.
#define SSLV2_MT_ERROR 0 |
Definition at line 235 of file app-layer-ssl.c.
#define SSLV2_MT_REQUEST_CERTIFICATE 7 |
Definition at line 242 of file app-layer-ssl.c.
#define SSLV2_MT_SERVER_FINISHED 6 |
Definition at line 241 of file app-layer-ssl.c.
#define SSLV2_MT_SERVER_HELLO 4 |
Definition at line 239 of file app-layer-ssl.c.
#define SSLV2_MT_SERVER_VERIFY 5 |
Definition at line 240 of file app-layer-ssl.c.
#define SSLV3_ALERT_PROTOCOL 21 |
Definition at line 214 of file app-layer-ssl.c.
#define SSLV3_APPLICATION_PROTOCOL 23 |
Definition at line 216 of file app-layer-ssl.c.
#define SSLV3_CHANGE_CIPHER_SPEC 20 |
Definition at line 213 of file app-layer-ssl.c.
#define SSLV3_CLIENT_HELLO_RANDOM_LEN 32 |
Definition at line 250 of file app-layer-ssl.c.
#define SSLV3_CLIENT_HELLO_VERSION_LEN 2 |
Definition at line 249 of file app-layer-ssl.c.
#define SSLV3_HANDSHAKE_PROTOCOL 22 |
Definition at line 215 of file app-layer-ssl.c.
#define SSLV3_HEARTBEAT_PROTOCOL 24 |
Definition at line 217 of file app-layer-ssl.c.
#define SSLV3_HS_CERTIFICATE 11 |
Definition at line 224 of file app-layer-ssl.c.
#define SSLV3_HS_CERTIFICATE_REQUEST 13 |
Definition at line 226 of file app-layer-ssl.c.
#define SSLV3_HS_CERTIFICATE_STATUS 22 |
Definition at line 232 of file app-layer-ssl.c.
#define SSLV3_HS_CERTIFICATE_URL 21 |
Definition at line 231 of file app-layer-ssl.c.
#define SSLV3_HS_CERTIFICATE_VERIFY 15 |
Definition at line 228 of file app-layer-ssl.c.
#define SSLV3_HS_CLIENT_HELLO 1 |
Definition at line 221 of file app-layer-ssl.c.
#define SSLV3_HS_CLIENT_KEY_EXCHANGE 16 |
Definition at line 229 of file app-layer-ssl.c.
#define SSLV3_HS_FINISHED 20 |
Definition at line 230 of file app-layer-ssl.c.
#define SSLV3_HS_HELLO_REQUEST 0 |
Definition at line 220 of file app-layer-ssl.c.
#define SSLV3_HS_NEW_SESSION_TICKET 4 |
Definition at line 223 of file app-layer-ssl.c.
#define SSLV3_HS_SERVER_HELLO 2 |
Definition at line 222 of file app-layer-ssl.c.
#define SSLV3_HS_SERVER_HELLO_DONE 14 |
Definition at line 227 of file app-layer-ssl.c.
#define SSLV3_HS_SERVER_KEY_EXCHANGE 12 |
Definition at line 225 of file app-layer-ssl.c.
#define SSLV3_RECORD_HDR_LEN 5 |
Definition at line 245 of file app-layer-ssl.c.
#define SSLV3_RECORD_MAX_LEN ((1 << 14) + 1024) |
max length according to RFC 5246 6.2.2 is 2^14 + 1024
Definition at line 247 of file app-layer-ssl.c.
#define TLS_HB_REQUEST 1 |
Definition at line 253 of file app-layer-ssl.c.
#define TLS_HB_RESPONSE 2 |
Definition at line 254 of file app-layer-ssl.c.
#define ValidateRecordState | ( | ... | ) |
Definition at line 309 of file app-layer-ssl.c.
typedef struct SslConfig_ SslConfig |
anonymous enum |
Definition at line 169 of file app-layer-ssl.c.
Definition at line 194 of file app-layer-ssl.c.
void RegisterSSLParsers | ( | void | ) |
Function to register the SSL protocol parser and other functions.
SSLv2 and SSLv23
Definition at line 3188 of file app-layer-ssl.c.
References ALPROTO_TLS, AppLayerParserRegisterGetEventInfo(), AppLayerParserRegisterGetEventInfoById(), AppLayerParserRegisterGetFrameFuncs(), AppLayerParserRegisterGetStateFuncs(), AppLayerParserRegisterGetStateProgressFunc(), AppLayerParserRegisterGetTx(), AppLayerParserRegisterGetTxCnt(), AppLayerParserRegisterParser(), AppLayerParserRegisterStateDataFunc(), AppLayerParserRegisterStateFuncs(), AppLayerParserRegisterStateProgressCompletionStatus(), AppLayerParserRegisterTxDataFunc(), AppLayerParserRegisterTxFreeFunc(), AppLayerProtoDetectRegisterProtocol(), SslConfig_::encrypt_mode, g_disable_hashing, RunmodeIsUnittests(), SC_ATOMIC_GET, SC_ATOMIC_INIT, SC_ATOMIC_SET, SCAppLayerParserConfParserEnabled(), SCAppLayerParserRegisterParserAcceptableDataDirection(), SCAppLayerProtoDetectConfProtoDetectionEnabled(), SCAppLayerProtoDetectPPParseConfPorts(), SCAppLayerProtoDetectPPRegister(), SCConfGetBool(), SCConfGetNode(), SCLogConfig, SCLogDebug, SCLogWarning, SSL_CNF_ENC_HANDLE_BYPASS, SSL_CNF_ENC_HANDLE_FULL, SSL_CNF_ENC_HANDLE_TRACK_ONLY, ssl_config, TLS_STATE_CLIENT_FINISHED, TLS_STATE_SERVER_FINISHED, and SCConfNode_::val.
Referenced by AppLayerParserRegisterProtocolParsers().
void SSLEnableJA3 | ( | void | ) |
if not explicitly disabled in config, enable ja3 support
Implemented using atomic to allow rule reloads to do this at runtime.
Definition at line 3319 of file app-layer-ssl.c.
References SslConfig_::disable_ja3, g_disable_hashing, SC_ATOMIC_GET, SC_ATOMIC_SET, and ssl_config.
void SSLEnableJA4 | ( | void | ) |
if not explicitly disabled in config, enable ja4 support
Implemented using atomic to allow rule reloads to do this at runtime.
Definition at line 3336 of file app-layer-ssl.c.
References SslConfig_::disable_ja4, g_disable_hashing, SC_ATOMIC_GET, SC_ATOMIC_SET, and ssl_config.
bool SSLJA3IsEnabled | ( | void | ) |
return whether ja3 is effectively enabled
This means that it either has been enabled explicitly or has been enabled by having loaded a rule while not being explicitly disabled.
true | if enabled, false otherwise |
Definition at line 3356 of file app-layer-ssl.c.
References SC_ATOMIC_GET, and ssl_config.
bool SSLJA4IsEnabled | ( | void | ) |
return whether ja4 is effectively enabled
This means that it either has been enabled explicitly or has been enabled by having loaded a rule while not being explicitly disabled.
true | if enabled, false otherwise |
Definition at line 3369 of file app-layer-ssl.c.
References SC_ATOMIC_GET, and ssl_config.
SslConfig ssl_config |
Definition at line 210 of file app-layer-ssl.c.
Referenced by RegisterSSLParsers(), SSLEnableJA3(), SSLEnableJA4(), SSLJA3IsEnabled(), and SSLJA4IsEnabled().
SCEnumCharMap tls_decoder_event_table[] |
Definition at line 131 of file app-layer-ssl.c.
SCEnumCharMap tls_frame_table[] |
Definition at line 99 of file app-layer-ssl.c.