Lines Matching refs:id

42 static struct key *integrity_keyring_from_id(const unsigned int id)  in integrity_keyring_from_id()  argument
44 if (id >= INTEGRITY_KEYRING_MAX) in integrity_keyring_from_id()
47 if (!keyring[id]) { in integrity_keyring_from_id()
48 keyring[id] = in integrity_keyring_from_id()
49 request_key(&key_type_keyring, keyring_name[id], NULL); in integrity_keyring_from_id()
50 if (IS_ERR(keyring[id])) { in integrity_keyring_from_id()
51 int err = PTR_ERR(keyring[id]); in integrity_keyring_from_id()
52 pr_err("no %s keyring: %d\n", keyring_name[id], err); in integrity_keyring_from_id()
53 keyring[id] = NULL; in integrity_keyring_from_id()
58 return keyring[id]; in integrity_keyring_from_id()
61 int integrity_digsig_verify(const unsigned int id, const char *sig, int siglen, in integrity_digsig_verify() argument
69 keyring = integrity_keyring_from_id(id); in integrity_digsig_verify()
87 int integrity_modsig_verify(const unsigned int id, const struct modsig *modsig) in integrity_modsig_verify() argument
91 keyring = integrity_keyring_from_id(id); in integrity_modsig_verify()
98 static int __init __integrity_init_keyring(const unsigned int id, in __integrity_init_keyring() argument
105 keyring[id] = keyring_alloc(keyring_name[id], KUIDT_INIT(0), in __integrity_init_keyring()
108 if (IS_ERR(keyring[id])) { in __integrity_init_keyring()
109 err = PTR_ERR(keyring[id]); in __integrity_init_keyring()
111 keyring_name[id], err); in __integrity_init_keyring()
112 keyring[id] = NULL; in __integrity_init_keyring()
114 if (id == INTEGRITY_KEYRING_PLATFORM) in __integrity_init_keyring()
115 set_platform_trusted_keys(keyring[id]); in __integrity_init_keyring()
116 if (id == INTEGRITY_KEYRING_MACHINE && imputed_trust_enabled()) in __integrity_init_keyring()
117 set_machine_trusted_keys(keyring[id]); in __integrity_init_keyring()
118 if (id == INTEGRITY_KEYRING_IMA) in __integrity_init_keyring()
119 load_module_cert(keyring[id]); in __integrity_init_keyring()
125 int __init integrity_init_keyring(const unsigned int id) in integrity_init_keyring() argument
134 if (id == INTEGRITY_KEYRING_PLATFORM || in integrity_init_keyring()
135 (id == INTEGRITY_KEYRING_MACHINE && in integrity_init_keyring()
148 if (id == INTEGRITY_KEYRING_MACHINE) in integrity_init_keyring()
158 if (id != INTEGRITY_KEYRING_MACHINE) in integrity_init_keyring()
162 ret = __integrity_init_keyring(id, perm, restriction); in integrity_init_keyring()
168 static int __init integrity_add_key(const unsigned int id, const void *data, in integrity_add_key() argument
174 if (!keyring[id]) in integrity_add_key()
177 key = key_create_or_update(make_key_ref(keyring[id], 1), "asymmetric", in integrity_add_key()
193 int __init integrity_load_x509(const unsigned int id, const char *path) in integrity_load_x509() argument
211 rc = integrity_add_key(id, (const void *)data, size, perm); in integrity_load_x509()
217 int __init integrity_load_cert(const unsigned int id, const char *source, in integrity_load_cert() argument
224 return integrity_add_key(id, data, len, perm); in integrity_load_cert()