utilities.py: Fix SecureBootModel detection

This commit is contained in:
Mykola Grymalyuk
2022-05-07 22:25:19 -06:00
parent b8e6b86552
commit 396590c2b2
3 changed files with 9 additions and 3 deletions

View File

@@ -11,6 +11,7 @@
- Allows for unrestricted SMBIOS usage with `AppleIntelSNBGraphicsFB`
- Adds OpenCL downgrade for TeraScale 2
- Resolves VNC support (credit IronApple#2711)
- Fix SecureBootModel detection
- Add `OpenCore-Legacy-Patcher.plist` for applied patch info
- Located under `/System/Library/CoreServices`
- Lists patch sets applied including files installed and removed

View File

@@ -174,7 +174,7 @@ class detect_root_patch:
"Settings: Requires AMFI exemption": self.amfi_must_disable,
"Validation: Patching Possible": self.verify_patch_allowed(),
"Validation: SIP is enabled": self.sip_enabled,
"Validation: SBM is enabled": self.sbm_enabled,
"Validation: SecureBootModel is enabled": self.sbm_enabled,
"Validation: AMFI is enabled": self.amfi_enabled if self.amfi_must_disable else False,
"Validation: FileVault is enabled": self.fv_enabled,
"Validation: System is dosdude1 patched": self.dosdude_patched,

View File

@@ -223,8 +223,13 @@ def patching_status(os_sip, os):
# Catalina and older supports individually disabling Library Validation
amfi_enabled = False
if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False):
if get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False) not in constants.Constants().sbm_values:
sbm_byte = get_nvram("HardwareModel", "94B73556-2197-4702-82A8-3E1337DAFBFB", decode=False)
if sbm_byte:
# SecureBootModel has a ton of null bytes, so strip them out
sbm_string = sbm_byte.decode("utf-8")
if sbm_string in constants.Constants().sbm_values:
sbm_enabled = True
else:
sbm_enabled = False
else:
sbm_enabled = False