system_keyring.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. #ifdef CONFIG_SYSTEM_TRUSTED_KEYRING
  14. #include <linux/key.h>
  15. #include <crypto/public_key.h>
  16. extern struct key *system_trusted_keyring;
  17. static inline struct key *get_system_trusted_keyring(void)
  18. {
  19. return system_trusted_keyring;
  20. }
  21. #else
  22. static inline struct key *get_system_trusted_keyring(void)
  23. {
  24. return NULL;
  25. }
  26. #endif
  27. #ifdef CONFIG_SYSTEM_DATA_VERIFICATION
  28. extern int system_verify_data(const void *data, unsigned long len,
  29. const void *raw_pkcs7, size_t pkcs7_len,
  30. enum key_being_used_for usage);
  31. #endif
  32. #endif /* _KEYS_SYSTEM_KEYRING_H */