TianoCore EDK2 master
|
Go to the source code of this file.
Macros | |
#define | HTTPS_DEFAULT_PORT 443 |
#define | HTTPS_FLAG "https://" |
The header files of miscellaneous routines specific to Https for HttpDxe driver.
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file HttpsSupport.h.
#define HTTPS_DEFAULT_PORT 443 |
Definition at line 13 of file HttpsSupport.h.
#define HTTPS_FLAG "https://" |
Definition at line 15 of file HttpsSupport.h.
EFI_STATUS EFIAPI HttpsReceive | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN OUT NET_FRAGMENT * | Fragment, | ||
IN EFI_EVENT | Timeout | ||
) |
Receive one fragment decrypted from one TLS record.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[in,out] | Fragment | The received Fragment. |
[in] | Timeout | The time to wait for connection done. |
EFI_SUCCESS | One fragment is received. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_ABORTED | Something wrong decryption the message. |
Others | Other errors as indicated. |
Definition at line 1665 of file HttpsSupport.c.
BOOLEAN IsHttpsUrl | ( | IN CHAR8 * | Url | ) |
Check whether the Url is from Https.
[in] | Url | The pointer to a HTTP or HTTPS URL string. |
TRUE | The Url is from HTTPS. |
FALSE | The Url is from HTTP. |
Definition at line 119 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsCloseSession | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Close the TLS session and send out the close notification message.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TLS session is closed. |
EFI_INVALID_PARAMETER | HttpInstance is NULL or Packet is NULL. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
Others | Other error as indicated. |
Close the TLS session and send out the close notification message.
[in] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | The TLS session is closed. |
EFI_INVALID_PARAMETER | HttpInstance is NULL. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
Others | Other error as indicated. |
Definition at line 1426 of file HttpsSupport.c.
VOID EFIAPI TlsCloseTxRxEvent | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Close events in the TlsTxToken and TlsRxToken.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
Definition at line 344 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsCommonReceive | ( | IN OUT HTTP_PROTOCOL * | HttpInstance, |
IN NET_BUF * | Packet, | ||
IN EFI_EVENT | Timeout | ||
) |
Receive the Packet by processing the associated HTTPS token.
[in,out] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[in] | Packet | The packet to transmit. |
[in] | Timeout | The time to wait for connection done. |
EFI_SUCCESS | The Packet is received. |
EFI_INVALID_PARAMETER | HttpInstance is NULL or Packet is NULL. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_TIMEOUT | The operation is time out. |
Others | Other error as indicated. |
Definition at line 891 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsCommonTransmit | ( | IN OUT HTTP_PROTOCOL * | HttpInstance, |
IN NET_BUF * | Packet | ||
) |
Transmit the Packet by processing the associated HTTPS token.
[in,out] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[in] | Packet | The packet to transmit. |
EFI_SUCCESS | The packet is transmitted. |
EFI_INVALID_PARAMETER | HttpInstance is NULL or Packet is NULL. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_DEVICE_ERROR | An unexpected system or network error occurred. |
Others | Other errors as indicated. |
Definition at line 773 of file HttpsSupport.c.
EFI_STATUS TlsConfigCertificate | ( | IN OUT HTTP_PROTOCOL * | HttpInstance | ) |
Read the TlsCaCertificate variable and configure it.
[in,out] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | TlsCaCertificate is configured. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_NOT_FOUND | Fail to get "TlsCaCertificate" variable. |
Others | Other error as indicated. |
Read the TlsCaCertificate variable and configure it.
[in,out] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | TlsCaCertificate is configured. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_NOT_FOUND | Fail to get 'TlsCaCertificate' variable. |
Others | Other error as indicated. |
Definition at line 384 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsConfigureSession | ( | IN OUT HTTP_PROTOCOL * | HttpInstance | ) |
Configure TLS session data.
[in,out] | HttpInstance | The HTTP instance private data. |
EFI_SUCCESS | TLS session data is configured. |
Others | Other error as indicated. |
Definition at line 650 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsConnectSession | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN EFI_EVENT | Timeout | ||
) |
Connect one TLS session by finishing the TLS handshake process.
[in] | HttpInstance | The HTTP instance private data. |
[in] | Timeout | The time to wait for connection done. |
EFI_SUCCESS | The TLS session is established. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_ABORTED | TLS session state is incorrect. |
Others | Other error as indicated. |
Definition at line 1174 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsCreateChild | ( | IN HTTP_PROTOCOL * | HttpInstance | ) |
Creates a Tls child handle, open EFI_TLS_PROTOCOL and EFI_TLS_CONFIGURATION_PROTOCOL.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
Definition at line 148 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsCreateTxRxEvent | ( | IN OUT HTTP_PROTOCOL * | HttpInstance | ) |
Create event for the TLS receive and transmit tokens which are used to receive and transmit TLS related messages.
[in,out] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
EFI_SUCCESS | The events are created successfully. |
others | Other error as indicated. |
Definition at line 229 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsProcessMessage | ( | IN HTTP_PROTOCOL * | HttpInstance, |
IN UINT8 * | Message, | ||
IN UINTN | MessageSize, | ||
IN EFI_TLS_CRYPT_MODE | ProcessMode, | ||
IN OUT NET_FRAGMENT * | Fragment | ||
) |
Process one message according to the CryptMode.
[in] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[in] | Message | Pointer to the message buffer needed to processed. If ProcessMode is EfiTlsEncrypt, the message contain the TLS header and plain text TLS APP payload. If ProcessMode is EfiTlsDecrypt, the message contain the TLS header and cipher text TLS APP payload. |
[in] | MessageSize | Pointer to the message buffer size. |
[in] | ProcessMode | Process mode. |
[in,out] | Fragment | Only one Fragment returned after the Message is processed successfully. If ProcessMode is EfiTlsEncrypt, the fragment contain the TLS header and cipher text TLS APP payload. If ProcessMode is EfiTlsDecrypt, the fragment contain the TLS header and plain text TLS APP payload. |
EFI_SUCCESS | Message is processed successfully. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
Others | Other errors as indicated. |
Definition at line 1537 of file HttpsSupport.c.
EFI_STATUS EFIAPI TlsReceiveOnePdu | ( | IN OUT HTTP_PROTOCOL * | HttpInstance, |
OUT NET_BUF ** | Pdu, | ||
IN EFI_EVENT | Timeout | ||
) |
Receive one TLS PDU. An TLS PDU contains an TLS record header and its corresponding record data. These two parts will be put into two blocks of buffers in the net buffer.
[in,out] | HttpInstance | Pointer to HTTP_PROTOCOL structure. |
[out] | Pdu | The received TLS PDU. |
[in] | Timeout | The time to wait for connection done. |
EFI_SUCCESS | An TLS PDU is received. |
EFI_OUT_OF_RESOURCES | Can't allocate memory resources. |
EFI_PROTOCOL_ERROR | An unexpected TLS packet was received. |
Others | Other errors as indicated. |
Major versions are same.
Definition at line 1039 of file HttpsSupport.c.