Skip to content

Commit 1b00414

Browse files
committed
OcAppleImg4Lib: Added missing Secure Boot NVRAM variables for 11.0
1 parent ba10b5d commit 1b00414

File tree

2 files changed

+39
-1
lines changed

2 files changed

+39
-1
lines changed

Changelog.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ OpenCore Changelog
2323
- Add `ForceResolution` option for enabling non-default resolutions
2424
- Fixed Ps2MouseDxe not properly loading under OpenDuetPkg
2525
- Added workaround for read-only errors on some X299 boards
26-
- Added support for `x86legacy` secure boot model
26+
- Added support for `x86legacy` Secure Boot model
27+
- Added missing Secure Boot NVRAM variables required by 11.0
2728

2829
#### v0.6.2
2930
- Updated builtin firmware versions for SMBIOS and the rest

Library/OcAppleImg4Lib/OcAppleImg4Lib.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ typedef struct OC_SB_MODEL_DESC_ {
4040
UINT32 BoardId;
4141
} OC_SB_MODEL_DESC;
4242

43+
STATIC CHAR8 mCryptoDigestMethod[16] = "sha2-384";
4344
STATIC DERImg4Environment mEnvInfo;
4445
STATIC CONST CHAR8 *mModelDefault = "j137";
4546
///
@@ -362,6 +363,7 @@ OcAppleImg4BootstrapValues (
362363
mEnvInfo.effectiveSecurityMode = 1;
363364
mEnvInfo.internalUseOnlyUnit = FALSE;
364365
mEnvInfo.xugs = 1;
366+
mEnvInfo.allowMixNMatch = FALSE;
365367

366368
//
367369
// Expose all the variables via NVRAM.
@@ -388,6 +390,17 @@ OcAppleImg4BootstrapValues (
388390
return Status;
389391
}
390392

393+
Status = gRT->SetVariable (
394+
L"CertificateEpoch",
395+
&gAppleSecureBootVariableGuid,
396+
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
397+
sizeof (mEnvInfo.certificateEpoch),
398+
&mEnvInfo.certificateEpoch
399+
);
400+
if (EFI_ERROR (Status)) {
401+
return Status;
402+
}
403+
391404
Status = gRT->SetVariable (
392405
L"ApBoardID",
393406
&gAppleSecureBootVariableGuid,
@@ -465,6 +478,30 @@ OcAppleImg4BootstrapValues (
465478
return Status;
466479
}
467480

481+
Status = gRT->SetVariable (
482+
L"ApMixNMatchPreventionStatus",
483+
&gAppleSecureBootVariableGuid,
484+
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
485+
sizeof (mEnvInfo.allowMixNMatch),
486+
&mEnvInfo.allowMixNMatch
487+
);
488+
if (EFI_ERROR (Status)) {
489+
return Status;
490+
}
491+
492+
Status = gRT->SetVariable (
493+
L"CryptoDigestMethod",
494+
&gAppleSecureBootVariableGuid,
495+
EFI_VARIABLE_RUNTIME_ACCESS | EFI_VARIABLE_BOOTSERVICE_ACCESS,
496+
sizeof (mCryptoDigestMethod),
497+
&mCryptoDigestMethod
498+
);
499+
if (EFI_ERROR (Status)) {
500+
return Status;
501+
}
502+
503+
504+
468505
return EFI_SUCCESS;
469506
}
470507

0 commit comments

Comments
 (0)