diff options
Diffstat (limited to 'include/linux/verification.h')
-rw-r--r-- | include/linux/verification.h | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/verification.h b/include/linux/verification.h index 911ab7c2b1ab..4f3022d081c3 100644 --- a/include/linux/verification.h +++ b/include/linux/verification.h @@ -8,6 +8,9 @@ #ifndef _LINUX_VERIFICATION_H #define _LINUX_VERIFICATION_H +#include <linux/errno.h> +#include <linux/types.h> + /* * Indicate that both builtin trusted keys and secondary trusted keys * should be used. @@ -15,6 +18,14 @@ #define VERIFY_USE_SECONDARY_KEYRING ((struct key *)1UL) #define VERIFY_USE_PLATFORM_KEYRING ((struct key *)2UL) +static inline int system_keyring_id_check(u64 id) +{ + if (id > (unsigned long)VERIFY_USE_PLATFORM_KEYRING) + return -EINVAL; + + return 0; +} + /* * The use to which an asymmetric key is being put. */ @@ -27,8 +38,6 @@ enum key_being_used_for { VERIFYING_UNSPECIFIED_SIGNATURE, NR__KEY_BEING_USED_FOR }; -extern const char *const key_being_used_for[NR__KEY_BEING_USED_FOR]; - #ifdef CONFIG_SYSTEM_DATA_VERIFICATION struct key; |