summaryrefslogtreecommitdiff
path: root/security/integrity/platform_certs/keyring_handler.h
diff options
context:
space:
mode:
authorNayna Jain <nayna@linux.ibm.com>2019-11-11 06:10:35 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2019-11-12 16:33:23 +0300
commitad723674d6758478829ee766e3f1a2a24d56236f (patch)
tree2928474fa444f60fa933d1902ac3b358f4bc6f3f /security/integrity/platform_certs/keyring_handler.h
parentbd5d9c743d38f67d64ea1b512a461f6b5a5f6bec (diff)
downloadlinux-ad723674d6758478829ee766e3f1a2a24d56236f.tar.xz
x86/efi: move common keyring handler functions to new file
The handlers to add the keys to the .platform keyring and blacklisted hashes to the .blacklist keyring is common for both the uefi and powerpc mechanisms of loading the keys/hashes from the firmware. This patch moves the common code from load_uefi.c to keyring_handler.c Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Acked-by: Mimi Zohar <zohar@linux.ibm.com> Signed-off-by: Eric Richter <erichte@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/1573441836-3632-4-git-send-email-nayna@linux.ibm.com
Diffstat (limited to 'security/integrity/platform_certs/keyring_handler.h')
-rw-r--r--security/integrity/platform_certs/keyring_handler.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/security/integrity/platform_certs/keyring_handler.h b/security/integrity/platform_certs/keyring_handler.h
new file mode 100644
index 000000000000..2462bfa08fe3
--- /dev/null
+++ b/security/integrity/platform_certs/keyring_handler.h
@@ -0,0 +1,32 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+
+#ifndef PLATFORM_CERTS_INTERNAL_H
+#define PLATFORM_CERTS_INTERNAL_H
+
+#include <linux/efi.h>
+
+void blacklist_hash(const char *source, const void *data,
+ size_t len, const char *type,
+ size_t type_len);
+
+/*
+ * Blacklist an X509 TBS hash.
+ */
+void blacklist_x509_tbs(const char *source, const void *data, size_t len);
+
+/*
+ * Blacklist the hash of an executable.
+ */
+void blacklist_binary(const char *source, const void *data, size_t len);
+
+/*
+ * Return the handler for particular signature list types found in the db.
+ */
+efi_element_handler_t get_handler_for_db(const efi_guid_t *sig_type);
+
+/*
+ * Return the handler for particular signature list types found in the dbx.
+ */
+efi_element_handler_t get_handler_for_dbx(const efi_guid_t *sig_type);
+
+#endif