]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/Tls1.h
MdePkg: Clean up source files
[mirror_edk2.git] / MdePkg / Include / IndustryStandard / Tls1.h
CommitLineData
973f8862
HW
1/** @file\r
2 Transport Layer Security -- TLS 1.0/1.1/1.2 Standard definitions, from RFC 2246/4346/5246\r
3\r
4 This file contains common TLS 1.0/1.1/1.2 definitions from RFC 2246/4346/5246\r
5\r
0469ed69 6 Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.<BR>\r
973f8862
HW
7 This program and the accompanying materials\r
8 are licensed and made available under the terms and conditions of the BSD License\r
9 which accompanies this distribution. The full text of the license may be found at\r
10 http://opensource.org/licenses/bsd-license.php\r
11\r
12 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
13 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
14**/\r
15\r
16#ifndef __TLS_1_H__\r
17#define __TLS_1_H__\r
18\r
19#pragma pack(1)\r
20\r
21///\r
22/// TLS Cipher Suite, refers to A.5 of rfc-2246, rfc-4346 and rfc-5246.\r
23///\r
24#define TLS_RSA_WITH_NULL_MD5 {0x00, 0x01}\r
25#define TLS_RSA_WITH_NULL_SHA {0x00, 0x02}\r
26#define TLS_RSA_WITH_RC4_128_MD5 {0x00, 0x04}\r
27#define TLS_RSA_WITH_RC4_128_SHA {0x00, 0x05}\r
28#define TLS_RSA_WITH_IDEA_CBC_SHA {0x00, 0x07}\r
29#define TLS_RSA_WITH_DES_CBC_SHA {0x00, 0x09}\r
30#define TLS_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x0A}\r
31#define TLS_DH_DSS_WITH_DES_CBC_SHA {0x00, 0x0C}\r
32#define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA {0x00, 0x0D}\r
33#define TLS_DH_RSA_WITH_DES_CBC_SHA {0x00, 0x0F}\r
34#define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x10}\r
35#define TLS_DHE_DSS_WITH_DES_CBC_SHA {0x00, 0x12}\r
36#define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA {0x00, 0x13}\r
37#define TLS_DHE_RSA_WITH_DES_CBC_SHA {0x00, 0x15}\r
38#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x16}\r
39#define TLS_RSA_WITH_AES_128_CBC_SHA {0x00, 0x2F}\r
40#define TLS_DH_DSS_WITH_AES_128_CBC_SHA {0x00, 0x30}\r
41#define TLS_DH_RSA_WITH_AES_128_CBC_SHA {0x00, 0x31}\r
42#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA {0x00, 0x32}\r
43#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA {0x00, 0x33}\r
44#define TLS_RSA_WITH_AES_256_CBC_SHA {0x00, 0x35}\r
45#define TLS_DH_DSS_WITH_AES_256_CBC_SHA {0x00, 0x36}\r
46#define TLS_DH_RSA_WITH_AES_256_CBC_SHA {0x00, 0x37}\r
47#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA {0x00, 0x38}\r
48#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA {0x00, 0x39}\r
49#define TLS_RSA_WITH_NULL_SHA256 {0x00, 0x3B}\r
50#define TLS_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x3C}\r
51#define TLS_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x3D}\r
52#define TLS_DH_DSS_WITH_AES_128_CBC_SHA256 {0x00, 0x3E}\r
53#define TLS_DH_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x3F}\r
54#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 {0x00, 0x40}\r
55#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x67}\r
56#define TLS_DH_DSS_WITH_AES_256_CBC_SHA256 {0x00, 0x68}\r
57#define TLS_DH_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x69}\r
58#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 {0x00, 0x6A}\r
59#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x6B}\r
60\r
61///\r
62/// TLS Version, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
63///\r
64#define TLS10_PROTOCOL_VERSION_MAJOR 0x03\r
65#define TLS10_PROTOCOL_VERSION_MINOR 0x01\r
66#define TLS11_PROTOCOL_VERSION_MAJOR 0x03\r
67#define TLS11_PROTOCOL_VERSION_MINOR 0x02\r
68#define TLS12_PROTOCOL_VERSION_MAJOR 0x03\r
69#define TLS12_PROTOCOL_VERSION_MINOR 0x03\r
70\r
71///\r
72/// TLS Content Type, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
73///\r
74typedef enum {\r
75 TlsContentTypeChangeCipherSpec = 20,\r
76 TlsContentTypeAlert = 21,\r
77 TlsContentTypeHandshake = 22,\r
78 TlsContentTypeApplicationData = 23,\r
79} TLS_CONTENT_TYPE;\r
80\r
81///\r
82/// TLS Record Header, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
83///\r
84typedef struct {\r
85 UINT8 ContentType;\r
86 EFI_TLS_VERSION Version;\r
87 UINT16 Length;\r
88} TLS_RECORD_HEADER;\r
89\r
0469ed69
JW
90#define TLS_RECORD_HEADER_LENGTH 5\r
91\r
92//\r
93// The length (in bytes) of the TLSPlaintext records payload MUST NOT exceed 2^14.\r
9095d37b 94// Refers to section 6.2 of RFC5246.\r
0469ed69
JW
95//\r
96#define TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH 16384\r
97\r
98//\r
99// The length (in bytes) of the TLSCiphertext records payload MUST NOT exceed 2^14 + 2048.\r
9095d37b 100// Refers to section 6.2 of RFC5246.\r
0469ed69
JW
101//\r
102#define TLS_CIPHERTEXT_RECORD_MAX_PAYLOAD_LENGTH 18432\r
103\r
973f8862
HW
104#pragma pack()\r
105\r
106#endif\r
107\r