1 // SPDX-License-Identifier: GPL-2.0
3 #include <linux/kernel.h>
4 #include <linux/sched.h>
5 #include <linux/cred.h>
8 #include <linux/slab.h>
9 #include <keys/asymmetric-type.h>
10 #include <keys/system_keyring.h>
11 #include <asm/boot_data.h>
12 #include "../integrity.h"
15 * Load the certs contained in the IPL report created by the machine loader
16 * into the platform trusted keyring.
18 static int __init
load_ipl_certs(void)
23 if (!ipl_cert_list_addr
)
25 /* Copy the certificates to the system keyring */
26 ptr
= (void *) ipl_cert_list_addr
;
27 end
= ptr
+ ipl_cert_list_size
;
28 while ((void *) ptr
< end
) {
29 len
= *(unsigned int *) ptr
;
30 ptr
+= sizeof(unsigned int);
31 add_to_platform_keyring("IPL:db", ptr
, len
);
36 late_initcall(load_ipl_certs
);