@@ -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" ;
4344STATIC DERImg4Environment mEnvInfo ;
4445STATIC 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