]> git.ipfire.org Git - people/ms/suricata.git/blob - src/app-layer-ssl.h
support for sslv2/sslv3 their unit tests and better stream no reassembly flag handling
[people/ms/suricata.git] / src / app-layer-ssl.h
1 /* Copyright (C) 2007-2010 Open Information Security Foundation
2 *
3 * You can copy, redistribute or modify this Program under the terms of
4 * the GNU General Public License version 2 as published by the Free
5 * Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * version 2 along with this program; if not, write to the Free Software
14 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
15 * 02110-1301, USA.
16 */
17
18 /**
19 * \file
20 *
21 * \author Gurvinder Singh <gurvindersinghdahiya@gmail.com>
22 */
23
24 #ifndef _APP_LAYER_SSL_H
25 #define _APP_LAYER_SSL_H
26
27 #define SSL_CLIENT_VERSION 0x0002
28 #define SSL_SERVER_VERSION 0x0002
29
30 /* SSL state flags */
31 #define SSL_FLAG_CLIENT_HS 0x01
32 #define SSL_FLAG_SERVER_HS 0x02
33 #define SSL_FLAG_CLIENT_MASTER_KEY 0x04
34 #define SSL_FLAG_CLIENT_SSN_ENCRYPTED 0x08
35 #define SSL_FLAG_SERVER_SSN_ENCRYPTED 0x10
36 #define SSL_FLAG_NO_SESSION_ID 0x20
37
38 /* SSL message types */
39 #define SSL_ERROR 0
40 #define SSL_CLIENT_HELLO 1
41 #define SSL_CLIENT_MASTER_KEY 2
42 #define SSL_CLIENT_FINISHED 3
43 #define SSL_SERVER_HELLO 4
44 #define SSL_SERVER_VERIFY 5
45 #define SSL_SERVER_FINISHED 6
46 #define SSL_REQUEST_CERTIFICATE 7
47 #define SSL_CLIENT_CERTIFICATE 8
48
49 /* structure to store the SSL state values */
50 typedef struct SslState_ {
51 uint8_t client_content_type; /**< Client content type storage field */
52 uint16_t client_version; /**< Client SSL version storage field */
53
54 uint8_t server_content_type; /**< Server content type storage field */
55 uint16_t server_version; /**< Server SSL version storage field */
56
57 uint8_t flags; /**< Flags to indicate the current SSL
58 sessoin state */
59 } SslState;
60
61 typedef struct SslClient_ {
62 uint16_t length; /**< Length of the received message */
63 uint8_t msg_type;
64 uint8_t minor_ver;
65 uint8_t major_ver;
66 uint16_t cipher_spec_len;
67 uint16_t session_id_len;
68 } SslClient;
69
70 typedef struct SslServer_ {
71 uint16_t lentgth;
72 uint8_t msg_type;
73 uint8_t session_id;
74 uint8_t cert;
75 uint8_t minor_ver;
76 uint8_t major_ver;
77 } SslServer;
78
79 void RegisterSSLParsers(void);
80 void SSLParserRegisterTests(void);
81
82 #endif /* _APP_LAYER_SSL_H */
83