forked from fredburger/xt_sslpin
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ssl_tls.h
88 lines (79 loc) · 3.15 KB
/
ssl_tls.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
/*
* ssl_tls.h
*
* Copyright (C) 2016 Enteee (duckpond.ch)
*
* This program is free software; you can redistribute it and/or modify it under the terms of the
* GNU General Public License as published by the Free Software Foundation; version 2 of the License.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with this program; if not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _LINUX_NETFILTER_XT_SSLPIN_SSL_TLS_H
#define _LINUX_NETFILTER_XT_SSLPIN_SSL_TLS_H
#define SSL3_VERSION 0x0300
#define TLS1_VERSION 0x0301
#define TLS1_1_VERSION 0x0302
#define TLS1_2_VERSION 0x0303
#define SSL3_RT_CHANGE_CIPHER_SPEC 20
#define SSL3_RT_ALERT 21
#define SSL3_RT_HANDSHAKE 22
#define SSL3_RT_APPLICATION_DATA 23
#define TLS1_RT_HEARTBEAT 24
#define SSL3_MT_HELLO_REQUEST 0
#define SSL3_MT_CLIENT_HELLO 1
#define SSL3_MT_SERVER_HELLO 2
#define TSL1_2_MT_HELLO_VERIFY_REQUEST 3
#define TLS1_MT_NEWSESSIONTICKET 4
/* 5 - 10 unassigned */
#define SSL3_MT_CERTIFICATE 11
#define SSL3_MT_SERVER_KEY_EXCHANGE 12
#define SSL3_MT_CERTIFICATE_REQUEST 13
#define SSL3_MT_SERVER_DONE 14
#define SSL3_MT_CERTIFICATE_VERIFY 15
#define SSL3_MT_CLIENT_KEY_EXCHANGE 16
/* 17 - 19 unassigned */
#define SSL3_MT_FINISHED 20
#define TLS1_2_MT_CERTIFICATE_URL 21
#define TLS1_2_MT_CERTIFICATE_STATUS 22
#define TLS1_2_MT_SUPPLEMENTAL_DATA 23
static inline const char* sslpin_ssl_handshake_mt_to_string(__u8 mt) {
switch (mt) {
case SSL3_MT_HELLO_REQUEST:
return "HelloRequest";
case SSL3_MT_CLIENT_HELLO:
return "ClientHello";
case SSL3_MT_SERVER_HELLO:
return "ServerHello";
case TSL1_2_MT_HELLO_VERIFY_REQUEST:
return "HelloVerifyRequest";
case TLS1_MT_NEWSESSIONTICKET:
return "NewSessionticket";
case SSL3_MT_CERTIFICATE:
return "Certificate";
case SSL3_MT_SERVER_KEY_EXCHANGE:
return "ServerKeyExchange";
case SSL3_MT_CERTIFICATE_REQUEST:
return "CertificateRequest";
case SSL3_MT_SERVER_DONE:
return "ServerDone";
case SSL3_MT_CERTIFICATE_VERIFY:
return "CertificateVerify";
case SSL3_MT_CLIENT_KEY_EXCHANGE:
return "ClientKeyExchange";
case SSL3_MT_FINISHED:
return "Finished";
case TLS1_2_MT_CERTIFICATE_URL:
return "CertificateURL";
case TLS1_2_MT_CERTIFICATE_STATUS:
return "CertificateStatus";
case TLS1_2_MT_SUPPLEMENTAL_DATA:
return "SupplementalData";
}
return NULL;
}
#endif /* _LINUX_NETFILTER_XT_SSLPIN_SSL_TLS_H */