12CHAR16 *mDerPemEncodedSuffix[] = {
36 for (Index = 0; mDerPemEncodedSuffix[Index] !=
NULL; Index++) {
37 if (
StrCmp (FileSuffix, mDerPemEncodedSuffix[Index]) == 0) {
64 IN OUT VOID **BufferPtr,
70 UINT64 SourceFileSize;
74 if ((FileHandle ==
NULL) || (FileSize ==
NULL)) {
75 return EFI_INVALID_PARAMETER;
83 Status = FileHandle->SetPosition (FileHandle, (UINT64)-1);
84 if (EFI_ERROR (Status)) {
88 Status = FileHandle->GetPosition (FileHandle, &SourceFileSize);
89 if (EFI_ERROR (Status)) {
93 Status = FileHandle->SetPosition (FileHandle, 0);
94 if (EFI_ERROR (Status)) {
98 BufferSize = (
UINTN)SourceFileSize + AddtionAllocateSize;
100 if (Buffer ==
NULL) {
101 return EFI_OUT_OF_RESOURCES;
104 BufferSize = (
UINTN)SourceFileSize;
105 *FileSize = BufferSize;
107 Status = FileHandle->Read (FileHandle, &BufferSize, Buffer);
108 if (EFI_ERROR (Status) || (BufferSize != *FileSize)) {
111 Status = EFI_BAD_BUFFER_SIZE;
164 ASSERT (DevicePath !=
NULL);
167 if (String ==
NULL) {
171 MatchString = String;
175 while (MatchString !=
NULL) {
176 LastMatch = MatchString + 1;
177 MatchString =
StrStr (LastMatch, L
"\\");
180 Length =
StrLen (LastMatch);
182 if (FileName !=
NULL) {
183 *(FileName + Length) = 0;
206 IN EFI_FORM_ID FormId
214 if (FilePath !=
NULL) {
218 if (FileName ==
NULL) {
231 if (Private->FileContext->FHandle !=
NULL) {
232 Private->FileContext->FHandle->Close (Private->FileContext->FHandle);
235 Private->FileContext->FHandle =
NULL;
239 &Private->FileContext->FHandle,
243 if (EFI_ERROR (Status)) {
244 if (FormId == FORMID_ENROLL_CERT) {
246 Private->RegisteredHandle,
251 }
else if (FormId == FORMID_ENROLL_PRIVATE_KEY) {
253 Private->RegisteredHandle,
260 if (Private->FileContext->FileName !=
NULL) {
261 FreePool (Private->FileContext->FileName);
262 Private->FileContext->FileName =
NULL;
265 Private->FileContext->FileName = FileName;
267 if (FormId == FORMID_ENROLL_CERT) {
269 Private->RegisteredHandle,
274 }
else if (FormId == FORMID_ENROLL_PRIVATE_KEY) {
276 Private->RegisteredHandle,
303 return UpdatePage (Private, FilePath, FORMID_ENROLL_CERT);
322 return UpdatePage (Private, FilePath, FORMID_ENROLL_PRIVATE_KEY);
INTN EFIAPI StrCmp(IN CONST CHAR16 *FirstString, IN CONST CHAR16 *SecondString)
UINTN EFIAPI StrLen(IN CONST CHAR16 *String)
CHAR16 *EFIAPI StrStr(IN CONST CHAR16 *String, IN CONST CHAR16 *SearchString)
CHAR16 *EFIAPI ConvertDevicePathToText(IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath, IN BOOLEAN DisplayOnly, IN BOOLEAN AllowShortcuts)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
VOID *EFIAPI AllocateCopyPool(IN UINTN AllocationSize, IN CONST VOID *Buffer)
EFI_STRING_ID EFIAPI HiiSetString(IN EFI_HII_HANDLE HiiHandle, IN EFI_STRING_ID StringId OPTIONAL, IN CONST EFI_STRING String, IN CONST CHAR8 *SupportedLanguages OPTIONAL)
EFI_STATUS EFIAPI EfiOpenFileByDevicePath(IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, OUT EFI_FILE_PROTOCOL **File, IN UINT64 OpenMode, IN UINT64 Attributes)
BOOLEAN IsDerPemEncodeCertificate(IN CONST CHAR16 *FileSuffix)
EFI_STATUS ReadFileContent(IN EFI_FILE_HANDLE FileHandle, IN OUT VOID **BufferPtr, OUT UINTN *FileSize, IN UINTN AddtionAllocateSize)
BOOLEAN UpdateCAFromFile(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
BOOLEAN UpdatePage(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath, IN EFI_FORM_ID FormId)
CHAR16 *EFIAPI DevicePathToStr(IN EFI_DEVICE_PATH_PROTOCOL *DevPath)
BOOLEAN UpdatePrivateKeyFromFile(IN WIFI_MGR_PRIVATE_DATA *Private, IN EFI_DEVICE_PATH_PROTOCOL *FilePath)
CHAR16 * ExtractFileNameFromDevicePath(IN EFI_DEVICE_PATH_PROTOCOL *DevicePath)