2 EFI TLS Configuration Protocol as defined in UEFI 2.5.
3 The EFI TLS Configuration Protocol provides a way to set and get TLS configuration.
5 Copyright (c) 2016, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 @par Revision Reference:
15 This Protocol is introduced in UEFI Specification 2.5
18 #ifndef __EFI_TLS_CONFIGURATION_PROTOCOL_H__
19 #define __EFI_TLS_CONFIGURATION_PROTOCOL_H__
22 /// The EFI Configuration protocol provides a way to set and get TLS configuration.
24 #define EFI_TLS_CONFIGURATION_PROTOCOL_GUID \
26 0x1682fe44, 0xbd7a, 0x4407, { 0xb7, 0xc7, 0xdc, 0xa3, 0x7c, 0xa3, 0x92, 0x2d } \
29 typedef struct _EFI_TLS_CONFIGURATION_PROTOCOL EFI_TLS_CONFIGURATION_PROTOCOL
;
32 /// EFI_TLS_CONFIG_DATA_TYPE
36 /// Local host configuration data: public certificate data.
37 /// This data should be DER-encoded binary X.509 certificate
38 /// or PEM-encoded X.509 certificate.
40 EfiTlsConfigDataTypeHostPublicCert
,
42 /// Local host configuration data: private key data.
44 EfiTlsConfigDataTypeHostPrivateKey
,
46 /// CA certificate to verify peer. This data should be PEM-encoded
47 /// RSA or PKCS#8 private key.
49 EfiTlsConfigDataTypeCACertificate
,
51 /// CA-supplied Certificate Revocation List data. This data should
52 /// be DER-encoded CRL data.
54 EfiTlsConfigDataTypeCertRevocationList
,
56 EfiTlsConfigDataTypeMaximum
58 } EFI_TLS_CONFIG_DATA_TYPE
;
61 Set TLS configuration data.
63 The SetData() function sets TLS configuration to non-volatile storage or volatile
66 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
67 @param[in] DataType Configuration data type.
68 @param[in] Data Pointer to configuration data.
69 @param[in] DataSize Total size of configuration data.
71 @retval EFI_SUCCESS The TLS configuration data is set successfully.
72 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
76 @retval EFI_UNSUPPORTED The DataType is unsupported.
77 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
82 (EFIAPI
*EFI_TLS_CONFIGURATION_SET_DATA
)(
83 IN EFI_TLS_CONFIGURATION_PROTOCOL
*This
,
84 IN EFI_TLS_CONFIG_DATA_TYPE DataType
,
90 Get TLS configuration data.
92 The GetData() function gets TLS configuration.
94 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
95 @param[in] DataType Configuration data type.
96 @param[in, out] Data Pointer to configuration data.
97 @param[in, out] DataSize Total size of configuration data. On input, it means
98 the size of Data buffer. On output, it means the size
99 of copied Data buffer if EFI_SUCCESS, and means the
100 size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
102 @retval EFI_SUCCESS The TLS configuration data is got successfully.
103 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
106 Data is NULL if *DataSize is not zero.
107 @retval EFI_UNSUPPORTED The DataType is unsupported.
108 @retval EFI_NOT_FOUND The TLS configuration data is not found.
109 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the data.
114 (EFIAPI
*EFI_TLS_CONFIGURATION_GET_DATA
)(
115 IN EFI_TLS_CONFIGURATION_PROTOCOL
*This
,
116 IN EFI_TLS_CONFIG_DATA_TYPE DataType
,
117 IN OUT VOID
*Data
, OPTIONAL
118 IN OUT UINTN
*DataSize
122 /// The EFI_TLS_CONFIGURATION_PROTOCOL is designed to provide a way to set and get
123 /// TLS configuration, such as Certificate, private key data.
125 struct _EFI_TLS_CONFIGURATION_PROTOCOL
{
126 EFI_TLS_CONFIGURATION_SET_DATA SetData
;
127 EFI_TLS_CONFIGURATION_GET_DATA GetData
;
130 extern EFI_GUID gEfiTlsConfigurationProtocolGuid
;
132 #endif //__EFI_TLS_CONFIGURATION_PROTOCOL_H__