]> git.proxmox.com Git - mirror_edk2.git/blobdiff - NetworkPkg/WifiConnectionManagerDxe/WifiConnectionMgrMisc.c
NetworkPkg: Add WiFi profile sync protocol support
[mirror_edk2.git] / NetworkPkg / WifiConnectionManagerDxe / WifiConnectionMgrMisc.c
index 4ad5643c2453a47ee005d10228f4850ccaf9939b..154f2968c764f687b9e9d623b0b7cba8b598e35a 100644 (file)
@@ -672,10 +672,23 @@ WifiMgrCleanProfileSecrets (
   IN  WIFI_MGR_NETWORK_PROFILE  *Profile\r
   )\r
 {\r
+  EFI_STATUS                        Status;\r
+  EDKII_WIFI_PROFILE_SYNC_PROTOCOL  *WiFiProfileSyncProtocol;\r
+\r
   ZeroMem (Profile->Password, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);\r
   ZeroMem (Profile->EapPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);\r
   ZeroMem (Profile->PrivateKeyPassword, sizeof (CHAR16) * PASSWORD_STORAGE_SIZE);\r
 \r
+  //\r
+  //  When EFI WiFi profile sync protocol is found the system is performing a recovery boot in secure\r
+  //  boot mode. The profile sync driver will manage the CA certificate, client certificate, and key\r
+  //  data, cleaning them at exit boot services.\r
+  //\r
+  Status = gBS->LocateProtocol (&gEdkiiWiFiProfileSyncProtocolGuid, NULL, (VOID **)&WiFiProfileSyncProtocol);\r
+  if (!EFI_ERROR (Status)) {\r
+    return;\r
+  }\r
+\r
   if (Profile->CACertData != NULL) {\r
     ZeroMem (Profile->CACertData, Profile->CACertSize);\r
     FreePool (Profile->CACertData);\r