]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/IndustryStandard/Tls1.h
MdePkg/PiFirmwareFile: fix undefined behavior in FFS_FILE_SIZE
[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
9344f092 7 SPDX-License-Identifier: BSD-2-Clause-Patent\r
973f8862
HW
8**/\r
9\r
10#ifndef __TLS_1_H__\r
11#define __TLS_1_H__\r
12\r
13#pragma pack(1)\r
14\r
15///\r
16/// TLS Cipher Suite, refers to A.5 of rfc-2246, rfc-4346 and rfc-5246.\r
17///\r
18#define TLS_RSA_WITH_NULL_MD5 {0x00, 0x01}\r
19#define TLS_RSA_WITH_NULL_SHA {0x00, 0x02}\r
20#define TLS_RSA_WITH_RC4_128_MD5 {0x00, 0x04}\r
21#define TLS_RSA_WITH_RC4_128_SHA {0x00, 0x05}\r
22#define TLS_RSA_WITH_IDEA_CBC_SHA {0x00, 0x07}\r
23#define TLS_RSA_WITH_DES_CBC_SHA {0x00, 0x09}\r
24#define TLS_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x0A}\r
25#define TLS_DH_DSS_WITH_DES_CBC_SHA {0x00, 0x0C}\r
26#define TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA {0x00, 0x0D}\r
27#define TLS_DH_RSA_WITH_DES_CBC_SHA {0x00, 0x0F}\r
28#define TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x10}\r
29#define TLS_DHE_DSS_WITH_DES_CBC_SHA {0x00, 0x12}\r
30#define TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA {0x00, 0x13}\r
31#define TLS_DHE_RSA_WITH_DES_CBC_SHA {0x00, 0x15}\r
32#define TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA {0x00, 0x16}\r
33#define TLS_RSA_WITH_AES_128_CBC_SHA {0x00, 0x2F}\r
34#define TLS_DH_DSS_WITH_AES_128_CBC_SHA {0x00, 0x30}\r
35#define TLS_DH_RSA_WITH_AES_128_CBC_SHA {0x00, 0x31}\r
36#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA {0x00, 0x32}\r
37#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA {0x00, 0x33}\r
38#define TLS_RSA_WITH_AES_256_CBC_SHA {0x00, 0x35}\r
39#define TLS_DH_DSS_WITH_AES_256_CBC_SHA {0x00, 0x36}\r
40#define TLS_DH_RSA_WITH_AES_256_CBC_SHA {0x00, 0x37}\r
41#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA {0x00, 0x38}\r
42#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA {0x00, 0x39}\r
43#define TLS_RSA_WITH_NULL_SHA256 {0x00, 0x3B}\r
44#define TLS_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x3C}\r
45#define TLS_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x3D}\r
46#define TLS_DH_DSS_WITH_AES_128_CBC_SHA256 {0x00, 0x3E}\r
47#define TLS_DH_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x3F}\r
48#define TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 {0x00, 0x40}\r
49#define TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 {0x00, 0x67}\r
50#define TLS_DH_DSS_WITH_AES_256_CBC_SHA256 {0x00, 0x68}\r
51#define TLS_DH_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x69}\r
52#define TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 {0x00, 0x6A}\r
53#define TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 {0x00, 0x6B}\r
54\r
55///\r
56/// TLS Version, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
57///\r
58#define TLS10_PROTOCOL_VERSION_MAJOR 0x03\r
59#define TLS10_PROTOCOL_VERSION_MINOR 0x01\r
60#define TLS11_PROTOCOL_VERSION_MAJOR 0x03\r
61#define TLS11_PROTOCOL_VERSION_MINOR 0x02\r
62#define TLS12_PROTOCOL_VERSION_MAJOR 0x03\r
63#define TLS12_PROTOCOL_VERSION_MINOR 0x03\r
64\r
65///\r
66/// TLS Content Type, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
67///\r
68typedef enum {\r
69 TlsContentTypeChangeCipherSpec = 20,\r
70 TlsContentTypeAlert = 21,\r
71 TlsContentTypeHandshake = 22,\r
72 TlsContentTypeApplicationData = 23,\r
73} TLS_CONTENT_TYPE;\r
74\r
75///\r
76/// TLS Record Header, refers to A.1 of rfc-2246, rfc-4346 and rfc-5246.\r
77///\r
78typedef struct {\r
79 UINT8 ContentType;\r
80 EFI_TLS_VERSION Version;\r
81 UINT16 Length;\r
82} TLS_RECORD_HEADER;\r
83\r
0469ed69
JW
84#define TLS_RECORD_HEADER_LENGTH 5\r
85\r
86//\r
87// The length (in bytes) of the TLSPlaintext records payload MUST NOT exceed 2^14.\r
9095d37b 88// Refers to section 6.2 of RFC5246.\r
0469ed69
JW
89//\r
90#define TLS_PLAINTEXT_RECORD_MAX_PAYLOAD_LENGTH 16384\r
91\r
92//\r
93// The length (in bytes) of the TLSCiphertext records payload MUST NOT exceed 2^14 + 2048.\r
9095d37b 94// Refers to section 6.2 of RFC5246.\r
0469ed69
JW
95//\r
96#define TLS_CIPHERTEXT_RECORD_MAX_PAYLOAD_LENGTH 18432\r
97\r
973f8862
HW
98#pragma pack()\r
99\r
100#endif\r
101\r