integrity: Load certs to the platform keyring
The patch refactors integrity_load_x509(), making it a wrapper for a new function named integrity_add_key(). This patch also defines a new function named integrity_load_cert() for loading the platform keys. Signed-off-by: Nayna Jain <nayna@linux.ibm.com> Reviewed-by: Mimi Zohar <zohar@linux.ibm.com> Acked-by: Serge Hallyn <serge@hallyn.com> Reviewed-by: James Morris <james.morris@microsoft.com> Reviewed-by: Thiago Jung Bauermann <bauerman@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
Этот коммит содержится в:

коммит произвёл
Mimi Zohar

родитель
9dc92c4517
Коммит
60740accf7
@@ -154,6 +154,8 @@ int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen,
|
||||
|
||||
int __init integrity_init_keyring(const unsigned int id);
|
||||
int __init integrity_load_x509(const unsigned int id, const char *path);
|
||||
int __init integrity_load_cert(const unsigned int id, const char *source,
|
||||
const void *data, size_t len, key_perm_t perm);
|
||||
#else
|
||||
|
||||
static inline int integrity_digsig_verify(const unsigned int id,
|
||||
@@ -167,6 +169,14 @@ static inline int integrity_init_keyring(const unsigned int id)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __init integrity_load_cert(const unsigned int id,
|
||||
const char *source,
|
||||
const void *data, size_t len,
|
||||
key_perm_t perm)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
#endif /* CONFIG_INTEGRITY_SIGNATURE */
|
||||
|
||||
#ifdef CONFIG_INTEGRITY_ASYMMETRIC_KEYS
|
||||
@@ -223,3 +233,13 @@ integrity_audit_log_start(struct audit_context *ctx, gfp_t gfp_mask, int type)
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INTEGRITY_PLATFORM_KEYRING
|
||||
void __init add_to_platform_keyring(const char *source, const void *data,
|
||||
size_t len);
|
||||
#else
|
||||
static inline void __init add_to_platform_keyring(const char *source,
|
||||
const void *data, size_t len)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
Ссылка в новой задаче
Block a user