TianoCore EDK2 master
Loading...
Searching...
No Matches
TlsConfigNull.c File Reference
#include "InternalTlsLib.h"

Go to the source code of this file.

Functions

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 TlsSetHostPrivateKeyEx (IN VOID *Tls, IN VOID *Data, IN UINTN DataSize, IN VOID *Password OPTIONAL)
 
EFI_STATUS EFIAPI TlsSetHostPrivateKey (IN VOID *Tls, IN VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetCertRevocationList (IN VOID *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetSignatureAlgoList (IN VOID *Tls, IN UINT8 *Data, IN UINTN DataSize)
 
EFI_STATUS EFIAPI TlsSetEcCurve (IN VOID *Tls, IN UINT8 *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)
 
EFI_STATUS EFIAPI TlsGetExportKey (IN VOID *Tls, IN CONST VOID *Label, IN CONST VOID *Context, IN UINTN ContextLen, OUT VOID *KeyBuffer, IN UINTN KeyBufferLen)
 

Detailed Description

SSL/TLS Configuration Null Library Wrapper Implementation.

Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved.
(C) Copyright 2016 Hewlett Packard Enterprise Development LP
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file TlsConfigNull.c.

Function Documentation

◆ TlsGetCaCertificate()

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.

Definition at line 614 of file TlsConfigNull.c.

◆ TlsGetCertRevocationList()

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.

Definition at line 698 of file TlsConfigNull.c.

◆ TlsGetClientRandom()

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).

Definition at line 542 of file TlsConfigNull.c.

◆ TlsGetConnectionEnd()

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.

Definition at line 419 of file TlsConfigNull.c.

◆ TlsGetCurrentCipher()

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.

Definition at line 443 of file TlsConfigNull.c.

◆ TlsGetCurrentCompressionId()

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.

Definition at line 470 of file TlsConfigNull.c.

◆ TlsGetExportKey()

EFI_STATUS EFIAPI TlsGetExportKey ( IN VOID *  Tls,
IN CONST VOID *  Label,
IN CONST VOID *  Context,
IN UINTN  ContextLen,
OUT VOID *  KeyBuffer,
IN UINTN  KeyBufferLen 
)

Derive keying material from a TLS connection.

This function exports keying material using the mechanism described in RFC 5705.

Parameters
[in]TlsPointer to the TLS object
[in]LabelDescription of the key for the PRF function
[in]ContextOptional context
[in]ContextLenThe length of the context value in bytes
[out]KeyBufferBuffer to hold the output of the TLS-PRF
[in]KeyBufferLenThe length of the KeyBuffer
Return values
EFI_SUCCESSThe operation succeeded.
EFI_INVALID_PARAMETERThe TLS object is invalid.
EFI_PROTOCOL_ERRORSome other error occurred.

Definition at line 727 of file TlsConfigNull.c.

◆ TlsGetHostPrivateKey()

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.

Definition at line 671 of file TlsConfigNull.c.

◆ TlsGetHostPublicCert()

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.

Definition at line 643 of file TlsConfigNull.c.

◆ TlsGetKeyMaterial()

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.

Definition at line 587 of file TlsConfigNull.c.

◆ TlsGetServerRandom()

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).

Definition at line 563 of file TlsConfigNull.c.

◆ TlsGetSessionId()

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.

Definition at line 519 of file TlsConfigNull.c.

◆ TlsGetVerify()

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.

Definition at line 494 of file TlsConfigNull.c.

◆ TlsGetVersion()

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.

Definition at line 396 of file TlsConfigNull.c.

◆ TlsSetCaCertificate()

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.

Definition at line 203 of file TlsConfigNull.c.

◆ TlsSetCertRevocationList()

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.

Definition at line 317 of file TlsConfigNull.c.

◆ TlsSetCipherList()

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.

Definition at line 82 of file TlsConfigNull.c.

◆ TlsSetCompressionMethod()

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.

Definition at line 106 of file TlsConfigNull.c.

◆ TlsSetConnectionEnd()

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.

Definition at line 53 of file TlsConfigNull.c.

◆ TlsSetEcCurve()

EFI_STATUS EFIAPI TlsSetEcCurve ( IN VOID *  Tls,
IN UINT8 *  Data,
IN UINTN  DataSize 
)

Set the EC curve to be used for TLS flows

This function sets the EC curve to be used for TLS flows.

Parameters
[in]TlsPointer to a TLS object.
[in]DataAn EC named curve as defined in section 5.1.1 of RFC 4492.
[in]DataSizeSize of Data, it should be sizeof (UINT32)
Return values
EFI_SUCCESSThe EC curve was set successfully.
EFI_INVALID_PARAMETERThe parameters are invalid.
EFI_UNSUPPORTEDThe requested TLS EC curve is not supported

Definition at line 371 of file TlsConfigNull.c.

◆ TlsSetHostPrivateKey()

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 (DER-encoded or PEM-encoded 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 DER-encoded or PEM-encoded 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.

Definition at line 291 of file TlsConfigNull.c.

◆ TlsSetHostPrivateKeyEx()

EFI_STATUS EFIAPI TlsSetHostPrivateKeyEx ( IN VOID *  Tls,
IN VOID *  Data,
IN UINTN  DataSize,
IN VOID *Password  OPTIONAL 
)

Adds the local private key to the specified TLS object.

This function adds the local private key (DER-encoded or PEM-encoded 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 DER-encoded or PEM-encoded or PKCS#8 private key.
[in]DataSizeThe size of data buffer in bytes.
[in]PasswordPointer to NULL-terminated private key password, set it to NULL if private key not encrypted.
Return values
EFI_SUCCESSThe operation succeeded.
EFI_UNSUPPORTEDThis function is not supported.
EFI_ABORTEDInvalid private key data.

Definition at line 262 of file TlsConfigNull.c.

◆ TlsSetHostPublicCert()

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.

Definition at line 232 of file TlsConfigNull.c.

◆ TlsSetSessionId()

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.

Definition at line 174 of file TlsConfigNull.c.

◆ TlsSetSignatureAlgoList()

EFI_STATUS EFIAPI TlsSetSignatureAlgoList ( IN VOID *  Tls,
IN UINT8 *  Data,
IN UINTN  DataSize 
)

Set the signature algorithm list to used by the TLS object.

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

Parameters
[in]TlsPointer to a TLS object.
[in]DataArray of UINT8 of signature algorithms. The array consists of pairs of the hash algorithm and the signature algorithm as defined in RFC 5246
[in]DataSizeThe length the SignatureAlgoList. Must be divisible by 2.
Return values
EFI_SUCCESSThe signature algorithm list was set successfully.
EFI_INVALID_PARAMETERThe parameters are invalid.
EFI_UNSUPPORTEDNo supported TLS signature algorithm was found in SignatureAlgoList
EFI_OUT_OF_RESOURCESMemory allocation failed.

Definition at line 345 of file TlsConfigNull.c.

◆ TlsSetVerify()

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.

Definition at line 125 of file TlsConfigNull.c.

◆ TlsSetVerifyHost()

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.

Definition at line 147 of file TlsConfigNull.c.

◆ TlsSetVersion()

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.

Definition at line 28 of file TlsConfigNull.c.