system_keyring.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #ifndef _KEYS_SYSTEM_KEYRING_H
  12. #define _KEYS_SYSTEM_KEYRING_H
  13. #include <linux/key.h>
  14. #ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
  15. extern int restrict_link_by_builtin_trusted(struct key *keyring,
  16. const struct key_type *type,
  17. const union key_payload *payload);
  18. #else
  19. #define restrict_link_by_builtin_trusted restrict_link_reject
  20. #endif
  21. #ifdef CONFIG_SECONDARY_TRUSTED_KEYRING
  22. extern int restrict_link_by_builtin_and_secondary_trusted(
  23. struct key *keyring,
  24. const struct key_type *type,
  25. const union key_payload *payload);
  26. #else
  27. #define restrict_link_by_builtin_and_secondary_trusted restrict_link_by_builtin_trusted
  28. #endif
  29. #ifdef CONFIG_IMA_BLACKLIST_KEYRING
  30. extern struct key *ima_blacklist_keyring;
  31. static inline struct key *get_ima_blacklist_keyring(void)
  32. {
  33. return ima_blacklist_keyring;
  34. }
  35. #else
  36. static inline struct key *get_ima_blacklist_keyring(void)
  37. {
  38. return NULL;
  39. }
  40. #endif /* CONFIG_IMA_BLACKLIST_KEYRING */
  41. #endif /* _KEYS_SYSTEM_KEYRING_H */