TianoCore EDK2 master
Loading...
Searching...
No Matches
WifiConnectionMgrFileUtil.c File Reference

Go to the source code of this file.

Functions

BOOLEAN IsDerPemEncodeCertificate (IN CONST CHAR16 *FileSuffix)
 
EFI_STATUS ReadFileContent (IN EFI_FILE_HANDLE FileHandle, IN OUT VOID **BufferPtr, OUT UINTN *FileSize, IN UINTN AddtionAllocateSize)
 
CHAR16 *EFIAPI DevicePathToStr (IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
 
CHAR16 * ExtractFileNameFromDevicePath (IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)
 
BOOLEAN UpdatePage (IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_FORM_ID FormId)
 
BOOLEAN UpdateCAFromFile (IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 
BOOLEAN UpdatePrivateKeyFromFile (IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
 

Variables

CHAR16 * mDerPemEncodedSuffix []
 

Detailed Description

The file operation functions for WiFi Connection Manager.

Copyright (c) 2019, Intel Corporation. All rights reserved.

SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file WifiConnectionMgrFileUtil.c.

Function Documentation

◆ DevicePathToStr()

CHAR16 *EFIAPI DevicePathToStr ( IN EFI_DEVICE_PATH_PROTOCOL DevPath)

This function converts an input device structure to a Unicode string.

Parameters
[in]DevPathA pointer to the device path structure.
Returns
A new allocated Unicode string that represents the device path.

Definition at line 131 of file WifiConnectionMgrFileUtil.c.

◆ ExtractFileNameFromDevicePath()

CHAR16 * ExtractFileNameFromDevicePath ( IN EFI_DEVICE_PATH_PROTOCOL DevicePath)

Extract filename from device path. The returned buffer is allocated using AllocateCopyPool. The caller is responsible for freeing the allocated buffer using FreePool(). If return NULL means not enough memory resource.

Parameters
DevicePathDevice path.
Return values
NULLNot enough memory resourece for AllocateCopyPool.
OtherA new allocated string that represents the file name.

Definition at line 154 of file WifiConnectionMgrFileUtil.c.

◆ IsDerPemEncodeCertificate()

BOOLEAN IsDerPemEncodeCertificate ( IN CONST CHAR16 *  FileSuffix)

This code checks if the FileSuffix is one of the possible DER/PEM-encoded certificate suffix.

Parameters
[in]FileSuffixThe suffix of the input certificate file
Return values
TRUEIt's a DER/PEM-encoded certificate.
FALSEIt's NOT a DER/PEM-encoded certificate.

Definition at line 30 of file WifiConnectionMgrFileUtil.c.

◆ ReadFileContent()

EFI_STATUS ReadFileContent ( IN EFI_FILE_HANDLE  FileHandle,
IN OUT VOID **  BufferPtr,
OUT UINTN FileSize,
IN UINTN  AddtionAllocateSize 
)

Read file content into BufferPtr, the size of the allocate buffer is *FileSize plus AddtionAllocateSize.

Parameters
[in]FileHandleThe file to be read.
[in,out]BufferPtrPointers to the pointer of allocated buffer.
[out]FileSizeSize of input file
[in]AddtionAllocateSizeAddtion size the buffer need to be allocated. In case the buffer need to contain others besides the file content.
Return values
EFI_SUCCESSThe file was read into the buffer.
EFI_INVALID_PARAMETERA parameter was invalid.
EFI_OUT_OF_RESOURCESA memory allocation failed.
othersUnexpected error.

Definition at line 62 of file WifiConnectionMgrFileUtil.c.

◆ UpdateCAFromFile()

BOOLEAN UpdateCAFromFile ( IN WIFI_MGR_PRIVATE_DATA Private,
IN EFI_DEVICE_PATH_PROTOCOL FilePath 
)

Update the CA form base on the input file path info.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]FilePathPoint to the file path.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 298 of file WifiConnectionMgrFileUtil.c.

◆ UpdatePage()

BOOLEAN UpdatePage ( IN WIFI_MGR_PRIVATE_DATA Private,
IN EFI_DEVICE_PATH_PROTOCOL FilePath,
IN EFI_FORM_ID  FormId 
)

Update the form base on the selected file.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]FilePathPoint to the file path.
[in]FormIdThe form needs to display.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 203 of file WifiConnectionMgrFileUtil.c.

◆ UpdatePrivateKeyFromFile()

BOOLEAN UpdatePrivateKeyFromFile ( IN WIFI_MGR_PRIVATE_DATA Private,
IN EFI_DEVICE_PATH_PROTOCOL FilePath 
)

Update the Private Key form base on the input file path info.

Parameters
[in]PrivateThe pointer to the global private data structure.
[in]FilePathPoint to the file path.
Return values
TRUEExit caller function.
FALSENot exit caller function.

Definition at line 317 of file WifiConnectionMgrFileUtil.c.

Variable Documentation

◆ mDerPemEncodedSuffix

CHAR16* mDerPemEncodedSuffix[]
Initial value:
= {
L".cer",
L".der",
L".crt",
L".pem",
}
#define NULL
Definition: Base.h:319

Definition at line 12 of file WifiConnectionMgrFileUtil.c.