forked from Componolit/RecordFlux-specifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tls_record.rflx
37 lines (32 loc) · 1 KB
/
tls_record.rflx
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
package TLS_Record is
type Content_Type is
(INVALID => 0,
CHANGE_CIPHER_SPEC => 20,
ALERT => 21,
HANDSHAKE => 22,
APPLICATION_DATA => 23,
HEARTBEAT => 24)
with Size => 8;
type Protocol_Version is
(TLS_1_0 => 16#0301#,
TLS_1_1 => 16#0302#,
TLS_1_2 => 16#0303#,
TLS_1_3 => 16#0304#)
with Size => 16;
type Length is range 0 .. 2**14 + 256 with Size => 16;
type TLS_Record is
message
Tag : Content_Type;
Legacy_Record_Version : Protocol_Version;
Length : Length
then Fragment
with Size => Length * 8
if Tag /= APPLICATION_DATA and Length <= 2**14
then Encrypted_Record
with Size => Length * 8
if Tag = APPLICATION_DATA and Legacy_Record_Version = TLS_1_2;
Fragment : Opaque
then null;
Encrypted_Record : Opaque;
end message;
end TLS_Record;