]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/keys/system_keyring.h
KEYS: Remove KEY_FLAG_TRUSTED and KEY_ALLOC_TRUSTED
[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,
a511e1af 21 const union key_payload *payload);
b56e5a17 22
3be4beaf 23#else
a511e1af 24#define restrict_link_by_builtin_trusted restrict_link_reject
b56e5a17
DH
25#endif
26
41c89b64
PM
27#ifdef CONFIG_IMA_MOK_KEYRING
28extern struct key *ima_mok_keyring;
29extern struct key *ima_blacklist_keyring;
30
31static inline struct key *get_ima_mok_keyring(void)
32{
33 return ima_mok_keyring;
34}
35static inline struct key *get_ima_blacklist_keyring(void)
36{
37 return ima_blacklist_keyring;
38}
39#else
40static inline struct key *get_ima_mok_keyring(void)
41{
42 return NULL;
43}
44static inline struct key *get_ima_blacklist_keyring(void)
45{
46 return NULL;
47}
48#endif /* CONFIG_IMA_MOK_KEYRING */
49
50
b56e5a17 51#endif /* _KEYS_SYSTEM_KEYRING_H */