OcMainLib: Do not use config UUID when NVRAM is not updated
@@ -869,6 +869,7 @@ OcGetLegacySecureBootECID (
// TODO: Cache platform IDs for both interfaces: OcGetSystemId and OcLoadPlatformSupport,
// as currently this duplicates the code above.
//
+ if (Config->PlatformInfo.UpdateNvram) {
if (Config->PlatformInfo.Automatic) {
if (AsciiStrCmp (OC_BLOB_GET (&Config->PlatformInfo.Generic.SystemUuid), "OEM") == 0) {
@@ -898,15 +899,16 @@ OcGetLegacySecureBootECID (
}
DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g from auto config - %r\n", &Uuid, Status));
}
- } else if (Config->PlatformInfo.UpdateNvram) {
+ } else {
Status = OcAsciiStrToRawGuid (OC_BLOB_GET (&Config->PlatformInfo.Nvram.SystemUuid), &Uuid);
if (EFI_ERROR (Status)) {
ZeroMem (&Uuid, sizeof (Uuid));
}
DEBUG ((DEBUG_INFO, "OC: Grabbed SB uuid %g from manual config - %r\n", &Uuid, Status));
}
+ }
- if (IsZeroGuid (&Uuid)) {
+ if (!Config->PlatformInfo.UpdateNvram || IsZeroGuid (&Uuid)) {
ReadSize = sizeof (Uuid);
Status = gRT->GetVariable (
L"system-id",
