]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/keys/system_keyring.h
netfilter: ipset: use bitmap infrastructure completely
[mirror_ubuntu-bionic-kernel.git] / include / keys / system_keyring.h
CommitLineData
b56e5a17
DH
1/* System keyring containing trusted public keys.
2 *
3 * Copyright (C) 2013 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
10 */
11
12#ifndef _KEYS_SYSTEM_KEYRING_H
13#define _KEYS_SYSTEM_KEYRING_H
14
a511e1af
DH
15#include <linux/key.h>
16
b56e5a17
DH
17#ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
18
a511e1af
DH
19extern int restrict_link_by_builtin_trusted(struct key *keyring,
20 const struct key_type *type,
aaf66c88
MM
21 const union key_payload *payload,
22 struct key *restriction_key);
b56e5a17 23
3be4beaf 24#else
a511e1af 25#define restrict_link_by_builtin_trusted restrict_link_reject
b56e5a17
DH
26#endif
27
d3bfe841
DH
28#ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
29extern int restrict_link_by_builtin_and_secondary_trusted(
30 struct key *keyring,
31 const struct key_type *type,
aaf66c88
MM
32 const union key_payload *payload,
33 struct key *restriction_key);
d3bfe841
DH
34#else
35#define restrict_link_by_builtin_and_secondary_trusted restrict_link_by_builtin_trusted
36#endif
37
734114f8
DH
38#ifdef CONFIG_SYSTEM_BLACKLIST_KEYRING
39extern int mark_hash_blacklisted(const char *hash);
40extern int is_hash_blacklisted(const u8 *hash, size_t hash_len,
41 const char *type);
42#else
43static inline int is_hash_blacklisted(const u8 *hash, size_t hash_len,
44 const char *type)
45{
46 return 0;
47}
48#endif
49
56104cf2 50#ifdef CONFIG_IMA_BLACKLIST_KEYRING
41c89b64
PM
51extern struct key *ima_blacklist_keyring;
52
41c89b64
PM
53static inline struct key *get_ima_blacklist_keyring(void)
54{
55 return ima_blacklist_keyring;
56}
57#else
41c89b64
PM
58static inline struct key *get_ima_blacklist_keyring(void)
59{
60 return NULL;
61}
56104cf2 62#endif /* CONFIG_IMA_BLACKLIST_KEYRING */
41c89b64
PM
63
64
b56e5a17 65#endif /* _KEYS_SYSTEM_KEYRING_H */