MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / DisableSecureBoot

Function DisableSecureBoot

rEFIt_UEFI/entry_scan/secureboot.cpp:178–210  ·  view source on GitHub ↗

Disable secure boot

Source from the content-addressed store, hash-verified

176
177// Disable secure boot
178VOID DisableSecureBoot(VOID)
179{
180 EFI_STATUS Status;
181 CHAR16 *ErrorString = NULL;
182 // Check in user mode
183 if (gSettings.SecureBootSetupMode || !gSettings.SecureBoot) {
184 return;
185 }
186 UninstallSecureBoot();
187 // Clear the platform database
188 Status = ClearSecureBootKeys();
189 if (EFI_ERROR(Status)) {
190 ErrorString = L"Failed to clear platform database!\nIs Clover platform database owner?";
191 } else if (YesNoMessage(L"Disable Secure Boot", L"Do you want to clear all databases (suggested)?")) {
192 // Clear all databases if wanted
193 Status = SetSignatureDatabase(EXCHANGE_DATABASE_NAME, &EXCHANGE_DATABASE_GUID, NULL, 0);
194 if (EFI_ERROR(Status)) {
195 DisableMessage(Status, L"Failed to disable secure boot!", L"Failed to clear exchange database!");
196 }
197 Status = ClearAuthorizedDatabase();
198 if (EFI_ERROR(Status)) {
199 ErrorString = L"Failed to clear authorized database!";
200 }
201 }
202 // Alert failure to user
203 if (EFI_ERROR(Status)) {
204 DisableMessage(Status, L"Failed to disable secure boot!", ErrorString);
205 } else {
206 // Reinit secure boot now
207 InitializeSecureBoot();
208 PrintSecureBootInfo();
209 }
210}
211
212// The previous protocol functions
213STATIC EFI_SECURITY_FILE_AUTHENTICATION_STATE gSecurityFileAuthentication;

Callers 2

EnableSecureBootFunction · 0.85
ConfigureSecureBootFunction · 0.85

Calls 8

UninstallSecureBootFunction · 0.85
ClearSecureBootKeysFunction · 0.85
YesNoMessageFunction · 0.85
SetSignatureDatabaseFunction · 0.85
DisableMessageFunction · 0.85
ClearAuthorizedDatabaseFunction · 0.85
InitializeSecureBootFunction · 0.85
PrintSecureBootInfoFunction · 0.85

Tested by

no test coverage detected