summaryrefslogtreecommitdiffstats
path: root/SecurityPkg/VariableAuthenticated
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2016-03-21 17:04:36 +0800
committerLaszlo Ersek <lersek@redhat.com>2016-03-24 09:26:46 +0100
commitbac308be0c48624334f15c8677069e0596bd00d1 (patch)
treeefa8e637189010584c3a8a367fe5f639b915f290 /SecurityPkg/VariableAuthenticated
parente36ed7a84b2768443de22371f0aad5cf502328b1 (diff)
downloadedk2-bac308be0c48624334f15c8677069e0596bd00d1.tar.gz
edk2-bac308be0c48624334f15c8677069e0596bd00d1.tar.bz2
edk2-bac308be0c48624334f15c8677069e0596bd00d1.zip
SecurityPkg/SecureBootConfigDxe: Declare EFIAPI for the ChooseFile handlers
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>
Diffstat (limited to 'SecurityPkg/VariableAuthenticated')
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c5
-rw-r--r--SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h5
2 files changed, 10 insertions, 0 deletions
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
index 05d97dc43b..1b6f888042 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
@@ -343,6 +343,7 @@ UpdatePage(
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdatePKFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
@@ -360,6 +361,7 @@ UpdatePKFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateKEKFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
@@ -376,6 +378,7 @@ UpdateKEKFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
@@ -392,6 +395,7 @@ UpdateDBFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBXFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
@@ -408,6 +412,7 @@ UpdateDBXFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBTFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
)
diff --git a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
index a8dbd92ee4..1ee9580140 100644
--- a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
+++ b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
@@ -561,6 +561,7 @@ GuidToString (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdatePKFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
@@ -574,6 +575,7 @@ UpdatePKFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateKEKFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
@@ -587,6 +589,7 @@ UpdateKEKFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
@@ -600,6 +603,7 @@ UpdateDBFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBXFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);
@@ -613,6 +617,7 @@ UpdateDBXFromFile (
@retval FALSE Not exit caller function.
**/
BOOLEAN
+EFIAPI
UpdateDBTFromFile (
IN EFI_DEVICE_PATH_PROTOCOL *FilePath
);