162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
262306a36Sopenharmony_ci/* System hash blacklist.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (C) 2016 Red Hat, Inc. All Rights Reserved.
562306a36Sopenharmony_ci * Written by David Howells (dhowells@redhat.com)
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#define pr_fmt(fmt) "blacklist: "fmt
962306a36Sopenharmony_ci#include <linux/module.h>
1062306a36Sopenharmony_ci#include <linux/slab.h>
1162306a36Sopenharmony_ci#include <linux/key.h>
1262306a36Sopenharmony_ci#include <linux/key-type.h>
1362306a36Sopenharmony_ci#include <linux/sched.h>
1462306a36Sopenharmony_ci#include <linux/ctype.h>
1562306a36Sopenharmony_ci#include <linux/err.h>
1662306a36Sopenharmony_ci#include <linux/seq_file.h>
1762306a36Sopenharmony_ci#include <linux/uidgid.h>
1862306a36Sopenharmony_ci#include <keys/asymmetric-type.h>
1962306a36Sopenharmony_ci#include <keys/system_keyring.h>
2062306a36Sopenharmony_ci#include "blacklist.h"
2162306a36Sopenharmony_ci
2262306a36Sopenharmony_ci/*
2362306a36Sopenharmony_ci * According to crypto/asymmetric_keys/x509_cert_parser.c:x509_note_pkey_algo(),
2462306a36Sopenharmony_ci * the size of the currently longest supported hash algorithm is 512 bits,
2562306a36Sopenharmony_ci * which translates into 128 hex characters.
2662306a36Sopenharmony_ci */
2762306a36Sopenharmony_ci#define MAX_HASH_LEN	128
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#define BLACKLIST_KEY_PERM (KEY_POS_SEARCH | KEY_POS_VIEW | \
3062306a36Sopenharmony_ci			    KEY_USR_SEARCH | KEY_USR_VIEW)
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_cistatic const char tbs_prefix[] = "tbs";
3362306a36Sopenharmony_cistatic const char bin_prefix[] = "bin";
3462306a36Sopenharmony_ci
3562306a36Sopenharmony_cistatic struct key *blacklist_keyring;
3662306a36Sopenharmony_ci
3762306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_REVOCATION_LIST
3862306a36Sopenharmony_ciextern __initconst const u8 revocation_certificate_list[];
3962306a36Sopenharmony_ciextern __initconst const unsigned long revocation_certificate_list_size;
4062306a36Sopenharmony_ci#endif
4162306a36Sopenharmony_ci
4262306a36Sopenharmony_ci/*
4362306a36Sopenharmony_ci * The description must be a type prefix, a colon and then an even number of
4462306a36Sopenharmony_ci * hex digits.  The hash is kept in the description.
4562306a36Sopenharmony_ci */
4662306a36Sopenharmony_cistatic int blacklist_vet_description(const char *desc)
4762306a36Sopenharmony_ci{
4862306a36Sopenharmony_ci	int i, prefix_len, tbs_step = 0, bin_step = 0;
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci	/* The following algorithm only works if prefix lengths match. */
5162306a36Sopenharmony_ci	BUILD_BUG_ON(sizeof(tbs_prefix) != sizeof(bin_prefix));
5262306a36Sopenharmony_ci	prefix_len = sizeof(tbs_prefix) - 1;
5362306a36Sopenharmony_ci	for (i = 0; *desc; desc++, i++) {
5462306a36Sopenharmony_ci		if (*desc == ':') {
5562306a36Sopenharmony_ci			if (tbs_step == prefix_len)
5662306a36Sopenharmony_ci				goto found_colon;
5762306a36Sopenharmony_ci			if (bin_step == prefix_len)
5862306a36Sopenharmony_ci				goto found_colon;
5962306a36Sopenharmony_ci			return -EINVAL;
6062306a36Sopenharmony_ci		}
6162306a36Sopenharmony_ci		if (i >= prefix_len)
6262306a36Sopenharmony_ci			return -EINVAL;
6362306a36Sopenharmony_ci		if (*desc == tbs_prefix[i])
6462306a36Sopenharmony_ci			tbs_step++;
6562306a36Sopenharmony_ci		if (*desc == bin_prefix[i])
6662306a36Sopenharmony_ci			bin_step++;
6762306a36Sopenharmony_ci	}
6862306a36Sopenharmony_ci	return -EINVAL;
6962306a36Sopenharmony_ci
7062306a36Sopenharmony_cifound_colon:
7162306a36Sopenharmony_ci	desc++;
7262306a36Sopenharmony_ci	for (i = 0; *desc && i < MAX_HASH_LEN; desc++, i++) {
7362306a36Sopenharmony_ci		if (!isxdigit(*desc) || isupper(*desc))
7462306a36Sopenharmony_ci			return -EINVAL;
7562306a36Sopenharmony_ci	}
7662306a36Sopenharmony_ci	if (*desc)
7762306a36Sopenharmony_ci		/* The hash is greater than MAX_HASH_LEN. */
7862306a36Sopenharmony_ci		return -ENOPKG;
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_ci	/* Checks for an even number of hexadecimal characters. */
8162306a36Sopenharmony_ci	if (i == 0 || i & 1)
8262306a36Sopenharmony_ci		return -EINVAL;
8362306a36Sopenharmony_ci	return 0;
8462306a36Sopenharmony_ci}
8562306a36Sopenharmony_ci
8662306a36Sopenharmony_cistatic int blacklist_key_instantiate(struct key *key,
8762306a36Sopenharmony_ci		struct key_preparsed_payload *prep)
8862306a36Sopenharmony_ci{
8962306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE
9062306a36Sopenharmony_ci	int err;
9162306a36Sopenharmony_ci#endif
9262306a36Sopenharmony_ci
9362306a36Sopenharmony_ci	/* Sets safe default permissions for keys loaded by user space. */
9462306a36Sopenharmony_ci	key->perm = BLACKLIST_KEY_PERM;
9562306a36Sopenharmony_ci
9662306a36Sopenharmony_ci	/*
9762306a36Sopenharmony_ci	 * Skips the authentication step for builtin hashes, they are not
9862306a36Sopenharmony_ci	 * signed but still trusted.
9962306a36Sopenharmony_ci	 */
10062306a36Sopenharmony_ci	if (key->flags & (1 << KEY_FLAG_BUILTIN))
10162306a36Sopenharmony_ci		goto out;
10262306a36Sopenharmony_ci
10362306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE
10462306a36Sopenharmony_ci	/*
10562306a36Sopenharmony_ci	 * Verifies the description's PKCS#7 signature against the builtin
10662306a36Sopenharmony_ci	 * trusted keyring.
10762306a36Sopenharmony_ci	 */
10862306a36Sopenharmony_ci	err = verify_pkcs7_signature(key->description,
10962306a36Sopenharmony_ci			strlen(key->description), prep->data, prep->datalen,
11062306a36Sopenharmony_ci			NULL, VERIFYING_UNSPECIFIED_SIGNATURE, NULL, NULL);
11162306a36Sopenharmony_ci	if (err)
11262306a36Sopenharmony_ci		return err;
11362306a36Sopenharmony_ci#else
11462306a36Sopenharmony_ci	/*
11562306a36Sopenharmony_ci	 * It should not be possible to come here because the keyring doesn't
11662306a36Sopenharmony_ci	 * have KEY_USR_WRITE and the only other way to call this function is
11762306a36Sopenharmony_ci	 * for builtin hashes.
11862306a36Sopenharmony_ci	 */
11962306a36Sopenharmony_ci	WARN_ON_ONCE(1);
12062306a36Sopenharmony_ci	return -EPERM;
12162306a36Sopenharmony_ci#endif
12262306a36Sopenharmony_ci
12362306a36Sopenharmony_ciout:
12462306a36Sopenharmony_ci	return generic_key_instantiate(key, prep);
12562306a36Sopenharmony_ci}
12662306a36Sopenharmony_ci
12762306a36Sopenharmony_cistatic int blacklist_key_update(struct key *key,
12862306a36Sopenharmony_ci		struct key_preparsed_payload *prep)
12962306a36Sopenharmony_ci{
13062306a36Sopenharmony_ci	return -EPERM;
13162306a36Sopenharmony_ci}
13262306a36Sopenharmony_ci
13362306a36Sopenharmony_cistatic void blacklist_describe(const struct key *key, struct seq_file *m)
13462306a36Sopenharmony_ci{
13562306a36Sopenharmony_ci	seq_puts(m, key->description);
13662306a36Sopenharmony_ci}
13762306a36Sopenharmony_ci
13862306a36Sopenharmony_cistatic struct key_type key_type_blacklist = {
13962306a36Sopenharmony_ci	.name			= "blacklist",
14062306a36Sopenharmony_ci	.vet_description	= blacklist_vet_description,
14162306a36Sopenharmony_ci	.instantiate		= blacklist_key_instantiate,
14262306a36Sopenharmony_ci	.update			= blacklist_key_update,
14362306a36Sopenharmony_ci	.describe		= blacklist_describe,
14462306a36Sopenharmony_ci};
14562306a36Sopenharmony_ci
14662306a36Sopenharmony_cistatic char *get_raw_hash(const u8 *hash, size_t hash_len,
14762306a36Sopenharmony_ci		enum blacklist_hash_type hash_type)
14862306a36Sopenharmony_ci{
14962306a36Sopenharmony_ci	size_t type_len;
15062306a36Sopenharmony_ci	const char *type_prefix;
15162306a36Sopenharmony_ci	char *buffer, *p;
15262306a36Sopenharmony_ci
15362306a36Sopenharmony_ci	switch (hash_type) {
15462306a36Sopenharmony_ci	case BLACKLIST_HASH_X509_TBS:
15562306a36Sopenharmony_ci		type_len = sizeof(tbs_prefix) - 1;
15662306a36Sopenharmony_ci		type_prefix = tbs_prefix;
15762306a36Sopenharmony_ci		break;
15862306a36Sopenharmony_ci	case BLACKLIST_HASH_BINARY:
15962306a36Sopenharmony_ci		type_len = sizeof(bin_prefix) - 1;
16062306a36Sopenharmony_ci		type_prefix = bin_prefix;
16162306a36Sopenharmony_ci		break;
16262306a36Sopenharmony_ci	default:
16362306a36Sopenharmony_ci		WARN_ON_ONCE(1);
16462306a36Sopenharmony_ci		return ERR_PTR(-EINVAL);
16562306a36Sopenharmony_ci	}
16662306a36Sopenharmony_ci	buffer = kmalloc(type_len + 1 + hash_len * 2 + 1, GFP_KERNEL);
16762306a36Sopenharmony_ci	if (!buffer)
16862306a36Sopenharmony_ci		return ERR_PTR(-ENOMEM);
16962306a36Sopenharmony_ci	p = memcpy(buffer, type_prefix, type_len);
17062306a36Sopenharmony_ci	p += type_len;
17162306a36Sopenharmony_ci	*p++ = ':';
17262306a36Sopenharmony_ci	bin2hex(p, hash, hash_len);
17362306a36Sopenharmony_ci	p += hash_len * 2;
17462306a36Sopenharmony_ci	*p = '\0';
17562306a36Sopenharmony_ci	return buffer;
17662306a36Sopenharmony_ci}
17762306a36Sopenharmony_ci
17862306a36Sopenharmony_ci/**
17962306a36Sopenharmony_ci * mark_raw_hash_blacklisted - Add a hash to the system blacklist
18062306a36Sopenharmony_ci * @hash: The hash as a hex string with a type prefix (eg. "tbs:23aa429783")
18162306a36Sopenharmony_ci */
18262306a36Sopenharmony_cistatic int mark_raw_hash_blacklisted(const char *hash)
18362306a36Sopenharmony_ci{
18462306a36Sopenharmony_ci	key_ref_t key;
18562306a36Sopenharmony_ci
18662306a36Sopenharmony_ci	key = key_create(make_key_ref(blacklist_keyring, true),
18762306a36Sopenharmony_ci			 "blacklist",
18862306a36Sopenharmony_ci			 hash,
18962306a36Sopenharmony_ci			 NULL,
19062306a36Sopenharmony_ci			 0,
19162306a36Sopenharmony_ci			 BLACKLIST_KEY_PERM,
19262306a36Sopenharmony_ci			 KEY_ALLOC_NOT_IN_QUOTA |
19362306a36Sopenharmony_ci			 KEY_ALLOC_BUILT_IN);
19462306a36Sopenharmony_ci	if (IS_ERR(key)) {
19562306a36Sopenharmony_ci		if (PTR_ERR(key) == -EEXIST)
19662306a36Sopenharmony_ci			pr_warn("Duplicate blacklisted hash %s\n", hash);
19762306a36Sopenharmony_ci		else
19862306a36Sopenharmony_ci			pr_err("Problem blacklisting hash %s: %pe\n", hash, key);
19962306a36Sopenharmony_ci		return PTR_ERR(key);
20062306a36Sopenharmony_ci	}
20162306a36Sopenharmony_ci	return 0;
20262306a36Sopenharmony_ci}
20362306a36Sopenharmony_ci
20462306a36Sopenharmony_ciint mark_hash_blacklisted(const u8 *hash, size_t hash_len,
20562306a36Sopenharmony_ci		enum blacklist_hash_type hash_type)
20662306a36Sopenharmony_ci{
20762306a36Sopenharmony_ci	const char *buffer;
20862306a36Sopenharmony_ci	int err;
20962306a36Sopenharmony_ci
21062306a36Sopenharmony_ci	buffer = get_raw_hash(hash, hash_len, hash_type);
21162306a36Sopenharmony_ci	if (IS_ERR(buffer))
21262306a36Sopenharmony_ci		return PTR_ERR(buffer);
21362306a36Sopenharmony_ci	err = mark_raw_hash_blacklisted(buffer);
21462306a36Sopenharmony_ci	kfree(buffer);
21562306a36Sopenharmony_ci	return err;
21662306a36Sopenharmony_ci}
21762306a36Sopenharmony_ci
21862306a36Sopenharmony_ci/**
21962306a36Sopenharmony_ci * is_hash_blacklisted - Determine if a hash is blacklisted
22062306a36Sopenharmony_ci * @hash: The hash to be checked as a binary blob
22162306a36Sopenharmony_ci * @hash_len: The length of the binary hash
22262306a36Sopenharmony_ci * @hash_type: Type of hash
22362306a36Sopenharmony_ci */
22462306a36Sopenharmony_ciint is_hash_blacklisted(const u8 *hash, size_t hash_len,
22562306a36Sopenharmony_ci		enum blacklist_hash_type hash_type)
22662306a36Sopenharmony_ci{
22762306a36Sopenharmony_ci	key_ref_t kref;
22862306a36Sopenharmony_ci	const char *buffer;
22962306a36Sopenharmony_ci	int ret = 0;
23062306a36Sopenharmony_ci
23162306a36Sopenharmony_ci	buffer = get_raw_hash(hash, hash_len, hash_type);
23262306a36Sopenharmony_ci	if (IS_ERR(buffer))
23362306a36Sopenharmony_ci		return PTR_ERR(buffer);
23462306a36Sopenharmony_ci	kref = keyring_search(make_key_ref(blacklist_keyring, true),
23562306a36Sopenharmony_ci			      &key_type_blacklist, buffer, false);
23662306a36Sopenharmony_ci	if (!IS_ERR(kref)) {
23762306a36Sopenharmony_ci		key_ref_put(kref);
23862306a36Sopenharmony_ci		ret = -EKEYREJECTED;
23962306a36Sopenharmony_ci	}
24062306a36Sopenharmony_ci
24162306a36Sopenharmony_ci	kfree(buffer);
24262306a36Sopenharmony_ci	return ret;
24362306a36Sopenharmony_ci}
24462306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(is_hash_blacklisted);
24562306a36Sopenharmony_ci
24662306a36Sopenharmony_ciint is_binary_blacklisted(const u8 *hash, size_t hash_len)
24762306a36Sopenharmony_ci{
24862306a36Sopenharmony_ci	if (is_hash_blacklisted(hash, hash_len, BLACKLIST_HASH_BINARY) ==
24962306a36Sopenharmony_ci			-EKEYREJECTED)
25062306a36Sopenharmony_ci		return -EPERM;
25162306a36Sopenharmony_ci
25262306a36Sopenharmony_ci	return 0;
25362306a36Sopenharmony_ci}
25462306a36Sopenharmony_ciEXPORT_SYMBOL_GPL(is_binary_blacklisted);
25562306a36Sopenharmony_ci
25662306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_REVOCATION_LIST
25762306a36Sopenharmony_ci/**
25862306a36Sopenharmony_ci * add_key_to_revocation_list - Add a revocation certificate to the blacklist
25962306a36Sopenharmony_ci * @data: The data blob containing the certificate
26062306a36Sopenharmony_ci * @size: The size of data blob
26162306a36Sopenharmony_ci */
26262306a36Sopenharmony_ciint add_key_to_revocation_list(const char *data, size_t size)
26362306a36Sopenharmony_ci{
26462306a36Sopenharmony_ci	key_ref_t key;
26562306a36Sopenharmony_ci
26662306a36Sopenharmony_ci	key = key_create_or_update(make_key_ref(blacklist_keyring, true),
26762306a36Sopenharmony_ci				   "asymmetric",
26862306a36Sopenharmony_ci				   NULL,
26962306a36Sopenharmony_ci				   data,
27062306a36Sopenharmony_ci				   size,
27162306a36Sopenharmony_ci				   KEY_POS_VIEW | KEY_POS_READ | KEY_POS_SEARCH
27262306a36Sopenharmony_ci				   | KEY_USR_VIEW,
27362306a36Sopenharmony_ci				   KEY_ALLOC_NOT_IN_QUOTA | KEY_ALLOC_BUILT_IN
27462306a36Sopenharmony_ci				   | KEY_ALLOC_BYPASS_RESTRICTION);
27562306a36Sopenharmony_ci
27662306a36Sopenharmony_ci	if (IS_ERR(key)) {
27762306a36Sopenharmony_ci		pr_err("Problem with revocation key (%ld)\n", PTR_ERR(key));
27862306a36Sopenharmony_ci		return PTR_ERR(key);
27962306a36Sopenharmony_ci	}
28062306a36Sopenharmony_ci
28162306a36Sopenharmony_ci	return 0;
28262306a36Sopenharmony_ci}
28362306a36Sopenharmony_ci
28462306a36Sopenharmony_ci/**
28562306a36Sopenharmony_ci * is_key_on_revocation_list - Determine if the key for a PKCS#7 message is revoked
28662306a36Sopenharmony_ci * @pkcs7: The PKCS#7 message to check
28762306a36Sopenharmony_ci */
28862306a36Sopenharmony_ciint is_key_on_revocation_list(struct pkcs7_message *pkcs7)
28962306a36Sopenharmony_ci{
29062306a36Sopenharmony_ci	int ret;
29162306a36Sopenharmony_ci
29262306a36Sopenharmony_ci	ret = pkcs7_validate_trust(pkcs7, blacklist_keyring);
29362306a36Sopenharmony_ci
29462306a36Sopenharmony_ci	if (ret == 0)
29562306a36Sopenharmony_ci		return -EKEYREJECTED;
29662306a36Sopenharmony_ci
29762306a36Sopenharmony_ci	return -ENOKEY;
29862306a36Sopenharmony_ci}
29962306a36Sopenharmony_ci#endif
30062306a36Sopenharmony_ci
30162306a36Sopenharmony_cistatic int restrict_link_for_blacklist(struct key *dest_keyring,
30262306a36Sopenharmony_ci		const struct key_type *type, const union key_payload *payload,
30362306a36Sopenharmony_ci		struct key *restrict_key)
30462306a36Sopenharmony_ci{
30562306a36Sopenharmony_ci	if (type == &key_type_blacklist)
30662306a36Sopenharmony_ci		return 0;
30762306a36Sopenharmony_ci	return -EOPNOTSUPP;
30862306a36Sopenharmony_ci}
30962306a36Sopenharmony_ci
31062306a36Sopenharmony_ci/*
31162306a36Sopenharmony_ci * Initialise the blacklist
31262306a36Sopenharmony_ci *
31362306a36Sopenharmony_ci * The blacklist_init() function is registered as an initcall via
31462306a36Sopenharmony_ci * device_initcall().  As a result if the blacklist_init() function fails for
31562306a36Sopenharmony_ci * any reason the kernel continues to execute.  While cleanly returning -ENODEV
31662306a36Sopenharmony_ci * could be acceptable for some non-critical kernel parts, if the blacklist
31762306a36Sopenharmony_ci * keyring fails to load it defeats the certificate/key based deny list for
31862306a36Sopenharmony_ci * signed modules.  If a critical piece of security functionality that users
31962306a36Sopenharmony_ci * expect to be present fails to initialize, panic()ing is likely the right
32062306a36Sopenharmony_ci * thing to do.
32162306a36Sopenharmony_ci */
32262306a36Sopenharmony_cistatic int __init blacklist_init(void)
32362306a36Sopenharmony_ci{
32462306a36Sopenharmony_ci	const char *const *bl;
32562306a36Sopenharmony_ci	struct key_restriction *restriction;
32662306a36Sopenharmony_ci
32762306a36Sopenharmony_ci	if (register_key_type(&key_type_blacklist) < 0)
32862306a36Sopenharmony_ci		panic("Can't allocate system blacklist key type\n");
32962306a36Sopenharmony_ci
33062306a36Sopenharmony_ci	restriction = kzalloc(sizeof(*restriction), GFP_KERNEL);
33162306a36Sopenharmony_ci	if (!restriction)
33262306a36Sopenharmony_ci		panic("Can't allocate blacklist keyring restriction\n");
33362306a36Sopenharmony_ci	restriction->check = restrict_link_for_blacklist;
33462306a36Sopenharmony_ci
33562306a36Sopenharmony_ci	blacklist_keyring =
33662306a36Sopenharmony_ci		keyring_alloc(".blacklist",
33762306a36Sopenharmony_ci			      GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, current_cred(),
33862306a36Sopenharmony_ci			      KEY_POS_VIEW | KEY_POS_READ | KEY_POS_SEARCH |
33962306a36Sopenharmony_ci			      KEY_POS_WRITE |
34062306a36Sopenharmony_ci			      KEY_USR_VIEW | KEY_USR_READ | KEY_USR_SEARCH
34162306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_BLACKLIST_AUTH_UPDATE
34262306a36Sopenharmony_ci			      | KEY_USR_WRITE
34362306a36Sopenharmony_ci#endif
34462306a36Sopenharmony_ci			      , KEY_ALLOC_NOT_IN_QUOTA |
34562306a36Sopenharmony_ci			      KEY_ALLOC_SET_KEEP,
34662306a36Sopenharmony_ci			      restriction, NULL);
34762306a36Sopenharmony_ci	if (IS_ERR(blacklist_keyring))
34862306a36Sopenharmony_ci		panic("Can't allocate system blacklist keyring\n");
34962306a36Sopenharmony_ci
35062306a36Sopenharmony_ci	for (bl = blacklist_hashes; *bl; bl++)
35162306a36Sopenharmony_ci		if (mark_raw_hash_blacklisted(*bl) < 0)
35262306a36Sopenharmony_ci			pr_err("- blacklisting failed\n");
35362306a36Sopenharmony_ci	return 0;
35462306a36Sopenharmony_ci}
35562306a36Sopenharmony_ci
35662306a36Sopenharmony_ci/*
35762306a36Sopenharmony_ci * Must be initialised before we try and load the keys into the keyring.
35862306a36Sopenharmony_ci */
35962306a36Sopenharmony_cidevice_initcall(blacklist_init);
36062306a36Sopenharmony_ci
36162306a36Sopenharmony_ci#ifdef CONFIG_SYSTEM_REVOCATION_LIST
36262306a36Sopenharmony_ci/*
36362306a36Sopenharmony_ci * Load the compiled-in list of revocation X.509 certificates.
36462306a36Sopenharmony_ci */
36562306a36Sopenharmony_cistatic __init int load_revocation_certificate_list(void)
36662306a36Sopenharmony_ci{
36762306a36Sopenharmony_ci	if (revocation_certificate_list_size)
36862306a36Sopenharmony_ci		pr_notice("Loading compiled-in revocation X.509 certificates\n");
36962306a36Sopenharmony_ci
37062306a36Sopenharmony_ci	return x509_load_certificate_list(revocation_certificate_list,
37162306a36Sopenharmony_ci					  revocation_certificate_list_size,
37262306a36Sopenharmony_ci					  blacklist_keyring);
37362306a36Sopenharmony_ci}
37462306a36Sopenharmony_cilate_initcall(load_revocation_certificate_list);
37562306a36Sopenharmony_ci#endif
376