Skip to content

Commit 864d0c1

Browse files
committed
Fix Security Violation when providing an external PK
* PKs should obviously not have the APPEND attribute, yet we defaulted to adding it in pki.c - Fix that.
1 parent fb1c9f8 commit 864d0c1

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/pki.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,8 +428,17 @@ EFI_STATUS PopulateAuthVar(
428428
ReportErrorAndExit(L"'%s' is too small to be a valid certificate or signature list\n", Entry->Path);
429429

430430
// Set default attributes for authenticated variable
431-
if (Entry->Attrs == 0)
432-
Entry->Attrs = (Entry->Type == MOK) ? UEFI_VAR_NV_BS_AP : UEFI_VAR_NV_BS_RT_AT_AP;
431+
switch(Entry->Type) {
432+
case MOK:
433+
Entry->Attrs = UEFI_VAR_NV_BS_AP;
434+
break;
435+
case PK:
436+
Entry->Attrs = UEFI_VAR_NV_BS_RT_AT;
437+
break;
438+
default:
439+
Entry->Attrs = UEFI_VAR_NV_BS_RT_AT_AP;
440+
break;
441+
}
433442

434443
// Check for signed ESL (PKCS#7 only)
435444
AuthVar = (EFI_VARIABLE_AUTHENTICATION_2*)Entry->Buffer.Data;

0 commit comments

Comments
 (0)