| // SPDX-License-Identifier: GPL-2.0-or-later |
| #include <linux/kernel.h> |
| int load_certificate_list(const u8 cert_list[], |
| const unsigned long list_size, |
| const struct key *keyring) |
| /* Each cert begins with an ASN.1 SEQUENCE tag and must be more |
| * than 256 bytes in size. |
| plen = (p[2] << 8) | p[3]; |
| key = key_create_or_update(make_key_ref(keyring, 1), |
| ((KEY_POS_ALL & ~KEY_POS_SETATTR) | |
| KEY_USR_VIEW | KEY_USR_READ), |
| KEY_ALLOC_BYPASS_RESTRICTION); |
| pr_err("Problem loading in-kernel X.509 certificate (%ld)\n", |
| pr_notice("Loaded X.509 cert '%s'\n", |
| key_ref_to_ptr(key)->description); |
| pr_err("Problem parsing in-kernel X.509 certificate list\n"); |