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 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.5
12 #ifndef __EFI_TLS_CONFIGURATION_PROTOCOL_H__
13 #define __EFI_TLS_CONFIGURATION_PROTOCOL_H__
16 /// The EFI Configuration protocol provides a way to set and get TLS configuration.
18 #define EFI_TLS_CONFIGURATION_PROTOCOL_GUID \
20 0x1682fe44, 0xbd7a, 0x4407, { 0xb7, 0xc7, 0xdc, 0xa3, 0x7c, 0xa3, 0x92, 0x2d } \
23 typedef struct _EFI_TLS_CONFIGURATION_PROTOCOL EFI_TLS_CONFIGURATION_PROTOCOL
;
26 /// EFI_TLS_CONFIG_DATA_TYPE
30 /// Local host configuration data: public certificate data.
31 /// This data should be DER-encoded binary X.509 certificate
32 /// or PEM-encoded X.509 certificate.
34 EfiTlsConfigDataTypeHostPublicCert
,
36 /// Local host configuration data: private key data.
38 EfiTlsConfigDataTypeHostPrivateKey
,
40 /// CA certificate to verify peer. This data should be PEM-encoded
41 /// RSA or PKCS#8 private key.
43 EfiTlsConfigDataTypeCACertificate
,
45 /// CA-supplied Certificate Revocation List data. This data should
46 /// be DER-encoded CRL data.
48 EfiTlsConfigDataTypeCertRevocationList
,
50 EfiTlsConfigDataTypeMaximum
52 } EFI_TLS_CONFIG_DATA_TYPE
;
55 Set TLS configuration data.
57 The SetData() function sets TLS configuration to non-volatile storage or volatile
60 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
61 @param[in] DataType Configuration data type.
62 @param[in] Data Pointer to configuration data.
63 @param[in] DataSize Total size of configuration data.
65 @retval EFI_SUCCESS The TLS configuration data is set successfully.
66 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
70 @retval EFI_UNSUPPORTED The DataType is unsupported.
71 @retval EFI_OUT_OF_RESOURCES Required system resources could not be allocated.
76 (EFIAPI
*EFI_TLS_CONFIGURATION_SET_DATA
)(
77 IN EFI_TLS_CONFIGURATION_PROTOCOL
*This
,
78 IN EFI_TLS_CONFIG_DATA_TYPE DataType
,
84 Get TLS configuration data.
86 The GetData() function gets TLS configuration.
88 @param[in] This Pointer to the EFI_TLS_CONFIGURATION_PROTOCOL instance.
89 @param[in] DataType Configuration data type.
90 @param[in, out] Data Pointer to configuration data.
91 @param[in, out] DataSize Total size of configuration data. On input, it means
92 the size of Data buffer. On output, it means the size
93 of copied Data buffer if EFI_SUCCESS, and means the
94 size of desired Data buffer if EFI_BUFFER_TOO_SMALL.
96 @retval EFI_SUCCESS The TLS configuration data is got successfully.
97 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
100 Data is NULL if *DataSize is not zero.
101 @retval EFI_UNSUPPORTED The DataType is unsupported.
102 @retval EFI_NOT_FOUND The TLS configuration data is not found.
103 @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the data.
108 (EFIAPI
*EFI_TLS_CONFIGURATION_GET_DATA
)(
109 IN EFI_TLS_CONFIGURATION_PROTOCOL
*This
,
110 IN EFI_TLS_CONFIG_DATA_TYPE DataType
,
111 IN OUT VOID
*Data
, OPTIONAL
112 IN OUT UINTN
*DataSize
116 /// The EFI_TLS_CONFIGURATION_PROTOCOL is designed to provide a way to set and get
117 /// TLS configuration, such as Certificate, private key data.
119 struct _EFI_TLS_CONFIGURATION_PROTOCOL
{
120 EFI_TLS_CONFIGURATION_SET_DATA SetData
;
121 EFI_TLS_CONFIGURATION_GET_DATA GetData
;
124 extern EFI_GUID gEfiTlsConfigurationProtocolGuid
;
126 #endif //__EFI_TLS_CONFIGURATION_PROTOCOL_H__