Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:security\integrity\platform_certs\load_uefi.c Create Date:2022-07-28 19:56:48
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Load the certs contained in the UEFI databases into the platform trusted* keyring and the UEFI blacklisted X.509 cert SHA256 hashes into the blacklist* keyring.

Proto:static int __init load_uefi_certs(void)

Type:int

Parameter:Nothing

75  secure_var = EFI_IMAGE_SECURITY_DATABASE_GUID
76  mok_var = EFI_SHIM_LOCK_GUID
77  void * db = NULL, * dbx = NULL, * mok = NULL
78  dbsize = 0 , dbxsize = 0 , moksize = 0
80  rc = 0
82  If Not get_variable Then Return false
88  If Not Look to see if a UEFI variable called MokIgnoreDB exists and return true if* it does Then
89  db = Get a certificate list blob from the named EFI variable.
90  If Not db Then
91  If status == EFI_NOT_FOUND Then pr_debug("MODSIGN: db variable wasn't found\n")
93  Else pr_err("MODSIGN: Couldn't get UEFI db list\n")
95  Else
98  If rc Then pr_err("Couldn't parse db signatures: %d\n", rc)
101  kfree(db)
105  mok = Get a certificate list blob from the named EFI variable.
106  If Not mok Then
107  If status == EFI_NOT_FOUND Then pr_debug("MokListRT variable wasn't found\n")
109  Else pr_info("Couldn't get UEFI MokListRT\n")
111  Else
112  rc = parse_efi_signature_list - Parse an EFI signature list for certificates*@source: The source of the key*@data: The data blob to parse*@size: The size of the data blob*@get_handler_for_guid: Get the handler func for the sig type (or NULL)
114  If rc Then pr_err("Couldn't parse MokListRT signatures: %d\n", rc)
116  kfree(mok)
119  dbx = Get a certificate list blob from the named EFI variable.
120  If Not dbx Then
121  If status == EFI_NOT_FOUND Then pr_debug("dbx variable wasn't found\n")
123  Else pr_info("Couldn't get UEFI dbx list\n")
125  Else
126  rc = parse_efi_signature_list - Parse an EFI signature list for certificates*@source: The source of the key*@data: The data blob to parse*@size: The size of the data blob*@get_handler_for_guid: Get the handler func for the sig type (or NULL)
129  If rc Then pr_err("Couldn't parse dbx signatures: %d\n", rc)
131  kfree(dbx)
134  Return rc