]> git.proxmox.com Git - mirror_edk2.git/commitdiff
SecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the ChooseFile handlers
authorGary Lin <glin@suse.com>
Mon, 21 Mar 2016 09:04:36 +0000 (17:04 +0800)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 24 Mar 2016 08:26:46 +0000 (09:26 +0100)
The SecureBootConfig now uses ChooseFile() from FileExplorerLib
to select the certificates to be enrolled into PK, KEK, DB, DBX,
or DBT, and the corresponding handlers to get the content of the
file. Per the definition of CHOOSE_HANDLER, the handler must use
EFIAPI as the calling convention. However, the calling convention
was not specified the following handlers: UpdatePKFromFile(),
UpdateKEKFromFile(), UpdateDBFromFile(), UpdateDBXFromFile(), and
UpdateDBTFromFile(). When compiling the firmware with gcc, the
default calling convention is not compatible with EFIAPI, so the
handlers interpreted the argument the wrong way and passed the
wrong device path to UpdatePage(), and the system crashed when
the user tried to enroll a certificate into the key database.

This commit specifies the calling convention for those functions
so that gcc can generate the right code.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Gary Lin <glin@suse.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Dandan Bi <dandan.bi@intel.com>
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h

index 05d97dc43b6e6d20d7d3912d27637c5004eb289d..1b6f88804275dc48886e710d7e01d4be9b59ff41 100644 (file)
@@ -343,6 +343,7 @@ UpdatePage(
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdatePKFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   )\r
@@ -360,6 +361,7 @@ UpdatePKFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateKEKFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   )\r
@@ -376,6 +378,7 @@ UpdateKEKFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   )\r
@@ -392,6 +395,7 @@ UpdateDBFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBXFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   )\r
@@ -408,6 +412,7 @@ UpdateDBXFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBTFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   )\r
index a8dbd92ee436b1dc158875db6cdc355930ff1ec5..1ee9580140596ff6f11a00a7ff16771891a84f61 100644 (file)
@@ -561,6 +561,7 @@ GuidToString (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdatePKFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -574,6 +575,7 @@ UpdatePKFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateKEKFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -587,6 +589,7 @@ UpdateKEKFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -600,6 +603,7 @@ UpdateDBFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBXFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r
@@ -613,6 +617,7 @@ UpdateDBXFromFile (
   @retval FALSE  Not exit caller function.\r
 **/\r
 BOOLEAN\r
+EFIAPI\r
 UpdateDBTFromFile (\r
   IN EFI_DEVICE_PATH_PROTOCOL    *FilePath\r
   );\r