40 FIRMWARE_CONFIG_ITEM HttpsCaCertsItem;
41 UINTN HttpsCaCertsSize;
45 "etc/edk2/https/cacerts",
49 if (EFI_ERROR (Status)) {
52 "%a:%a: not touching CA cert list\n",
71 Status =
gRT->SetVariable (
72 EFI_TLS_CA_CERTIFICATE_VARIABLE,
73 &gEfiTlsCaCertificateGuid,
78 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
84 "%a:%a: failed to delete %g:\"%s\"\n",
87 &gEfiTlsCaCertificateGuid,
88 EFI_TLS_CA_CERTIFICATE_VARIABLE
94 if (HttpsCaCertsSize == 0) {
97 "%a:%a: applied empty CA cert list\n",
105 if (HttpsCaCerts ==
NULL) {
108 "%a:%a: failed to allocate HttpsCaCerts\n",
118 Status =
gRT->SetVariable (
119 EFI_TLS_CA_CERTIFICATE_VARIABLE,
120 &gEfiTlsCaCertificateGuid,
121 EFI_VARIABLE_BOOTSERVICE_ACCESS,
125 if (EFI_ERROR (Status)) {
128 "%a:%a: failed to set %g:\"%s\": %r\n",
131 &gEfiTlsCaCertificateGuid,
132 EFI_TLS_CA_CERTIFICATE_VARIABLE,
135 goto FreeHttpsCaCerts;
140 "%a:%a: stored CA cert list (%Lu byte(s))\n",
143 (UINT64)HttpsCaCertsSize
165 FIRMWARE_CONFIG_ITEM HttpsCiphersItem;
166 UINTN HttpsCiphersSize;
170 "etc/edk2/https/ciphers",
174 if (EFI_ERROR (Status)) {
177 "%a:%a: not touching cipher suites\n",
195 Status =
gRT->SetVariable (
196 EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE,
197 &gEdkiiHttpTlsCipherListGuid,
202 if (EFI_ERROR (Status) && (Status != EFI_NOT_FOUND)) {
205 "%a:%a: failed to delete %g:\"%s\"\n",
208 &gEdkiiHttpTlsCipherListGuid,
209 EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE
214 if (HttpsCiphersSize == 0) {
217 "%a:%a: list of cipher suites must not be empty\n",
221 Status = EFI_INVALID_PARAMETER;
226 if (HttpsCiphers ==
NULL) {
229 "%a:%a: failed to allocate HttpsCiphers\n",
233 Status = EFI_OUT_OF_RESOURCES;
240 Status =
gRT->SetVariable (
241 EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE,
242 &gEdkiiHttpTlsCipherListGuid,
243 EFI_VARIABLE_BOOTSERVICE_ACCESS,
247 if (EFI_ERROR (Status)) {
250 "%a:%a: failed to set %g:\"%s\"\n",
253 &gEdkiiHttpTlsCipherListGuid,
254 EDKII_HTTP_TLS_CIPHER_LIST_VARIABLE
256 goto FreeHttpsCiphers;
261 "%a:%a: stored list of cipher suites (%Lu byte(s))\n",
264 (UINT64)HttpsCiphersSize
271 if (EFI_ERROR (Status)) {
VOID EFIAPI CpuDeadLoop(VOID)
VOID EFIAPI FreePool(IN VOID *Buffer)
EFI_RUNTIME_SERVICES * gRT
#define ASSERT_EFI_ERROR(StatusParameter)
#define DEBUG(Expression)
VOID *EFIAPI AllocatePool(IN UINTN AllocationSize)
RETURN_STATUS EFIAPI QemuFwCfgFindFile(IN CONST CHAR8 *Name, OUT FIRMWARE_CONFIG_ITEM *Item, OUT UINTN *Size)
VOID EFIAPI QemuFwCfgReadBytes(IN UINTN Size, IN VOID *Buffer OPTIONAL)
VOID EFIAPI QemuFwCfgSelectItem(IN FIRMWARE_CONFIG_ITEM QemuFwCfgItem)
STATIC VOID SetCaCerts(VOID)
STATIC VOID SetCipherSuites(VOID)