Skip to content

Commit

Permalink
SecureBootConfigImpl: Show converted Common Name
Browse files Browse the repository at this point in the history
Signed-off-by: Filip Go¿a¿ <[email protected]>
  • Loading branch information
philipandag committed Jul 9, 2024
1 parent 3d421d4 commit aaa71f9
Showing 1 changed file with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2541,6 +2541,7 @@ UpdateDeletePage (
EFI_SIGNATURE_DATA *Cert;
UINT32 ItemDataSize;
CHAR16 *GuidStr;
CHAR8 *GuidStr8;
EFI_STRING_ID GuidID;
EFI_STRING_ID Help;

Expand Down Expand Up @@ -2607,6 +2608,11 @@ UpdateDeletePage (
goto ON_EXIT;
}

GuidStr8 = AllocateZeroPool (100);
if (GuidStr == NULL) {
Status = EFI_OUT_OF_RESOURCES;
goto ON_EXIT;
}
GuidStr = AllocateZeroPool (100);
if (GuidStr == NULL) {
Status = EFI_OUT_OF_RESOURCES;
Expand Down Expand Up @@ -2654,7 +2660,19 @@ UpdateDeletePage (
// Display GUID and help
//

StrCpyS(GuidStr, 100, L"Hello Certyfikat!");

UINTN size = 100;
X509GetCommonName((UINT8*)Cert->SignatureData, (UINTN)CertList->SignatureSize, GuidStr8, &size);

// X509GetCommonName gets the name in 8b chars, we need to convert it
// to 16b
CHAR8* guidIter8 = GuidStr8;
CHAR16* guidIter = GuidStr;
for(int i = 0; i < size; i++)
{
guidIter[i] = guidIter8[i];
}

GuidID = HiiSetString (PrivateData->HiiHandle, 0, GuidStr, NULL);

HiiCreateCheckBoxOpCode (
Expand Down

0 comments on commit aaa71f9

Please sign in to comment.