]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/TlsConfig.h
MdePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdePkg / Include / Protocol / TlsConfig.h
CommitLineData
973f8862
HW
1/** @file\r
2 EFI TLS Configuration Protocol as defined in UEFI 2.5.\r
3 The EFI TLS Configuration Protocol provides a way to set and get TLS configuration.\r
4\r
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>\r
9344f092 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
973f8862
HW
7\r
8 @par Revision Reference:\r
9 This Protocol is introduced in UEFI Specification 2.5\r
10\r
11**/\r
12#ifndef __EFI_TLS_CONFIGURATION_PROTOCOL_H__\r
13#define __EFI_TLS_CONFIGURATION_PROTOCOL_H__\r
14\r
15///\r
16/// The EFI Configuration protocol provides a way to set and get TLS configuration.\r
17///\r
18#define EFI_TLS_CONFIGURATION_PROTOCOL_GUID \\r
19 { \\r
20 0x1682fe44, 0xbd7a, 0x4407, { 0xb7, 0xc7, 0xdc, 0xa3, 0x7c, 0xa3, 0x92, 0x2d } \\r
21 }\r
22\r
23typedef struct _EFI_TLS_CONFIGURATION_PROTOCOL EFI_TLS_CONFIGURATION_PROTOCOL;\r
24\r
25///\r
26/// EFI_TLS_CONFIG_DATA_TYPE\r
27///\r
28typedef enum {\r
29 ///\r
30 /// Local host configuration data: public certificate data.\r
31 /// This data should be DER-encoded binary X.509 certificate\r
32 /// or PEM-encoded X.509 certificate.\r
33 ///\r
34 EfiTlsConfigDataTypeHostPublicCert,\r
35 ///\r
36 /// Local host configuration data: private key data.\r
37 ///\r
38 EfiTlsConfigDataTypeHostPrivateKey,\r
39 ///\r
40 /// CA certificate to verify peer. This data should be PEM-encoded\r
41 /// RSA or PKCS#8 private key.\r
42 ///\r
43 EfiTlsConfigDataTypeCACertificate,\r
44 ///\r
45 /// CA-supplied Certificate Revocation List data. This data should\r
46 /// be DER-encoded CRL data.\r
47 ///\r
48 EfiTlsConfigDataTypeCertRevocationList,\r
49\r
50 EfiTlsConfigDataTypeMaximum\r
51\r
52} EFI_TLS_CONFIG_DATA_TYPE;\r
53\r
54/**\r
55 Set TLS configuration data.\r
56\r
57 The SetData() function sets TLS configuration to non-volatile storage or volatile\r
58 storage.\r
59\r
60 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
61 @param[in] DataType Configuration data type.\r
62 @param[in] Data Pointer to configuration data.\r
63 @param[in] DataSize Total size of configuration data.\r
64\r
65 @retval EFI_SUCCESS The TLS configuration data is set successfully.\r
66 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
67 This is NULL.\r
68 Data is NULL.\r
69 DataSize is 0.\r
70 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
71 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.\r
72\r
73**/\r
74typedef\r
75EFI_STATUS\r
76(EFIAPI *EFI_TLS_CONFIGURATION_SET_DATA)(\r
77 IN EFI_TLS_CONFIGURATION_PROTOCOL *This,\r
78 IN EFI_TLS_CONFIG_DATA_TYPE DataType,\r
79 IN VOID *Data,\r
80 IN UINTN DataSize\r
81 );\r
82\r
83/**\r
84 Get TLS configuration data.\r
85\r
86 The GetData() function gets TLS configuration.\r
87\r
88 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.\r
89 @param[in] DataType Configuration data type.\r
90 @param[in, out] Data Pointer to configuration data.\r
91 @param[in, out] DataSize Total size of configuration data. On input, it means\r
92 the size of Data buffer. On output, it means the size\r
93 of copied Data buffer if EFI_SUCCESS, and means the\r
94 size of desired Data buffer if EFI_BUFFER_TOO_SMALL.\r
95\r
96 @retval EFI_SUCCESS The TLS configuration data is got successfully.\r
97 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
98 This is NULL.\r
99 DataSize is NULL.\r
100 Data is NULL if *DataSize is not zero.\r
101 @retval EFI_UNSUPPORTED The DataType is unsupported.\r
102 @retval EFI_NOT_FOUND The TLS configuration data is not found.\r
103 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the data.\r
104\r
105**/\r
106typedef\r
107EFI_STATUS\r
108(EFIAPI *EFI_TLS_CONFIGURATION_GET_DATA)(\r
109 IN EFI_TLS_CONFIGURATION_PROTOCOL *This,\r
110 IN EFI_TLS_CONFIG_DATA_TYPE DataType,\r
111 IN OUT VOID *Data, OPTIONAL\r
112 IN OUT UINTN *DataSize\r
113 );\r
114\r
115///\r
116/// The EFI_TLS_CONFIGURATION_PROTOCOL is designed to provide a way to set and get\r
117/// TLS configuration, such as Certificate, private key data.\r
118///\r
119struct _EFI_TLS_CONFIGURATION_PROTOCOL {\r
120 EFI_TLS_CONFIGURATION_SET_DATA SetData;\r
121 EFI_TLS_CONFIGURATION_GET_DATA GetData;\r
122};\r
123\r
124extern EFI_GUID gEfiTlsConfigurationProtocolGuid;\r
125\r
126#endif //__EFI_TLS_CONFIGURATION_PROTOCOL_H__\r
127\r