]> git.proxmox.com Git - mirror_edk2.git/commit - SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h
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)
commitbac308be0c48624334f15c8677069e0596bd00d1
treeefa8e637189010584c3a8a367fe5f639b915f290
parente36ed7a84b2768443de22371f0aad5cf502328b1
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>
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c
SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigImpl.h