CryptoPkg[all]  0.98
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
TlsLib.h File Reference

Functions

BOOLEAN EFIAPI TlsInitialize (VOID)
 
VOID EFIAPI TlsCtxFree (IN VOID *TlsCtx)
 
VOID *EFIAPI TlsCtxNew (IN UINT8 MajorVer, IN UINT8 MinorVer)
 
VOID EFIAPI TlsFree (IN VOID *Tls)
 
VOID *EFIAPI TlsNew (IN VOID *TlsCtx)
 
BOOLEAN EFIAPI TlsInHandshake (IN VOID *Tls)
 
EFI_STATUS EFIAPI TlsDoHandshake (IN VOID *Tls, IN UINT8 *BufferIn, IN UINTN BufferInSize, OUT UINT8 *BufferOut, IN OUT UINTN *BufferOutSize)
 
EFI_STATUS EFIAPI TlsHandleAlert (IN VOID *Tls, IN UINT8 *BufferIn, IN UINTN BufferInSize, OUT UINT8 *BufferOut, IN OUT UINTN *BufferOutSize)
 
EFI_STATUS EFIAPI TlsCloseNotify (IN VOID *Tls, IN OUT UINT8 *Buffer, IN OUT UINTN *BufferSize)
 
INTN EFIAPI TlsCtrlTrafficOut (IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
 
INTN EFIAPI TlsCtrlTrafficIn (IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
 
INTN EFIAPI TlsRead (IN VOID *Tls, IN OUT VOID *Buffer, IN UINTN BufferSize)
 
INTN EFIAPI TlsWrite (IN VOID *Tls, IN VOID *Buffer, IN UINTN BufferSize)
 
EFI_STATUS EFIAPI TlsSetVersion (IN VOID *Tls, IN UINT8 MajorVer, IN UINT8 MinorVer)
 
EFI_STATUS EFIAPI TlsSetConnectionEnd (IN VOID *Tls, IN BOOLEAN IsServer)
 
EFI_STATUS EFIAPI TlsSetCipherList (IN VOID *Tls, IN UINT16 *CipherId, IN UINTN CipherNum)
 
EFI_STATUS EFIAPI TlsSetCompressionMethod (IN UINT8 CompMethod)
 
VOID EFIAPI TlsSetVerify (IN VOID *Tls, IN UINT32 VerifyMode)
 
EFI_STATUS EFIAPI TlsSetVerifyHost (IN VOID *Tls, IN UINT32 Flags, IN CHAR8 *HostName)
 
EFI_STATUS EFIAPI TlsSetSessionId (IN VOID *Tls, IN UINT8 *SessionId, IN UINT16 SessionIdLen)
 
EFI_STATUS EFIAPI TlsSetCaCertificate (IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetHostPublicCert (IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetHostPrivateKey (IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetCertRevocationList (IN VOID *Data, IN UINTN DataSize)
 
UINT16 EFIAPI TlsGetVersion (IN VOID *Tls)
 
UINT8 EFIAPI TlsGetConnectionEnd (IN VOID *Tls)
 
EFI_STATUS EFIAPI TlsGetCurrentCipher (IN VOID *Tls, IN OUT UINT16 *CipherId)
 
EFI_STATUS EFIAPI TlsGetCurrentCompressionId (IN VOID *Tls, IN OUT UINT8 *CompressionId)
 
UINT32 EFIAPI TlsGetVerify (IN VOID *Tls)
 
EFI_STATUS EFIAPI TlsGetSessionId (IN VOID *Tls, IN OUT UINT8 *SessionId, IN OUT UINT16 *SessionIdLen)
 
VOID EFIAPI TlsGetClientRandom (IN VOID *Tls, IN OUT UINT8 *ClientRandom)
 
VOID EFIAPI TlsGetServerRandom (IN VOID *Tls, IN OUT UINT8 *ServerRandom)
 
EFI_STATUS EFIAPI TlsGetKeyMaterial (IN VOID *Tls, IN OUT UINT8 *KeyMaterial)
 
EFI_STATUS EFIAPI TlsGetCaCertificate (IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
 
EFI_STATUS EFIAPI TlsGetHostPublicCert (IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
 
EFI_STATUS EFIAPI TlsGetHostPrivateKey (IN VOID *Tls, OUT VOID *Data, IN OUT UINTN *DataSize)
 
EFI_STATUS EFIAPI TlsGetCertRevocationList (OUT VOID *Data, IN OUT UINTN *DataSize)
 

Detailed Description

Defines TLS Library APIs.

Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Function Documentation

EFI_STATUS EFIAPI TlsCloseNotify ( IN VOID *  Tls,
IN OUT UINT8 *  Buffer,
IN OUT UINTN *  BufferSize 
)

Build the CloseNotify packet.

Parameters
[in]TlsPointer to the TLS object for state checking.
[in,out]BufferPointer to the buffer to hold the built packet.
[in,out]BufferSizePointer to the buffer size in bytes. On input, it is the buffer size provided by the caller. On output, it is the buffer size in fact needed to contain the packet.
Return values
EFI_SUCCESSThe required TLS packet is built successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: Tls is NULL. BufferSize is NULL. Buffer is NULL if *BufferSize is not zero.
EFI_BUFFER_TOO_SMALLBufferSize is too small to hold the response packet.
INTN EFIAPI TlsCtrlTrafficIn ( IN VOID *  Tls,
IN VOID *  Buffer,
IN UINTN  BufferSize 
)

Attempts to write data from the buffer to TLS object.

This function will attempt to write BufferSize bytes data from the Buffer to the TLS object.

Parameters
[in]TlsPointer to the TLS object.
[in]BufferPointer to the data buffer.
[in]BufferSizeThe size of Buffer in bytes.
Return values
>0The amount of data successfully written to the TLS object.
<=0No data was successfully written.
INTN EFIAPI TlsCtrlTrafficOut ( IN VOID *  Tls,
IN OUT VOID *  Buffer,
IN UINTN  BufferSize 
)

Attempts to read bytes from one TLS object and places the data in Buffer.

This function will attempt to read BufferSize bytes from the TLS object and places the data in Buffer.

Parameters
[in]TlsPointer to the TLS object.
[in,out]BufferPointer to the buffer to store the data.
[in]BufferSizeThe size of Buffer in bytes.
Return values
>0The amount of data successfully read from the TLS object.
<=0No data was successfully read.
VOID EFIAPI TlsCtxFree ( IN VOID *  TlsCtx)

Free an allocated SSL_CTX object.

Parameters
[in]TlsCtxPointer to the SSL_CTX object to be released.
VOID* EFIAPI TlsCtxNew ( IN UINT8  MajorVer,
IN UINT8  MinorVer 
)

Creates a new SSL_CTX object as framework to establish TLS/SSL enabled connections.

Parameters
[in]MajorVerMajor Version of TLS/SSL Protocol.
[in]MinorVerMinor Version of TLS/SSL Protocol.
Returns
Pointer to an allocated SSL_CTX object. If the creation failed, TlsCtxNew() returns NULL.
EFI_STATUS EFIAPI TlsDoHandshake ( IN VOID *  Tls,
IN UINT8 *  BufferIn,
IN UINTN  BufferInSize,
OUT UINT8 *  BufferOut,
IN OUT UINTN *  BufferOutSize 
)

Perform a TLS/SSL handshake.

This function will perform a TLS/SSL handshake.

Parameters
[in]TlsPointer to the TLS object for handshake operation.
[in]BufferInPointer to the most recently received TLS Handshake packet.
[in]BufferInSizePacket size in bytes for the most recently received TLS Handshake packet.
[out]BufferOutPointer to the buffer to hold the built packet.
[in,out]BufferOutSizePointer to the buffer size in bytes. On input, it is the buffer size provided by the caller. On output, it is the buffer size in fact needed to contain the packet.
Return values
EFI_SUCCESSThe required TLS packet is built successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: Tls is NULL. BufferIn is NULL but BufferInSize is NOT 0. BufferInSize is 0 but BufferIn is NOT NULL. BufferOutSize is NULL. BufferOut is NULL if *BufferOutSize is not zero.
EFI_BUFFER_TOO_SMALLBufferOutSize is too small to hold the response packet.
EFI_ABORTEDSomething wrong during handshake.
VOID EFIAPI TlsFree ( IN VOID *  Tls)

Free an allocated TLS object.

This function removes the TLS object pointed to by Tls and frees up the allocated memory. If Tls is NULL, nothing is done.

Parameters
[in]TlsPointer to the TLS object to be freed.
EFI_STATUS EFIAPI TlsGetCaCertificate ( IN VOID *  Tls,
OUT VOID *  Data,
IN OUT UINTN *  DataSize 
)

Gets the CA Certificate from the cert store.

This function returns the CA certificate for the chosen TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[out]DataPointer to the data buffer to receive the CA certificate data sent to the client.
[in,out]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_BUFFER_TOO_SMALLThe Data is too small to hold the data.
EFI_STATUS EFIAPI TlsGetCertRevocationList ( OUT VOID *  Data,
IN OUT UINTN *  DataSize 
)

Gets the CA-supplied certificate revocation list data set in the specified TLS object.

This function returns the CA-supplied certificate revocation list data which was currently set in the specified TLS object.

Parameters
[out]DataPointer to the data buffer to receive the CRL data.
[in,out]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_BUFFER_TOO_SMALLThe Data is too small to hold the data.
VOID EFIAPI TlsGetClientRandom ( IN VOID *  Tls,
IN OUT UINT8 *  ClientRandom 
)

Gets the client random data used in the specified TLS connection.

This function returns the TLS/SSL client random data currently used in the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]ClientRandomBuffer to contain the returned client random data (32 bytes).
UINT8 EFIAPI TlsGetConnectionEnd ( IN VOID *  Tls)

Gets the connection end of the specified TLS connection.

This function returns the connection end (as client or as server) used by the specified TLS connection.

If Tls is NULL, then ASSERT().

Parameters
[in]TlsPointer to the TLS object.
Returns
The connection end used by the specified TLS connection.
EFI_STATUS EFIAPI TlsGetCurrentCipher ( IN VOID *  Tls,
IN OUT UINT16 *  CipherId 
)

Gets the cipher suite used by the specified TLS connection.

This function returns current cipher suite used by the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]CipherIdThe cipher suite used by the TLS object.
Return values
EFI_SUCCESSThe cipher suite was returned successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDUnsupported cipher suite.
EFI_STATUS EFIAPI TlsGetCurrentCompressionId ( IN VOID *  Tls,
IN OUT UINT8 *  CompressionId 
)

Gets the compression methods used by the specified TLS connection.

This function returns current integrated compression methods used by the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]CompressionIdThe current compression method used by the TLS object.
Return values
EFI_SUCCESSThe compression method was returned successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_ABORTEDInvalid Compression method.
EFI_UNSUPPORTEDThis function is not supported.
EFI_STATUS EFIAPI TlsGetHostPrivateKey ( IN VOID *  Tls,
OUT VOID *  Data,
IN OUT UINTN *  DataSize 
)

Gets the local private key set in the specified TLS object.

This function returns the local private key data which was currently set in the specified TLS object.

Parameters
[in]TlsPointer to the TLS object.
[out]DataPointer to the data buffer to receive the local private key data.
[in,out]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_BUFFER_TOO_SMALLThe Data is too small to hold the data.
EFI_STATUS EFIAPI TlsGetHostPublicCert ( IN VOID *  Tls,
OUT VOID *  Data,
IN OUT UINTN *  DataSize 
)

Gets the local public Certificate set in the specified TLS object.

This function returns the local public certificate which was currently set in the specified TLS object.

Parameters
[in]TlsPointer to the TLS object.
[out]DataPointer to the data buffer to receive the local public certificate.
[in,out]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_NOT_FOUNDThe certificate is not found.
EFI_BUFFER_TOO_SMALLThe Data is too small to hold the data.
EFI_STATUS EFIAPI TlsGetKeyMaterial ( IN VOID *  Tls,
IN OUT UINT8 *  KeyMaterial 
)

Gets the master key data used in the specified TLS connection.

This function returns the TLS/SSL master key material currently used in the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]KeyMaterialBuffer to contain the returned key material.
Return values
EFI_SUCCESSKey material was returned successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDInvalid TLS/SSL session.
VOID EFIAPI TlsGetServerRandom ( IN VOID *  Tls,
IN OUT UINT8 *  ServerRandom 
)

Gets the server random data used in the specified TLS connection.

This function returns the TLS/SSL server random data currently used in the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]ServerRandomBuffer to contain the returned server random data (32 bytes).
EFI_STATUS EFIAPI TlsGetSessionId ( IN VOID *  Tls,
IN OUT UINT8 *  SessionId,
IN OUT UINT16 *  SessionIdLen 
)

Gets the session ID used by the specified TLS connection.

This function returns the TLS/SSL session ID currently used by the specified TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in,out]SessionIdBuffer to contain the returned session ID.
[in,out]SessionIdLenThe length of Session ID in bytes.
Return values
EFI_SUCCESSThe Session ID was returned successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDInvalid TLS/SSL session.
UINT32 EFIAPI TlsGetVerify ( IN VOID *  Tls)

Gets the verification mode currently set in the TLS connection.

This function returns the peer verification mode currently set in the specified TLS connection.

If Tls is NULL, then ASSERT().

Parameters
[in]TlsPointer to the TLS object.
Returns
The verification mode set in the specified TLS connection.
UINT16 EFIAPI TlsGetVersion ( IN VOID *  Tls)

Gets the protocol version used by the specified TLS connection.

This function returns the protocol version used by the specified TLS connection.

If Tls is NULL, then ASSERT().

Parameters
[in]TlsPointer to the TLS object.
Returns
The protocol version of the specified TLS connection.
EFI_STATUS EFIAPI TlsHandleAlert ( IN VOID *  Tls,
IN UINT8 *  BufferIn,
IN UINTN  BufferInSize,
OUT UINT8 *  BufferOut,
IN OUT UINTN *  BufferOutSize 
)

Handle Alert message recorded in BufferIn. If BufferIn is NULL and BufferInSize is zero, TLS session has errors and the response packet needs to be Alert message based on error type.

Parameters
[in]TlsPointer to the TLS object for state checking.
[in]BufferInPointer to the most recently received TLS Alert packet.
[in]BufferInSizePacket size in bytes for the most recently received TLS Alert packet.
[out]BufferOutPointer to the buffer to hold the built packet.
[in,out]BufferOutSizePointer to the buffer size in bytes. On input, it is the buffer size provided by the caller. On output, it is the buffer size in fact needed to contain the packet.
Return values
EFI_SUCCESSThe required TLS packet is built successfully.
EFI_INVALID_PARAMETEROne or more of the following conditions is TRUE: Tls is NULL. BufferIn is NULL but BufferInSize is NOT 0. BufferInSize is 0 but BufferIn is NOT NULL. BufferOutSize is NULL. BufferOut is NULL if *BufferOutSize is not zero.
EFI_ABORTEDAn error occurred.
EFI_BUFFER_TOO_SMALLBufferOutSize is too small to hold the response packet.
BOOLEAN EFIAPI TlsInHandshake ( IN VOID *  Tls)

Checks if the TLS handshake was done.

This function will check if the specified TLS handshake was done.

Parameters
[in]TlsPointer to the TLS object for handshake state checking.
Return values
TRUEThe TLS handshake was done.
FALSEThe TLS handshake was not done.
BOOLEAN EFIAPI TlsInitialize ( VOID  )

Initializes the OpenSSL library.

This function registers ciphers and digests used directly and indirectly by SSL/TLS, and initializes the readable error messages. This function must be called before any other action takes places.

Return values
TRUEThe OpenSSL library has been initialized.
FALSEFailed to initialize the OpenSSL library.
VOID* EFIAPI TlsNew ( IN VOID *  TlsCtx)

Create a new TLS object for a connection.

This function creates a new TLS object for a connection. The new object inherits the setting of the underlying context TlsCtx: connection method, options, verification setting.

Parameters
[in]TlsCtxPointer to the SSL_CTX object.
Returns
Pointer to an allocated SSL object. If the creation failed, TlsNew() returns NULL.
INTN EFIAPI TlsRead ( IN VOID *  Tls,
IN OUT VOID *  Buffer,
IN UINTN  BufferSize 
)

Attempts to read bytes from the specified TLS connection into the buffer.

This function tries to read BufferSize bytes data from the specified TLS connection into the Buffer.

Parameters
[in]TlsPointer to the TLS connection for data reading.
[in,out]BufferPointer to the data buffer.
[in]BufferSizeThe size of Buffer in bytes.
Return values
>0The read operation was successful, and return value is the number of bytes actually read from the TLS connection.
<=0The read operation was not successful.
EFI_STATUS EFIAPI TlsSetCaCertificate ( IN VOID *  Tls,
IN VOID *  Data,
IN UINTN  DataSize 
)

Adds the CA to the cert store when requesting Server or Client authentication.

This function adds the CA certificate to the list of CAs when requesting Server or Client authentication for the chosen TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in]DataPointer to the data buffer of a DER-encoded binary X.509 certificate or PEM-encoded X.509 certificate.
[in]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_OUT_OF_RESOURCESRequired resources could not be allocated.
EFI_ABORTEDInvalid X.509 certificate.
EFI_STATUS EFIAPI TlsSetCertRevocationList ( IN VOID *  Data,
IN UINTN  DataSize 
)

Adds the CA-supplied certificate revocation list for certificate validation.

This function adds the CA-supplied certificate revocation list data for certificate validity checking.

Parameters
[in]DataPointer to the data buffer of a DER-encoded CRL data.
[in]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_ABORTEDInvalid CRL data.
EFI_STATUS EFIAPI TlsSetCipherList ( IN VOID *  Tls,
IN UINT16 *  CipherId,
IN UINTN  CipherNum 
)

Set the ciphers list to be used by the TLS object.

This function sets the ciphers for use by a specified TLS object.

Parameters
[in]TlsPointer to a TLS object.
[in]CipherIdArray of UINT16 cipher identifiers. Each UINT16 cipher identifier comes from the TLS Cipher Suite Registry of the IANA, interpreting Byte1 and Byte2 in network (big endian) byte order.
[in]CipherNumThe number of cipher in the list.
Return values
EFI_SUCCESSThe ciphers list was set successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDNo supported TLS cipher was found in CipherId.
EFI_OUT_OF_RESOURCESMemory allocation failed.
EFI_STATUS EFIAPI TlsSetCompressionMethod ( IN UINT8  CompMethod)

Set the compression method for TLS/SSL operations.

This function handles TLS/SSL integrated compression methods.

Parameters
[in]CompMethodThe compression method ID.
Return values
EFI_SUCCESSThe compression method for the communication was set successfully.
EFI_UNSUPPORTEDUnsupported compression method.
EFI_STATUS EFIAPI TlsSetConnectionEnd ( IN VOID *  Tls,
IN BOOLEAN  IsServer 
)

Set TLS object to work in client or server mode.

This function prepares a TLS object to work in client or server mode.

Parameters
[in]TlsPointer to a TLS object.
[in]IsServerWork in server mode.
Return values
EFI_SUCCESSThe TLS/SSL work mode was set successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDUnsupported TLS/SSL work mode.
EFI_STATUS EFIAPI TlsSetHostPrivateKey ( IN VOID *  Tls,
IN VOID *  Data,
IN UINTN  DataSize 
)

Adds the local private key to the specified TLS object.

This function adds the local private key (PEM-encoded RSA or PKCS#8 private key) into the specified TLS object for TLS negotiation.

Parameters
[in]TlsPointer to the TLS object.
[in]DataPointer to the data buffer of a PEM-encoded RSA or PKCS#8 private key.
[in]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_ABORTEDInvalid private key data.
EFI_STATUS EFIAPI TlsSetHostPublicCert ( IN VOID *  Tls,
IN VOID *  Data,
IN UINTN  DataSize 
)

Loads the local public certificate into the specified TLS object.

This function loads the X.509 certificate into the specified TLS object for TLS negotiation.

Parameters
[in]TlsPointer to the TLS object.
[in]DataPointer to the data buffer of a DER-encoded binary X.509 certificate or PEM-encoded X.509 certificate.
[in]DataSizeThe size of data buffer in bytes.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_OUT_OF_RESOURCESRequired resources could not be allocated.
EFI_ABORTEDInvalid X.509 certificate.
EFI_STATUS EFIAPI TlsSetSessionId ( IN VOID *  Tls,
IN UINT8 *  SessionId,
IN UINT16  SessionIdLen 
)

Sets a TLS/SSL session ID to be used during TLS/SSL connect.

This function sets a session ID to be used when the TLS/SSL connection is to be established.

Parameters
[in]TlsPointer to the TLS object.
[in]SessionIdSession ID data used for session resumption.
[in]SessionIdLenLength of Session ID in bytes.
Return values
EFI_SUCCESSSession ID was set successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDNo available session for ID setting.
VOID EFIAPI TlsSetVerify ( IN VOID *  Tls,
IN UINT32  VerifyMode 
)

Set peer certificate verification mode for the TLS connection.

This function sets the verification mode flags for the TLS connection.

Parameters
[in]TlsPointer to the TLS object.
[in]VerifyModeA set of logically or'ed verification mode flags.
EFI_STATUS EFIAPI TlsSetVerifyHost ( IN VOID *  Tls,
IN UINT32  Flags,
IN CHAR8 *  HostName 
)

Set the specified host name to be verified.

Parameters
[in]TlsPointer to the TLS object.
[in]FlagsThe setting flags during the validation.
[in]HostNameThe specified host name to be verified.
Return values
EFI_SUCCESSThe HostName setting was set successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_ABORTEDInvalid HostName setting.
EFI_STATUS EFIAPI TlsSetVersion ( IN VOID *  Tls,
IN UINT8  MajorVer,
IN UINT8  MinorVer 
)

Set a new TLS/SSL method for a particular TLS object.

This function sets a new TLS/SSL method for a particular TLS object.

Parameters
[in]TlsPointer to a TLS object.
[in]MajorVerMajor Version of TLS/SSL Protocol.
[in]MinorVerMinor Version of TLS/SSL Protocol.
Return values
EFI_SUCCESSThe TLS/SSL method was set successfully.
EFI_INVALID_PARAMETERThe parameter is invalid.
EFI_UNSUPPORTEDUnsupported TLS/SSL method.
INTN EFIAPI TlsWrite ( IN VOID *  Tls,
IN VOID *  Buffer,
IN UINTN  BufferSize 
)

Attempts to write data to a TLS connection.

This function tries to write BufferSize bytes data from the Buffer into the specified TLS connection.

Parameters
[in]TlsPointer to the TLS connection for data writing.
[in]BufferPointer to the data buffer.
[in]BufferSizeThe size of Buffer in bytes.
Return values
>0The write operation was successful, and return value is the number of bytes actually written to the TLS connection.
<=0The write operation was not successful.